Message ID | 07a4efa5983abec2355b2754812509a73f648332.1544445454.git.andreyknvl@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67DCF1751 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 10 Dec 2018 12:51:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5952B2A1E5 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 10 Dec 2018 12:51:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56BFA2A2AF; Mon, 10 Dec 2018 12:51:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9E832A26A for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 10 Dec 2018 12:51:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9419A8E000F; Mon, 10 Dec 2018 07:51:20 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8CFD28E0001; Mon, 10 Dec 2018 07:51:20 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 658A78E000F; Mon, 10 Dec 2018 07:51:20 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by kanga.kvack.org (Postfix) with ESMTP id 0D3C88E0001 for <linux-mm@kvack.org>; Mon, 10 Dec 2018 07:51:20 -0500 (EST) Received: by mail-wm1-f69.google.com with SMTP id 18so2853089wmw.6 for <linux-mm@kvack.org>; Mon, 10 Dec 2018 04:51:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=pdp/ryV9bt4+HrjeOWrdnZnBI6aj8YPFqzbeaIQ9j68=; b=lT3tg2xHA7oL/fXKlmLNyIgatyX5AUS8026wqxtjvdSpB8x0ZgCoIwoGjUvunDrorV cSmAI5Bd8CZh2A8BFxgi81f+qta6t/0a/1PVxbXkG83lMnxrRRi/x4OF2Qi1P6F2r5Ff 4ehx0yokjdYGmrcAQ4galuehamJ4huy0ntOA+I0H+d51oS455Xy4yFPnXDnZs0A7kvGQ oDNcep8IBZYUc1pkdntv1ijzpMdjohXWUpbdtvOUB9fKSJg9VAF70H0vvIisfK8fOnfj wl8Oo4inmZ7p6LM34aW2gGVaEbPNB2gKEFPsi1mgphWAp0LX8Ka9gtKWnq9LKVnddujT U8Pw== X-Gm-Message-State: AA+aEWYg/ItRL0HbcFiCN6LEC4VACsY+mg9gUUBpUWAS8rBG6Rmtf5wL QWi3yoM9K/WHuu2NenyMRt2WS8HUzR9+graT1nO1uTVeOgQyB2ASSxxlRPdcXP7MdWn3u22Baf5 Ag+xCAZr/oOk3eBh3JDcNA8IlTYzv1Cv/c4rJ4WJ4fd/VBoJOZkWe7bGuVVn0GmxQstAIgQI9n/ zMJu+wVOJ9sz2xaGAOs9FZFFx3k8G7/XGpB0SO/UxzeIlgITtsBDKKfluzsGSf15q/7P8XIsd8R k1y93lk+eaSTZKM7VyS+/E2UJb4W5/sNSuajcsepeDaHuXSPMY3i38qE0yJ5FOaQpSIvav2zMYR 8KZcdTZ6t5USBWDJ/+H2xNjTpr1CT93LhcFyVf+bRjvbgMoNwNMV7YiuJ9iseJOd2BU8PszBxKU Z X-Received: by 2002:adf:c108:: with SMTP id r8mr10217213wre.233.1544446279597; Mon, 10 Dec 2018 04:51:19 -0800 (PST) X-Received: by 2002:adf:c108:: with SMTP id r8mr10217176wre.233.1544446278831; Mon, 10 Dec 2018 04:51:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544446278; cv=none; d=google.com; s=arc-20160816; b=tNLpfomCIqkXXak2V9HLnIf7CZYNrWRbRxh10N8AoGqqJkuWLLp7f0/D49SWl9JvVg TL7CHFrkaD5+jC9lr2ncFDUQGCcKxW/XlXnoTxv/PlkCEtdYu+lSLHpQ2SKO4HI832P2 hpjquufBiYD7yu9wcOJYEteVH/aEvaJ1gkWpW+pOvmOywu29MAoYmKta/bLnFzqCMNlj gHXjmq3Ayjn1kVoqh5gy2w7m8NpAlnKRg3BotJyRI4b2NrgRmhD0YO6R0L2V/Gdb/8Fx Jg6Bb0MO83yVEtQPVtLHr3IGtoL42uWUmxRzbnmqdFWmQyyXDWzrtkEoAVGNnhjG6Krd 0+SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=pdp/ryV9bt4+HrjeOWrdnZnBI6aj8YPFqzbeaIQ9j68=; b=Po5/shKaMI8xByuonuYHG9K/8oWPdN8t7JEpIaNtunvNBdB+ZiJ6/FgSgGMfpf+q3B LE0AucQr8os6Y5gYyRPa8pIy32JQbLVx/MDuDygxnfb9bZCjhRVZtxR89LiH3+clDlnP lnJay6QqWsRtFiAT8lc/UibN4MLjW5o4FgTt6H2KvHKHGVLOstPsg4UeNHTcSfZ1Mq3N Nz6KmoxlqH0PsRpTm4zeWd/uPXqa8Cp2IFEaJ5V8xeEw6d7rDIB+uyy7t62QKRDlAvrL q9Rt8LQoKG2o2kGgw+h9s/F/qTWQBZyMDk6I68koJCtwfmtqrHFMa32NIuilzTjkoQaC LYSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VEgcxLaX; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id j10sor6962203wrx.15.2018.12.10.04.51.18 for <linux-mm@kvack.org> (Google Transport Security); Mon, 10 Dec 2018 04:51:18 -0800 (PST) Received-SPF: pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VEgcxLaX; spf=pass (google.com: domain of andreyknvl@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andreyknvl@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pdp/ryV9bt4+HrjeOWrdnZnBI6aj8YPFqzbeaIQ9j68=; b=VEgcxLaXoi0dOKDXk3mvZgG3orCXpa3lyeE6CP4OJMDCNte/zoFeg72gBtyYRUM/+z dkdH0FX3oaVuoZ2TdAnAWlMAq2acZqiJrldMEieGTNK+3b5PjuVvTUt13jkyridlEMir ldYCNgQs6aUD15xGtoBy02lnJF80uPmFB1DrhlhknCsVZxjWvFv1RdkV5JJ5GSpCW5Fm 4CiX7I8udlN21IjNRASuq0xeFFDULrKpoEaM9D2i67zp9cQXXr2TQKyBW/cdB/XiSE0/ JddgPffO2wfeBRJJGAVFDqBC6nXfN7M9u/3FUN6B+81x1rMeN5f1CRtoSZFGlT6PrwZW bQNw== X-Google-Smtp-Source: AFSGD/WkZ2Ib7xqoZNcfNco/+WzWdTWYInohVyU59jy0CeiifxD2IPgCZSpbiMewGDrt/7AYo1yayA== X-Received: by 2002:a5d:61c4:: with SMTP id q4mr9258512wrv.308.1544446278383; Mon, 10 Dec 2018 04:51:18 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:3180:41f8:3010:ff61]) by smtp.gmail.com with ESMTPSA id l197sm36893363wma.44.2018.12.10.04.51.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 04:51:17 -0800 (PST) From: Andrey Konovalov <andreyknvl@google.com> To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will.deacon@arm.com>, Mark Rutland <mark.rutland@arm.com>, Robin Murphy <robin.murphy@arm.com>, Kees Cook <keescook@chromium.org>, Kate Stewart <kstewart@linuxfoundation.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Andrew Morton <akpm@linux-foundation.org>, Ingo Molnar <mingo@kernel.org>, "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>, Shuah Khan <shuah@kernel.org>, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Vyukov <dvyukov@google.com>, Kostya Serebryany <kcc@google.com>, Evgeniy Stepanov <eugenis@google.com>, Lee Smith <Lee.Smith@arm.com>, Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>, Jacob Bramley <Jacob.Bramley@arm.com>, Ruben Ayrapetyan <Ruben.Ayrapetyan@arm.com>, Chintan Pandya <cpandya@codeaurora.org>, Luc Van Oostenryck <luc.vanoostenryck@gmail.com>, Andrey Konovalov <andreyknvl@google.com> Subject: [PATCH v9 6/8] fs, arm64: untag user address in copy_mount_options Date: Mon, 10 Dec 2018 13:51:03 +0100 Message-Id: <07a4efa5983abec2355b2754812509a73f648332.1544445454.git.andreyknvl@google.com> X-Mailer: git-send-email 2.20.0.rc2.403.gdbc3b29805-goog In-Reply-To: <cover.1544445454.git.andreyknvl@google.com> References: <cover.1544445454.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
arm64: untag user pointers passed to the kernel
|
expand
|
diff --git a/fs/namespace.c b/fs/namespace.c index a7f91265ea67..694dcedb7e7d 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -2686,7 +2686,7 @@ void *copy_mount_options(const void __user * data) * the remainder of the page. */ /* copy_from_user cannot cross TASK_SIZE ! */ - size = TASK_SIZE - (unsigned long)data; + size = TASK_SIZE - (unsigned long)untagged_addr(data); if (size > PAGE_SIZE) size = PAGE_SIZE;
In copy_mount_options a user address is being subtracted from TASK_SIZE. If the address is lower than TASK_SIZE, the size is calculated to not allow the exact_copy_from_user() call to cross TASK_SIZE boundary. However if the address is tagged, then the size will be calculated incorrectly. Untag the address before subtracting. Signed-off-by: Andrey Konovalov <andreyknvl@google.com> --- fs/namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)