From patchwork Thu Jan 10 17:51:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 155248 Delivered-To: patches@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2176054jaa; Thu, 10 Jan 2019 09:51:58 -0800 (PST) X-Received: by 2002:ac8:2e6a:: with SMTP id s39mr10757693qta.355.1547142718447; Thu, 10 Jan 2019 09:51:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547142718; cv=none; d=google.com; s=arc-20160816; b=ew8cEXK0oapXKjAeO2EFg4bSjnHaDuJcdsEOmlLxK8xmNZrzs6R9kjchfGTjl9kOw+ X+nhBxOMGr2kWtEXBkab6QWkZaKuorzfePOQp2F7oq38E8ip3BEaO3Hy8rraBsPzlZQv rzEvqs87cQLtFlRtJHDLm3osJfsNqYD5cXLUhrRcNYWo3wl1n8HgVjUwPkDcfojskXuz 3Rqcv/cApQQOoWsV327PkNQ6nIR9ZeCxmaymO/PnqbAtKgHAciEAVR9TDjJYtM1ijJiP apEreY75g/chR1XrZJIGYtLuHEtdx/qm6q7Zyf/os+iA5q1KwvOKOn1Xs3xPwfIlYFad LGvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ao2zNPPAVKm6DVngcSIODmeIuZt8Da7c4FKcqwlcUWs=; b=AZDw2pmI7JioxZU/pGMpAYGhshBu+j/6NPsRoa+q5+uKE0FI0es7xPRld9Epy/lJsU 5+xAGVhU9Kv673brebgis5+vMUqgUcGNrLaUicg9Tpn+UFqC7stYDx1tbf/GZS2i2wK1 Br3Y4trSvkuaqTR7jiMCoEZSkKbE4fxi2JyJIB3BLSiva+DhDz1E7qVIJ/fnlvijkRDC dmw5jiCyS/Rsl/wBkL9hqOSDhdZUwUP/eViRc8G3dqvXzzk2P8Yhg+iIge1pNSQgoxds O9wwqwynFHzPgR7vyURAf1RLN2kQzxyyvfTHw9hD3kz96nxVkd3NfXfIg+URYcvosnZr 3i5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ie1a5r/O"; spf=pass (google.com: domain of dave.long@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=dave.long@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id q17sor72426665qtc.32.2019.01.10.09.51.58 for (Google Transport Security); Thu, 10 Jan 2019 09:51:58 -0800 (PST) Received-SPF: pass (google.com: domain of dave.long@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ie1a5r/O"; spf=pass (google.com: domain of dave.long@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=dave.long@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=Ie1a5r/O0ICRueF8TfCawjsPDMX2IlNYdg8hq5n3FB38u1hmc3s/00N6umkySrF1jF GuFoTESfgJumiymAkU5WqXQRJ5ZlfXIMcYkb2W+KNr+kixWaMsLMcjcZjDinjAnVfTYF CI4EBt5nfCTpzwE67luXQuJmOESssk839uop0= 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=VT+cM56hifhivkJLUHSf0csPlBMxqPYaYQHQ15LPcZN6bGJs8ZTo992mY2G5cBNdJt qYqAoUvD3Il1XkkXfZF5kxAbUz2t6jZf4KFDfE4IdpMDsIsUKq0e79DbfAOJvLplD0hg kT3tBKQrzpfUZnJpfBMS1ixWjO1gxW/JQYNOzaimZ6gFwxM3faQkyeoKUms+z94qMSit 0KPVbnTG0TTsKIVPI13oecb/VGg4XIOt0uhC5pMxMbQWT19tJC6qzEFi0yOouhpUAGx/ JSR+9KsFLt8xdLdLQBB8BeaC7SP0ZSFXGH5GORp6AqmHEfeD2K0+oATEqNuYiW3llg6m pItQ== X-Gm-Message-State: AJcUukfMvsmzGJl/fyKzWiOo3J+Ph7Z14+Xj3Uqo2+1S2bAzHjOuH68a Ff6mDEnhgcewvGT4qp0ADV73f6gc X-Google-Smtp-Source: ALg8bN4Vk8foP957aG89chLyi3lmG4EYGCpBn5F4aH2fNirX+txN+w0PXN/zchdWyEdwDRBbbG/ecg== X-Received: by 2002:aed:2151:: with SMTP id 75mr10935832qtc.24.1547142718219; Thu, 10 Jan 2019 09:51:58 -0800 (PST) Return-Path: Received: from localhost.localdomain (pool-72-71-243-63.cncdnh.fast00.myfairpoint.net. [72.71.243.63]) by smtp.googlemail.com with ESMTPSA id b8sm41815904qka.79.2019.01.10.09.51.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jan 2019 09:51:57 -0800 (PST) From: David Long To: stable@vger.kernel.org, Russell King - ARM Linux , Florian Fainelli , Julien Thierry , Tony Lindgren , Marc Zyngier , Mark Rutland Cc: Greg KH , Mark Brown Subject: [PATCH 4.14 04/17] ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user() Date: Thu, 10 Jan 2019 12:51:37 -0500 Message-Id: <20190110175150.5239-5-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190110175150.5239-1-dave.long@linaro.org> References: <20190110175150.5239-1-dave.long@linaro.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(-) -- 2.17.1 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);