Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2473134imj; Mon, 18 Feb 2019 06:37:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IbivjYW91cPHJow45zpyNnCdZtehzsS6FdddFunfPA82AXhXaY2NqE5MwZq9J1hEGvinrTD X-Received: by 2002:a65:628e:: with SMTP id f14mr19203859pgv.193.1550500673408; Mon, 18 Feb 2019 06:37:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550500673; cv=none; d=google.com; s=arc-20160816; b=ryQAeGR9cMBr6p0J6G4AfaGy0Nbrwm9ro4S4+L6sK7QlyDAzpXcwm+q/s9NYD0eHSQ vMKesmWdXmN2Vx+CvLIRdT/xba+JBOsQ3nkAfjmsuCH4qiAPbCuwFhtnh5pXTdJ/x1GU jDyQ4z9DXOJR1gDFTSEAl5wMIgRXvgRJLnFUfyGbld8PN0SHG1MFqvSmQyZDePE+/yaO v3r/uUAJ/y/Y9U9cXgGg7Ej8p9iEXN+iGJccd+rbsFB3B0rDD+WE0hH5GqCeUR+diLea kNKU2GfhJmhet0TCbUyTey9rWW7jVuF84ReVICfVYxa25AodrHj0gAfYarOX0SGkaIcJ zi+w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HXQrcixtsWKsgPff5Xi8hfpFDvpaOl46DUO3qA1oV0Y=; b=Iuu1CcCiAZWebX3zgCNqdxtcymaypJF3YeU0KJkSZmHI/WlKyV/PBEBulVGG1neB/5 KpmuOEkuqM7uIC3VHKO4nDzWqWm7Y9ulhYcCGCqP2fgtoTJhBgVanOrzBEbWf2iPXYSM pZVSRZnCEOFqN8tzeiY/2ti+QUJQS63AF9dJ2Y1GoLMOiuyAao49wkcvL8sQ+j+zG3fy iZwFDblO52xvnwZt9i54W0TyCVeZWeb7eRVpatVHDURzhgz0gXJCRBVnD8QbNMDJkr75 0giG72AWpqUZeiBaFbpjZN9kJZf1euywcp9eSY7XGNdx/2s0ECsPwr51z3jpc/RGGYAn HJFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v1FbP3h9; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h7si12556691pgp.49.2019.02.18.06.37.37; Mon, 18 Feb 2019 06:37:53 -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=@kernel.org header.s=default header.b=v1FbP3h9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387482AbfBRNzQ (ORCPT + 99 others); Mon, 18 Feb 2019 08:55:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:35234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387446AbfBRNzL (ORCPT ); Mon, 18 Feb 2019 08:55:11 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A169921900; Mon, 18 Feb 2019 13:55:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498111; bh=XCLc5PT5rJZ0dDJFQcZbtDj4XBxWiXFBZJ/o+8VGdWw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v1FbP3h9Ro01ZbdFdAWrib55eRDVJd7U1N0QVPsghrFzEQ412uJcHHCORWJlm+f9m idQMf5ZAS3TALWXuOF8L9JayAfNkDf4IyE9FirC/ijZnRxI9WNGjVR+qOonzD/RTNT w+qC4lcfVRg7FLmYC7bW4fBTbrvo7SjD+VHhSS+I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julien Thierry , Russell King , "David A. Long" , Sasha Levin Subject: [PATCH 4.14 08/62] ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user() Date: Mon, 18 Feb 2019 14:43:14 +0100 Message-Id: <20190218133506.527235628@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133505.801423074@linuxfoundation.org> References: <20190218133505.801423074@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Reviewed-by: Julien Thierry Signed-off-by: Sasha Levin --- 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.19.1