Message ID | c16db382982a7c2888e1241a455341118cd63b89.1538485901.git.andreyknvl@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <linux-kselftest-owner@kernel.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 ED6FA13BB for <patchwork-linux-kselftest@patchwork.kernel.org>; Tue, 2 Oct 2018 13:12:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0A68288E4 for <patchwork-linux-kselftest@patchwork.kernel.org>; Tue, 2 Oct 2018 13:12:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEB0928931; Tue, 2 Oct 2018 13:12:57 +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=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91ACB28961 for <patchwork-linux-kselftest@patchwork.kernel.org>; Tue, 2 Oct 2018 13:12:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728113AbeJBT4N (ORCPT <rfc822;patchwork-linux-kselftest@patchwork.kernel.org>); Tue, 2 Oct 2018 15:56:13 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45279 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727942AbeJBT4N (ORCPT <rfc822;linux-kselftest@vger.kernel.org>); Tue, 2 Oct 2018 15:56:13 -0400 Received: by mail-wr1-f68.google.com with SMTP id q5-v6so2145410wrw.12 for <linux-kselftest@vger.kernel.org>; Tue, 02 Oct 2018 06:12:55 -0700 (PDT) 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=xOEYtA/I6Fm+wYElUl5x45bwyq3Cixn9jAS0SVOnGHY=; b=hapSsxwdWXwCXhX3cx/PcxUUNiBlkLbDk5Ol0GIiM68H9rsaDKFOhEppykmnJbSMIG hP4HvsnoWoqCLF1XH0klHSE3kJRDP7PzPV+P6sfrd5jZTa5O9wY0NHxHbg+ssowNWDAK jMZK0Qtbun2y4bsuxkmMQDRH3ZXywQU73104mMawS21UPnCx0hs79aj2FTAWAvr0G5Zk bxZmeY1y8kNyiwgFzrMFxb0Kd5/hqdAgiK5/yWb9dAnFsWl2bEa6+ntzVC/LqyX7KdsE qebdV3d2DvQAFlQK5j16Cw1+qqvmSmApY2GvOiRAmqs6XOLDd7R47nErQEM1ADlvsb3k CIGg== 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:mime-version:content-transfer-encoding; bh=xOEYtA/I6Fm+wYElUl5x45bwyq3Cixn9jAS0SVOnGHY=; b=gS+rYVsJsvsF1VPr4QZKoh9NuFM2wEulLDWnVfkKZXurDvV5lRiPKIV0Wa2+tN4Hvf W0yObNUOnNV87JamuItyapAGbUNvaxQ8CwlkVj9cjGqTfQYWeGEpcRk58WeVulISokLB Bmk2n2PX3u9+k8Y++v793mdNca/Clu4EYX0Him6cdCDDM/4SNIaL7xCx4gA4MEN53WKu n9c7o7OoEEBUtBUp+oF686EvBd1HF0Pe2n2uryKtmEk0qOlFN9zOF2xv4lLARXWT970c XqD2vlJ617n5vzNsyukvMPD3skP3jbBD2wKndk9m1kbZzScW3WRPsUqCtHBt7EI3BwA/ WLKw== X-Gm-Message-State: ABuFfogs9fwpec3S6ZcT6ccmfaUtvVBvSVyEksxPSa2n6Ov2GzFi4abM CBBl7Opn3Zv+Fg4LBTjgRVtZrA== X-Google-Smtp-Source: ACcGV61mrD9eqhs6Y3Sph53EBteAZzSIYlvW15ySh9La2vNV0aqpQtde7IbKlj9BD/8p9DYuC53IiA== X-Received: by 2002:a5d:6707:: with SMTP id o7-v6mr10890380wru.326.1538485974696; Tue, 02 Oct 2018 06:12:54 -0700 (PDT) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:84be:a42a:826d:c530]) by smtp.gmail.com with ESMTPSA id v10-v6sm17458681wrp.0.2018.10.02.06.12.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 06:12:53 -0700 (PDT) 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 v7 6/8] fs, arm64: untag user address in copy_mount_options Date: Tue, 2 Oct 2018 15:12:41 +0200 Message-Id: <c16db382982a7c2888e1241a455341118cd63b89.1538485901.git.andreyknvl@google.com> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <cover.1538485901.git.andreyknvl@google.com> References: <cover.1538485901.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kselftest.vger.kernel.org> X-Mailing-List: linux-kselftest@vger.kernel.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 99186556f8d3..51f763fb9430 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -2672,7 +2672,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(-)