Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1092593imj; Thu, 14 Feb 2019 00:52:15 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia3WMfHCxWdlodIy+PeBx1U95kyGTWCe3MQjP9lE5ocXW2hOLRgaeSs2JCDEKTWZo1EKBLj X-Received: by 2002:a62:1112:: with SMTP id z18mr2844370pfi.173.1550134335570; Thu, 14 Feb 2019 00:52:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550134335; cv=none; d=google.com; s=arc-20160816; b=KrCpXX99Md3VKK4kk1oaKK41fcyEzy4tP0GhWlCFTzh6ApmJ3uNUJHncj7ctCZc/Lk wstyApCyzQqxdGfENZ0b3BLQMtvuqTk60LuZFDkSv3zhLlX7bsymuepJOU6G/wYzp9cU tLXLdz1Hi0LdGnbU9x2oLE1gy1JIQXtH9XQXwN4PH/Ms6+CzE45eVwqv1fFp7ICrFc5A 1yTpD1evmUsPSTBIP3yZooZoNeY2UVvP652hWIOlYX+kwEBe6nhv48pPICQN9QsknGP1 FLAfFcZv6m0W0Os6mm6P4wHZ9qSPb+sxyeZxEPO2BDf3XLCfoXR75Ho4C+ZMT9U9Id6c eE0A== 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=XKNS61az1WGOd8AWFZ4ZTIsUVQ0LSar+s/KyUDJcDZM=; b=cCFH88fE5CqfDXCvYNVK2z+CqAhCKBuo7ueeTSB0WZneK9a+I9WfIcEpLx2zVK8/n9 9fS+uZ5MhJtfzGYC4azVuKvlooG3EIcCbaFPpCC114Ba2Dmg3gx46YQn7H7rO7oE5cLN VAlj5KjSn/D7R6hSt2A3GZ83ooEYRpSRZk0KVB4ntUBwH+ciVTvsg/fE2a11w7pG6YYG JwbceVXeUuSwd9K0eXVQhWEmDN3Ewl0vd2oJOQqWR+2ekQVbra3leM2ycv6CzI8gwQ4/ 3OmYKMtLYOOIzc6t71TkraEfwbJ1Sv34Tf3Hv13ogLDD+5a9gS7BlQJGcEPw304EEIvR Gsrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KL+czqKk; 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 9si1169286plf.398.2019.02.14.00.51.59; Thu, 14 Feb 2019 00:52:15 -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=KL+czqKk; 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 S2436764AbfBMVdz (ORCPT + 99 others); Wed, 13 Feb 2019 16:33:55 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:46204 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725838AbfBMVcc (ORCPT ); Wed, 13 Feb 2019 16:32:32 -0500 Received: by mail-qt1-f194.google.com with SMTP id y20so4409095qtm.13 for ; Wed, 13 Feb 2019 13:32:31 -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=XKNS61az1WGOd8AWFZ4ZTIsUVQ0LSar+s/KyUDJcDZM=; b=KL+czqKkXMMB508fq669G8sT+oinM88F0RwPUXD47WYPeCn3WLKCVKUEffgwBJq773 Bg1l2Idlw4ewZ01aKj8lj1coFPtuAL3watPBEPI0V1YOSoDdePcdZB8Th3Fd3c0qQWUv 9PHttCq3XE4t+Wgv1+Od9KHuSsuezWVZO4EV+qtM7rzYx61k6AeU+ooiynssjwKJsgSE /dlmUOsLQF+2QCdYMAHoMSSlAEoiaEMG5c7qpJ6d4se4O0aALSlTRnnsKxhoSXQc2K// ilgZIL3sdIklo9RYYGOMyomibbU7A4nJ4qtH3wT1x9FoXpGyuxCFuDjugd7OXe3YmVEl u4ZA== 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=XKNS61az1WGOd8AWFZ4ZTIsUVQ0LSar+s/KyUDJcDZM=; b=hgonRmJEyKf1lQKrJcwZ754emVrH+kKTQpTTYixk7SNQ6/UVuq8FeiZpFYAQo7BsZO 3CNRGObOG0rO65Mg6PBuf7vfvQ0+oYgOxgm1vKMXvy/ZLr3tRNkatYhVTsCeOy069BOC MDHSksP/XhgAY5yQF0iXF7WT2xIsBafwpV+ZqCxuybJkty1D+TaMz/7PdLtOKYwqVo7D mrhlcHdTr9s6X0cTT4xmzQJmjpLqrwg1/G8lalOAI5DqpyxeDL8RSAPTzOMHegDMlqMx /PYf2aYlQZakGhq9/DfgpFpHkOGtTMdogVzx4TZI08uCGsW+SkUjgbQyF5VAtxQ+CYpA B7yA== X-Gm-Message-State: AHQUAuajtPvIAXFtrbG8HwtjuJGEQiWleAHXB8Tee9VBv0KuhO9ShSgl /Se4dO6BSYAiIGs24P+zI6b9ew== X-Received: by 2002:aed:2044:: with SMTP id 62mr224159qta.11.1550093551451; Wed, 13 Feb 2019 13:32:31 -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 8sm382675qtr.7.2019.02.13.13.32.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 13:32:30 -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.19 04/17] ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user() Date: Wed, 13 Feb 2019 16:32:10 -0500 Message-Id: <20190213213223.916-5-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213213223.916-1-dave.long@linaro.org> References: <20190213213223.916-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 f0dd4b6ebb63..40da0872170f 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