Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1179585imj; Thu, 14 Feb 2019 02:31:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IaC8TAl+qg1/9zcBuzJkyobxGpD4VFj5M+WMRjvXaeKxBP45Ev4/JtVGkpkXUCT+SvBKqf/ X-Received: by 2002:a17:902:e090:: with SMTP id cb16mr3287636plb.32.1550140261933; Thu, 14 Feb 2019 02:31:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550140261; cv=none; d=google.com; s=arc-20160816; b=n4wBJ5vufaQOGeaArFRNbIVIL6y32Kd/mow7k0lxwBTIGx/45YacWl4RhhhBZPpjGq 1eADDk0Q8/riRR6nJ+hF2KXP40rNkSRy0RLhZLO6g0cDYyBqdFGypUc6XuWxhyWeKrzG 2GyKPvOxO/q0zZV7tvyP10brDqtL5Uyi+vbBhnmCqRIkpbDRa/acBYwoV+98Gz3Kjma4 z0GtBGfAPcPrKhgkr68RPmSnL6iPklbcee8dU7QUlxfDJbL+Inucg+UA2IllTSxPTMbx RccOtDINXerBzakQpetF5bC6YDNq8asnf3d/rBOYhqivSG6Xz/grvpmhv8dzeTy6nniU z2AA== 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=ao2zNPPAVKm6DVngcSIODmeIuZt8Da7c4FKcqwlcUWs=; b=ryKVjZz2zHaCsWTAgV2C82sqAZkHTF5RZ0pMpS3rBsIMJlya2kA5FU57EIb6U8P5/Z 3uLruXN8E+d4RzgNh8wqi6pN8UxZoPOSB1H2Urq3iMBoFd35nEHzp8wB37/wy6jRnerT 8UX0b9cfQzjUV20wVo/S0Y2qGmjWprJR/zBU4TybNsKLFshTlvqft+QECTAGmo10oytr jNAAzgIrT+EhVVGbwwNREAV6QqzmwiaUrDs7jAWcGG+3Hv8dWfKZO8o4d4Pwe5odmdfy Dok7w4VAb9yT+kzxostT6itAw7LwKDj04zEBnZRx4bd/Lv46k3CchGXRn4aGFg7sXYMC Jx7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UgLNxFkX; 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 p9si2121278pgc.448.2019.02.14.02.30.44; Thu, 14 Feb 2019 02:31:01 -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=UgLNxFkX; 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 S2393942AbfBNCKf (ORCPT + 99 others); Wed, 13 Feb 2019 21:10:35 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:38362 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393896AbfBNCKb (ORCPT ); Wed, 13 Feb 2019 21:10:31 -0500 Received: by mail-qt1-f195.google.com with SMTP id 2so5198859qtb.5 for ; Wed, 13 Feb 2019 18:10:30 -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=ao2zNPPAVKm6DVngcSIODmeIuZt8Da7c4FKcqwlcUWs=; b=UgLNxFkXN5F63atBRrO/+dam22AD9xcXt581af1qQdlsAytsMpzMy2XlygaxbDcy9/ IdR0Gl78bheX/LuIAHEvlKI4oUOuU+pKQ5vBGreBFVzSfcJK+pexDAHvgXYuJW6qEPBl MIfREGA1UDearL0vzEYwwS5sS6+qjjF/6wb3Gcbym8V1KeqLvP4ipKSLe9McwMp3CSNH UpqVvpyjWo1zfaHelNPDMWd0FCLwZQe6PSRRiNJ9ddj4VafKY8itk0YlzY/dUVil6rO6 VMMOZPJ9urwPQ3QFJCgCy+asEJADrs9qRwaTlQN7U0ZCrG5bwTg2m/ixn299DpCyB0bU wGjA== 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=ao2zNPPAVKm6DVngcSIODmeIuZt8Da7c4FKcqwlcUWs=; b=TWJsWS64Fnfhd5loSgc8nz+DlJ0G4BoLl6vfQfaVHQoih5jn8qK6j6hbQ+qJ/tpAS6 cZl3RD1fijdRcRy/GZteM+X3iX+04wGazuWpK51UbxHW5MQS98d4yspJiyPy9chzrtIW /qpPaiHlZYruoOXtDZsWRpr4k2PPncqS3N/H/6OHmMbu5U1A47kFkMjp635V8y2jfsVE +z4TLHbhexcLUFydF1DD71u/2wR+zzKQy7jORsNKV7T9Hb2NKsqC0Zl7wGBIlHon9r4e taqW2+xLO9t5FaPanS3HVHA2U0y91XztDWT4jQe8eXlDMViQaPKYVdRA9AY+8fad1rLT 0iMg== X-Gm-Message-State: AHQUAuZ8dW2BrPPLiucxTf3+7/mnSOq1nyeBfTiwCc4eL93dhSmCtzya wHiwE32VffsNVyLyJT/KE+yznA== X-Received: by 2002:ac8:2c51:: with SMTP id e17mr1032432qta.254.1550110230310; Wed, 13 Feb 2019 18:10:30 -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 d63sm1091575qka.22.2019.02.13.18.10.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 18:10:29 -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.14 V2 04/17] ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user() Date: Wed, 13 Feb 2019 21:10:09 -0500 Message-Id: <20190214021022.5313-5-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190214021022.5313-1-dave.long@linaro.org> References: <20190214021022.5313-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 4abe4909417f..a87684532327 100644 --- a/arch/arm/kernel/sys_oabi-compat.c +++ b/arch/arm/kernel/sys_oabi-compat.c @@ -277,6 +277,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; @@ -295,8 +296,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