From patchwork Thu Aug 1 08:16:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 170359 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp5088555ile; Thu, 1 Aug 2019 01:22:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuU7tfurhq2Mn/fxTS2caZQ6f1AgXTmJ+BYS86JdxbF/7scUkNtQTF0hhOguumQ23UfIdP X-Received: by 2002:a17:90a:2228:: with SMTP id c37mr7390606pje.9.1564647655107; Thu, 01 Aug 2019 01:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564647655; cv=none; d=google.com; s=arc-20160816; b=xf+bwISfzLwMta4TtIhtMA5wTQeg98hhoJovG31hKJK0oLyiHrkh5LcljdtWjyFyP0 rVWPZOUTaLDyjpok+kz8Oq9TrztqXc/bcMGnhj5jNCAtWu+kI62eV314dAx3qY1L7GEC RCIZKbs9topw73gJZjqNB7toVAeoHRsgUBZpX8cZENXbmp1iQDdwLg1wFGTXx3ccGUCp EzwQo/HvKBU1cqfA5fk1+uGoEPohZp0urfZ6OIebipDW0VjGt6S+ZatX+VgYjDFI/miO ApShhgreFvD8+D4auRUjyEtqQRINFDRz7/u1WjsdgfCTxMC6jtAVGgCSqBPiczBaJLAn yYnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PM+p9F/paBphnvI0O8YGjV0kMD9bw/jop01RC1tBzqU=; b=EhfMCspiNVkUJZR0krQkVILLuLshDrw32BsylAl3sLcvmjzOPxANbTXdMDXVnC+s5V ezj58aVPqtcjAXS1YOKrrfzR8JjBnvUnCMX4BYhnlK0XoQbjz9U6ncX9QnwPJQ8S81ZM rEZudp59zogPDGBQUr3IVT1wlZUkBfCC9ytaVrbKF8hECewFneQhTiS4tJeYW0iO5YpJ RrhjhENIbSRuh8Y6ZM5pWmKL2woSlzsKzaUaS3tcNqwtwiQIBEvYyDLXCHpKGZUaKm4k pt1TVNZxSN/G7RYUGdGq03hoKUM7vXeMotn4hf6vQ6JU/xd9d+TT0PgS6pLdfNAkgvMq hmEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o0bXhyKq; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v63si6543334pgd.111.2019.08.01.01.20.54; Thu, 01 Aug 2019 01:20:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o0bXhyKq; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730547AbfHAIUy (ORCPT + 14 others); Thu, 1 Aug 2019 04:20:54 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34942 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbfHAIUx (ORCPT ); Thu, 1 Aug 2019 04:20:53 -0400 Received: by mail-pf1-f193.google.com with SMTP id u14so33624259pfn.2 for ; Thu, 01 Aug 2019 01:20:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PM+p9F/paBphnvI0O8YGjV0kMD9bw/jop01RC1tBzqU=; b=o0bXhyKqYt8kp2xyqrJN+d5+L6zWOZoysvGTEc4rppHnRpkoPu+T4rnS3m4Jm+aRvI sQXJ7oKpn5ETzHEMDgshVmw84/LTRr+AG+d5lPhYx3vl/8kjEcoUyTb+f9Z/tE7ck1xs 7gTkMJKkIt5Gx64KSQCHK+McwRAZN35KWlv8Vp1mb2L75q5NBI1Dan3JB+63h+6B54iV 4ZSBYc8+5DRo4yXMnBg4TH9/kpVbi9ZyAJwa3DEeIQ25dhha1DKlODyU2IetZUpvOG+n DfzIRtDFj4vaEK47flZLyQXsqnbGm9K47CBqs2fPmZj8wswO1/GL3Dn4eFaSjhCw6PAR y49Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PM+p9F/paBphnvI0O8YGjV0kMD9bw/jop01RC1tBzqU=; b=aUh/yDn7pWEJrVWC1n/2+o1F2wJE6NCbMZJZq0Nbabuqbuq+M9SBoy8O5/vkOorujE tOIizxiZ8J3omQ0bswuBPyUrf/DLbBFWwQRebNEZre68mFJUUBmltI1T6qkyLfQwIej8 fixMf+1GvXKwV50W5OJmb0qgypLEAaTktbPEHKczZMFFEyJDpg83tQsZYvqaMLX5eOZ5 tdeLgidwnVNfZM3GRUlK+2+pO6O+zCoUM6XuYUUblkk92/t8eQemRABWhW7eSjeCwA9y fzTKoei4VCfuGykQ8d6krPMI+ZU5mAc255DJJENfHnICZuXpjsGGjOzW67DgvOqlTZWj ZN2Q== X-Gm-Message-State: APjAAAX/bmHLuA1fHw2NFyzvv9HalRPZn0L3TY6CViibzJTqoh6pQFWy G0V2shookxVe4wRwDWC9iTPlIwj2qRI= X-Received: by 2002:a62:7552:: with SMTP id q79mr52190761pfc.71.1564647652996; Thu, 01 Aug 2019 01:20:52 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id o14sm4069908pjp.29.2019.08.01.01.20.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 01:20:52 -0700 (PDT) From: Viresh Kumar To: stable@vger.kernel.org Cc: Viresh Kumar , Julien Thierry , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Marc Zyngier , Mark Rutland , Will Deacon , Russell King , Vincent Guittot , mark.brown@arm.com, guohanjun@huawei.com Subject: [PATCH ARM32 v4.4 V2 30/47] ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user() Date: Thu, 1 Aug 2019 13:46:14 +0530 Message-Id: X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Julien Thierry Commit 319508902600c2688e057750148487996396e9ca upstream. Copy events to user using __copy_to_user() rather than copy members of individually with __put_user_error(). This has the benefit of disabling/enabling PAN once per event intead of once per event member. Signed-off-by: Julien Thierry Signed-off-by: Russell King Signed-off-by: Viresh Kumar --- arch/arm/kernel/sys_oabi-compat.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.21.0.rc0.269.g1a574e7a288b diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c index 640748e27035..d844c5c9364b 100644 --- a/arch/arm/kernel/sys_oabi-compat.c +++ b/arch/arm/kernel/sys_oabi-compat.c @@ -276,6 +276,7 @@ asmlinkage long sys_oabi_epoll_wait(int epfd, int maxevents, int timeout) { struct epoll_event *kbuf; + struct oabi_epoll_event e; mm_segment_t fs; long ret, err, i; @@ -294,8 +295,11 @@ asmlinkage long sys_oabi_epoll_wait(int epfd, set_fs(fs); err = 0; for (i = 0; i < ret; i++) { - __put_user_error(kbuf[i].events, &events->events, err); - __put_user_error(kbuf[i].data, &events->data, err); + e.events = kbuf[i].events; + e.data = kbuf[i].data; + err = __copy_to_user(events, &e, sizeof(e)); + if (err) + break; events++; } kfree(kbuf);