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: 11070311 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF9C51395 for ; Thu, 1 Aug 2019 08:25:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FF012623D for ; Thu, 1 Aug 2019 08:25:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9110126D08; Thu, 1 Aug 2019 08:25:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2C508262AE for ; Thu, 1 Aug 2019 08:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=maqIrOrzBhoLpo+JdH6pRvSTUSnuPHvn5eYJbs/nNEo=; b=WWcs96TmtJmdEA 9Q5UMDk37B2rtQ+cwIDmiRgqyG3dVB6YwfqlelMAnKwJxArnwric2RXVV0tkLCw/9NvzZAgRtgdWd mDfe3KIMJTxU0hbEzEVPV9HE80IOO1mzQt77Ophu9od4/lr2xc2J3JvIdMrBLxSi3CEeiukSH2yxa OzUS+/Ynxz8xcFDHyxJ1t7EncXwasBEvZBdA/K2IHd8StXrd9uNDrlOjOK5nSpTwTxtA70QsU1ign bqn079fRlLQwJKD0+EPdDsldzGrtHidUbs9/ff/dkLiNMFsR2SuLUV+JwNSVBEt5BuU0J+MT+FM1a c0YYb9IpdfFeUvFi+G8g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1ht6P3-0001mS-Ha; Thu, 01 Aug 2019 08:25:37 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1ht6KT-0002sK-KU for linux-arm-kernel@lists.infradead.org; Thu, 01 Aug 2019 08:20:55 +0000 Received: by mail-pf1-x444.google.com with SMTP id q10so33593011pff.9 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=m1TopebXncqxyjKxQw1vl8dA6AaV547P01I19G5QuYKYfVotxbbmY62KHvuXwcwxAU Uf1r3lJj0ruaUg8qMrJ6w1utb6gvsZ5jv4vtfKvytmnIjOhfEEald7GO2gEoTr1Gkold n/diGr56hRrWaq7XfFNMvgpP+X6XylbPztg4bN54WfxbVb9ClXkLAyUiaFfRErtg8oqu A9H5WiKCk2qjW0MJ3pY5UAnqfbQ8JM3QRzMGriYXrSKB+QaKlHqfmUxQAeAT0txYY83I A/rploSx9T7D4SGa9bScKabXx3y0SgXkRqHlR+HGEKiyECD7THurYN1F+GsMjrsf+Urh 1z6Q== X-Gm-Message-State: APjAAAX9eFKNExo91C2OJ1FoT2I9n4EUkhmY/4dIDpE8UToCoE9/oB8N 35ebAUuOgxFrlF5FSHEIwnQFmw== X-Google-Smtp-Source: APXvYqz3GWx2N/m/nhcWkCouY4H1qYVElKKIkdNdyN42eDSqTyXd8YO3BZzcYLEcjj5aC3TXCQvy/A== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190801_012053_882950_0E2C0AEE X-CRM114-Status: GOOD ( 12.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Julien Thierry , Marc Zyngier , Viresh Kumar , guohanjun@huawei.com, Will Deacon , mark.brown@arm.com, Catalin Marinas , Russell King , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);