From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BE74C43334 for ; Thu, 21 Jul 2022 13:14:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF9878E0009; Thu, 21 Jul 2022 09:14:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA8EB8E0001; Thu, 21 Jul 2022 09:14:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 923438E0009; Thu, 21 Jul 2022 09:14:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 828368E0001 for ; Thu, 21 Jul 2022 09:14:57 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 676111C63D2 for ; Thu, 21 Jul 2022 13:14:57 +0000 (UTC) X-FDA: 79711152234.14.166714E Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) by imf29.hostedemail.com (Postfix) with ESMTP id 00A47120079 for ; Thu, 21 Jul 2022 13:14:56 +0000 (UTC) Received: by mail-yb1-f170.google.com with SMTP id l11so2654612ybu.13 for ; Thu, 21 Jul 2022 06:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZEP3AAB/dwBYU2chyIVQ2fqRm+7pu5MqzIYkuw/VKYk=; b=G0fLK52jlbcAmWAGHuuh5jj+pTg6u8Uo1hN++1lVcI3UWFo6Dm6PbkHHita0fFwLb8 OPtiJB3XOB2gGR4PFf29UfsRJVghK0yI7V2+rDF1f4Ivv8BS2bM24IWxtx6SiMqFe2uw 9qM24/L8h6RYisgNaEbxpFgpyK+NHq0WWAqyVbd+F3EwlSySPP1yqePQFj4Benz8Au0M 1rPyhn8pIWlMrrJP0WUd1z+RBD9e0kOvkaLSMY4W1Y037Trq7DWRjCi+nziQIt94NWRp 3aVM/9zSKu/l6Ryo9NhPq3VgvmDWkMVDFYxpSi98rtweSCmvefokfDyf+PMiYrd0Yz9Q fRgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZEP3AAB/dwBYU2chyIVQ2fqRm+7pu5MqzIYkuw/VKYk=; b=6scQVyHkXqlC0tBnQt1GWsW/QWhGoPrzwEMoqHNbWH7hEALVDEot123jf9mVMvWHnF Fk8tnjxp3+W6oHE05zko5jJVg6ePa9dObkyheVrpPevVG5zF2IsjlacgHmYNAc2V9oVG DDm7v3xGiC6oDhtZOPNSlCez5BUFRmKuDtfSSm1X38+/5cwPgYws436KeeR1Su8y1OG5 XuRsHeICujsccp8cQ4v89PYcGsKiUF6li0yUD2fniP9fqp9lJpDir4tvbpXqCZuJ/KQL G/isTVxll9SLwJIspFMYGlN6RTBtC1wx4yYgvDbzwi3sNmO7UDUC7LqyXi+iBZGiODWu T7wA== X-Gm-Message-State: AJIora9yb5kKCMOSmmLfX4RPcg9SjyksknOr3XjHs7E5bl7nFw1yPZ62 jH+Q7zMOZsId5SLtLufTa98gXbSqu5l6TwRHwrYFJg== X-Google-Smtp-Source: AGRyM1v0dgWuOsO1tWFKLjX2aUzU29XXliJgzcYmHg43dT+ftWY6TABtvrLenTrDqy2ltXCqMzahYNJLJ6XuKJV4f+Q= X-Received: by 2002:a5b:8e:0:b0:670:6ba6:5d1e with SMTP id b14-20020a5b008e000000b006706ba65d1emr15093687ybp.138.1658409296104; Thu, 21 Jul 2022 06:14:56 -0700 (PDT) MIME-Version: 1.0 References: <20220712231328.5294-1-kirill.shutemov@linux.intel.com> <20220712231328.5294-6-kirill.shutemov@linux.intel.com> In-Reply-To: <20220712231328.5294-6-kirill.shutemov@linux.intel.com> From: Alexander Potapenko Date: Thu, 21 Jul 2022 15:14:19 +0200 Message-ID: Subject: Re: [PATCHv5 05/13] x86/uaccess: Provide untagged_addr() and remove tags before address check To: "Kirill A. Shutemov" Cc: Dave Hansen , Andy Lutomirski , Peter Zijlstra , "the arch/x86 maintainers" , Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , Taras Madan , Dmitry Vyukov , "H . J . Lu" , Andi Kleen , Rick Edgecombe , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=G0fLK52j; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf29.hostedemail.com: domain of glider@google.com designates 209.85.219.170 as permitted sender) smtp.mailfrom=glider@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658409297; a=rsa-sha256; cv=none; b=D82DMSRlQabFAFHVTXoGS6Cp171jDqk13hkFVk4iPdMUViW1bd/DoSvfuUERORqKObIhkv EHEigl3K/gCh3wpICu2qN1wv91Y5XQIpHz5swU8HSDaypnby65WIT1x4h8lvs84wW/EtTe POEnzEdX5vdDIgVZLQ1ENJjfJ5bQ1rQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658409297; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZEP3AAB/dwBYU2chyIVQ2fqRm+7pu5MqzIYkuw/VKYk=; b=JyS1HgiCXbdWsXrzLqVfFhTvmqQ30IlIi7LfVL0P6fVPiAy6sZhMN1KOmK0dc8sZENBKfk Aa7WxJ2xKOgyIuOZpV5C2FJFX61/GCCrXi1J99Qc58S82Ems/lUpV4oH2aR2fBfeQXBs8c Yg13mx1kz5tRHQHNMG6zAW1VSmpaoYA= X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 00A47120079 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=G0fLK52j; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf29.hostedemail.com: domain of glider@google.com designates 209.85.219.170 as permitted sender) smtp.mailfrom=glider@google.com X-Stat-Signature: t3nr76qeizhg76ko8j9usmyaon747qqb X-HE-Tag: 1658409296-475010 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: On Wed, Jul 13, 2022 at 1:13 AM Kirill A. Shutemov wrote: > > untagged_addr() is a helper used by the core-mm to strip tag bits and > get the address to the canonical shape. In only handles userspace > addresses. The untagging mask is stored in mmu_context and will be set > on enabling LAM for the process. > > The tags must not be included into check whether it's okay to access the > userspace address. > > Strip tags in access_ok(). > > get_user() and put_user() don't use access_ok(), but check access > against TASK_SIZE directly in assembly. Strip tags, before calling into > the assembly helper. > > Signed-off-by: Kirill A. Shutemov Tested-by: Alexander Potapenko