Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp95017imj; Thu, 14 Feb 2019 16:06:39 -0800 (PST) X-Google-Smtp-Source: AHgI3IbVJlg/vULfaJyeLVD8scfPLok6b/c5mFJVnw0fo1xezZOF8yZkGmX3PAMnC+BzlCWL4WKq X-Received: by 2002:a65:4383:: with SMTP id m3mr2409722pgp.96.1550189199126; Thu, 14 Feb 2019 16:06:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550189199; cv=none; d=google.com; s=arc-20160816; b=RzEWKShSFZUbBAOPgb6aLjfKQtp6tTy0te39/Q7kbS3Gi+HiEYOFYI02MKDvo2Xxd3 LNt3tPitIw6xgeUf6B6q5Czpot2qSorgFxGNqoaT4NN/XryM4I4RogZ6JFJCXlAnxsNF ouzqSI7GMEN4FTCphi8nM82iKJef/CzI8n2BcAOh+CHemsG0CY0kRhbbtAu4/Ja43Srh Lx6N1kXbu/4lDkYi6YzFuC9CocaG2miiqIh6J8lB9MnuBuf5RnNQc4gAvwjJ+68ZZSDQ P30LsS/OfLC6nHpa5I6nWlAz7aCErjI9UYN+5lNUccH8HBka7ov9Kx9J/dxeN75ytSbs tGsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=MmV7tN/knUgUsr5/TOMZopkZ7lVFuxceU9ssNxtaR8I=; b=BawInohkgR4e8z6rwYMs+LmtjNEq7IUeMxIo1PlQY2i69QTwqWciVcZ0eAzasNozui K1PgTuNGN6UFTkkGTMawHoF6VrqqhZUokGG6ZbMudHYTbLnyoH1nG3tMkWBkQZW5YXVM +0YReyw+A3xu6LZQgfHnRiFQwUrJ156IouNwP7BGJWTGfwIjL19zqrvz9IwMeCDXO21+ Q0UhtQFvk3oF/nq6vrByxKaC99poFv7L0KSNyt4UG/A+RN5TBWomhu7NO2OzvOCpCb9B 1GgloBCSTJxsj/JOkDZjhvFkFK8s5YNP0ft9UkGHk/Ao8CoZuUdoj4n+Ix8dncq28Q3e NfuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pVsQgHTe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 h22si1203220pgv.198.2019.02.14.16.06.20; Thu, 14 Feb 2019 16:06:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=pVsQgHTe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S2439328AbfBNOtq (ORCPT + 99 others); Thu, 14 Feb 2019 09:49:46 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:36215 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407275AbfBNOti (ORCPT ); Thu, 14 Feb 2019 09:49:38 -0500 Received: by mail-qt1-f193.google.com with SMTP id p25so6815047qtb.3 for ; Thu, 14 Feb 2019 06:49:37 -0800 (PST) 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; bh=MmV7tN/knUgUsr5/TOMZopkZ7lVFuxceU9ssNxtaR8I=; b=pVsQgHTensRPPDJjhW9eW0OSmKFdVMsJXvTV9Wc4PvA8CHgSyb7wXjaB8cRdBYremx 9U6G05RYzbgS7R1ZHlXok7xqM/+QFjru+/prg0CxFiVwEDe1HsXgyODuhH7WoIGJcqIL jjw/FU1o4ox5q8fL9ICBTC0TQbO0wF5O4qVEsz8+9dk+GAWrl7lvvrrOdPQEkOmYdREb s8qe4Gg3w9D1jaCDMQo196jzjVlrWXaybqK1kDWmj7WniLHSzByyuRTmkRk5KOcIuZqE Ad94JzkLfd0SUPIVi5ThlGcigDgaXNyTqQpyXth93478x4TJdqnfPokQFBpY2v0zTvGE AX/A== 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; bh=MmV7tN/knUgUsr5/TOMZopkZ7lVFuxceU9ssNxtaR8I=; b=qUZpGVgE7/k6TegdnCI7sEX/DGD2tGF4oZGkVsJ/whIX9Yju9YSRc7w8cRmMYsXUJX 6lxH4pI4n812mKeHLgwLHn//xVWJV4WYbWFerECey7HGMEYQNmBXIeY8S5hwWm8pwQHV 8nD/brtUSpSuBSmAPKMLH/aKsnVLhlZ5pSUVcTzQcDu3W70B1hhEL/STJBhH8b79dp93 d5uTibTK61wkRVyhZzPFCAv/t+i48gi3pTUZCDk5qybPkianTHR5WnvM5TPNGFNPVoYA or+0YSvzaUP6leztZYcISpeJ06yUM4ZAIR0u/hXsdycJ8rSQ8EDFRynLzoHZjxhhUz88 /rCw== X-Gm-Message-State: AHQUAuZaT1DouVu6NsklRtAxqG8M24/Z+Yf7PU6D6kG0Cudv3X9W6gJW PwHPHufO6VyS+9MTwRFXYe4QIg== X-Received: by 2002:ac8:1413:: with SMTP id k19mr785431qtj.134.1550155777063; Thu, 14 Feb 2019 06:49:37 -0800 (PST) Received: from localhost.localdomain (pool-72-71-243-63.cncdnh.fast00.myfairpoint.net. [72.71.243.63]) by smtp.googlemail.com with ESMTPSA id k66sm1498919qkc.25.2019.02.14.06.49.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 06:49:36 -0800 (PST) From: David Long To: stable@vger.kernel.org, Russell King - ARM Linux , Florian Fainelli , Julien Thierry , Tony Lindgren , Marc Zyngier , Greg KH , Mark Rutland Cc: Will Deacon , Mark Brown , linux-kernel@vger.kernel.org Subject: [PATCH 4.9 03/16] ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user() Date: Thu, 14 Feb 2019 09:49:17 -0500 Message-Id: <20190214144930.27539-4-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190214144930.27539-1-dave.long@linaro.org> References: <20190214144930.27539-1-dave.long@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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: David A. Long --- 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); -- 2.17.1