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 39E14C19F32 for ; Fri, 28 Feb 2025 00:48:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 734126B0083; Thu, 27 Feb 2025 19:48:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E3A96B0085; Thu, 27 Feb 2025 19:48:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 582E86B0088; Thu, 27 Feb 2025 19:48:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3AD7D6B0083 for ; Thu, 27 Feb 2025 19:48:39 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E598A1CC2EC for ; Fri, 28 Feb 2025 00:48:38 +0000 (UTC) X-FDA: 83167517916.17.ADE256C Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) by imf02.hostedemail.com (Postfix) with ESMTP id 0574A80006 for ; Fri, 28 Feb 2025 00:48:36 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=M16IzAOA; spf=pass (imf02.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.210.48 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740703717; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mambjBaAXGR/a8NgOxwtya3jL9uRTgAKw1NEqKaou4s=; b=NBnRtuslsuVicky8Ru7UAcD08txyXlh1AQxteGuFjYk7d0+BIAUvkdEWAP83s4Bs9s8+q9 fwEhPxR5qzWCgbP/mmZ1py9LI6K0NIS4nmKF3qghVlQY8tE2+TKNysAbbDO1FyWJJ0GCaO mrOtiDsTZ2pHyWCk9qSsA3U9MPAxd4g= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740703717; a=rsa-sha256; cv=none; b=kM8NIvMqRWQxPdx0E53KjxySUY/u/7cca1frpkrwBQGNEnDF9q180aX6CTUvKoSv3WvDV6 ToSl7S2vuNV6rhOjMJ4h5YBIQR5tT9l1A4eAkmNP97ac+IMyLqRwomonBpBO1Ibjw22gdi 8YO1rru4rTX3OaxwVN+fhcCTXo2B6dA= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=M16IzAOA; spf=pass (imf02.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.210.48 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-72726a5db1aso145967a34.2 for ; Thu, 27 Feb 2025 16:48:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1740703716; x=1741308516; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mambjBaAXGR/a8NgOxwtya3jL9uRTgAKw1NEqKaou4s=; b=M16IzAOA5l+hbHHnVI5m3hR6Ij//2vdcB7Lj93bbHdvcbGR0sRykkhe1wlsyaT+Jd2 rqZOZcZ+g6/ar/YojSx8G/tc4BlgotUveiB4YZgGa+KCTseVzZS85eTFeIlOvl5etty8 9I4wd3xc4kNsoUXa4KpiEWJlX+oJl3f38wCXo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740703716; x=1741308516; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mambjBaAXGR/a8NgOxwtya3jL9uRTgAKw1NEqKaou4s=; b=vkSyTpTTfuT9Zvtx2CYILba4o3I1lc7vHaQC79jwODSHEf2UtG++fE3xpp6NuFhViG +HGNtm7z2C2Z8g2x4F0sfOv2gH9pq42w2P1jabtQpoY9cJTNTU9AzrGehsNHw5ZA4tlw HJFvdl6TDoexOJzh6SsKt0UQdaELeuw8X0N5me54Vvl15T0R1SsPVj54trmJBeI53eKp /34O8SEkFTSWfvaWgIYJjYWFdTuvq5Hjr2E5WBreyohysPJCeUE9g0t1xz0+EqwxiT5v 2wbIs9RW+ElGdPfVh3tLs1w2GjE6eiICBDbRDXPznpKjoVaP/ok13lOWeHIhpOC5QgBo WBUw== X-Forwarded-Encrypted: i=1; AJvYcCWtuS3sUyv1bTfQsuynCUMlmy/RdhatDMlDyd19jANnEFZXXjXtGb/6w7uX6BL7uc24kU3+Bmpp9A==@kvack.org X-Gm-Message-State: AOJu0YyBZPPBWcHPNiAXqdM7XC8ydmg5af5/E4AcZNiB3olWUqqAUT4a OanFm19+TCmVZPOCHnDCSpyIAVOKc+0mXW+NTJgobnYPOUycmgFD/zeEiT0AHAbLBRkTDOXrDMz pLYstse08sr1Xe7AP6JXCQDR5P725r1+CiC11 X-Gm-Gg: ASbGncsWSrtaovLLgdSf14vo7kR9txoKkBnIvhlknNDbsHxLay5xSoQLdSuI4mkEbhW otW3A8AMNkFnTnX6qYPRMoAUPl7DvWuEdpDZnwnwB2LTIvMIQpUuy816aQ/U/3z3MiW+i3sKzac wcoX0dxoaCdQ5Agdwb3eC04R2iFjRubRm4SGWVID28 X-Google-Smtp-Source: AGHT+IHtq3r53vjQyLYRE5/olRbAlnuREoRvRu7BboZZh87Sxp3Nzk7HTBjsC2ak72lsggVPV5qzwgHPgUT2nN2+fvA= X-Received: by 2002:a05:6808:1312:b0:3f4:13ee:5073 with SMTP id 5614622812f47-3f558616df4mr285558b6e.7.1740703715878; Thu, 27 Feb 2025 16:48:35 -0800 (PST) MIME-Version: 1.0 References: <20250224225246.3712295-1-jeffxu@google.com> <20250224225246.3712295-5-jeffxu@google.com> <899d39af-08d2-4cd9-9698-9741d37186b8@lucifer.local> In-Reply-To: From: Jeff Xu Date: Thu, 27 Feb 2025 16:48:23 -0800 X-Gm-Features: AQ5f1JpGUcOCdr5zrX3g_BrVkhytRR2N2kSp3XD88QAhkjOS5BLQ1YE3wTDvUZY Message-ID: Subject: Re: [PATCH v7 4/7] mseal, system mappings: enable arm64 To: Lorenzo Stoakes Cc: "Liam R. Howlett" , akpm@linux-foundation.org, keescook@chromium.org, jannh@google.com, torvalds@linux-foundation.org, vbabka@suse.cz, adhemerval.zanella@linaro.org, oleg@redhat.com, avagin@gmail.com, benjamin@sipsolutions.net, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, jorgelo@chromium.org, sroettger@google.com, hch@lst.de, ojeda@kernel.org, thomas.weissschuh@linutronix.de, adobriyan@gmail.com, johannes@sipsolutions.net, pedro.falcato@gmail.com, hca@linux.ibm.com, willy@infradead.org, anna-maria@linutronix.de, mark.rutland@arm.com, linus.walleij@linaro.org, Jason@zx2c4.com, deller@gmx.de, rdunlap@infradead.org, davem@davemloft.net, peterx@redhat.com, f.fainelli@gmail.com, gerg@kernel.org, dave.hansen@linux.intel.com, mingo@kernel.org, ardb@kernel.org, mhocko@suse.com, 42.hyeyoo@gmail.com, peterz@infradead.org, ardb@google.com, enh@google.com, rientjes@google.com, groeck@chromium.org, mpe@ellerman.id.au, aleksandr.mikhalitsyn@canonical.com, mike.rapoport@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-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83lsXs16J77 twBqdAdN zv+nxqArpMRJHpGOl7XzZEZB03BNxi1w9Jgc0FdegBjhGqgjzL7/4CDIQosdUNSRKJyrea7wGDCGCsvgFT6BVJjJ6siZAzIM2fDh0LaTwLYtHNThmMtNWYeCALqUqlMpITUHFp83CWmX4muHXyblelz6HrhMJMBYtyeLWq75g9uGJ91/knuD7KGhcaGzomDx3wIGlkFNVJ7sO/S2EcolfGqrkCJJmK5jNZMdFzVaO3hBpGa2tSrbJaiLwnB7tt2VpQlcCdxO87WlRQi/e01wFzjZo2RdVHux6IVBZGevVBQ0C6CB4jtScDVHMuxMY50KKrZrYcNc79B5teqYtLFDGPpyr6DD4etaO8oEkAHMG77IJd+by0LoIW1DDF/QB5eB0r5tdCWW/O/GwU2Tfn4kWxptvHQ== 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: List-Subscribe: List-Unsubscribe: On Wed, Feb 26, 2025 at 9:43=E2=80=AFAM Lorenzo Stoakes wrote: > > On Wed, Feb 26, 2025 at 09:17:10AM -0800, Jeff Xu wrote: > > On Wed, Feb 26, 2025 at 9:12=E2=80=AFAM Liam R. Howlett wrote: > > > > > > * Lorenzo Stoakes [250226 00:26]: > > > > On Tue, Feb 25, 2025 at 02:26:50PM -0800, Jeff Xu wrote: > > > > > On Mon, Feb 24, 2025 at 10:20=E2=80=AFPM Lorenzo Stoakes > > > > > wrote: > > > > > > > > > > > > On Mon, Feb 24, 2025 at 10:52:43PM +0000, jeffxu@chromium.org w= rote: > > > > > > > From: Jeff Xu > > > > > > > > > > > > > > Provide support for CONFIG_MSEAL_SYSTEM_MAPPINGS on arm64, co= vering > > > > > > > the vdso, vvar, and compat-mode vectors and sigpage mappings. > > > > > > > > > > > > > > Production release testing passes on Android and Chrome OS. > > > > > > > > > > > > This is pretty limited (yes yes I know android is massive etc. = but we must > > > > > > account for all the weird and wonderful arm64 devices out there= in context of > > > > > > upstream :) > > > > > > > > > > > > Have you looking through all arm64-code relating to vdso, vvar,= compat-mode > > > > > > vectors, sigpage mapping and ensured nothing kernel-side relies= upon relocation? > > > > > > Some arches actually seem to want to do this. Pretty sure PPC d= oes... so a bit > > > > > > nervous of that. > > > > > > > > > > > Can you please point out where PPC munmap/mremap the vdso ? > > > > > > > > > > Previously, when you mentioned that, I thought you meant user spa= ce in > > > > > PPC, I didn't realize that you meant that kernel code in PPC. I > > > > > tried, but didn't find anything, hence asking. > > > > > > > > Jeff, please stick to replying to review. 'Have you looking through= all > > > > arm64-code'. > > > > I checked the kernel code and couldn't find any instances of kernel unmap/remap system mapping in any architecture. But I could be wrong, so I've also included developers from different architectures since V1, and hoping to get some insight. > > > > I ended up doing this myself yesterday and found no issues, as with= x86-64. > > > > Thank you for double checking. > > > > I said I'm _pretty sure_ PPC does this. Liam mentioned something ab= out > > > > it. We can discuss it, and I can find specifics if + when you try t= o add > > > > this to PPC. > > > > > > > > > > PPC allows the vma to be munmapped then detects and falls back to the > > > slower method, iirc. > > > > > Is this code in the kernel or userspace? > > > > If PPC doesn't want to create vdso for all its userspace apps, we > > could instead "don't create" vdso during the execve call. > > > > > > > They were against the removal of the fallback; other archs also have > > > this infrastructure. Really, if we fixed the fallback to work for > > > all platforms then it would probably also remove the possibility of a > > > remap over the VDSO being a problem (if it is today, which still isn'= t > > > clear?). > > > > > Any past thread/communication about this that I can read ? > > Jeff, I'm sure you don't intend to, but I find it quite disrespectful tha= t you > ignored my feedback here (and elsewhere, regarding you ignoring 4 sets of > feedback). > I'm just interested in the details :), If we know why PPC needs to unmap/remap vdso, then there are additional data points to consider, when we develop pre-process level control for this feature. But sure, we can postpone this. > This? > > https://elixir.bootlin.com/linux/v6.13.4/source/arch/powerpc/kernel/vdso.= c#L236 > OK, you meant the failed case ? i.e. when install_special_mappings failed ? That is a case that I haven't considered. It looks like error handling, and I was expecting the install_special_mappings to never fail, maybe I'm wrong here for PPC. > Was [0] a relevant discussion? > Sorry, I'm kind of lost. This link doesn't give a reason why PPC needs to be unmap. If it is due to CRIU or other user space apps, that is not an architecture dependency, maybe a distribution dependency. Anyway, we can postpone this discussion for PPC, I don't mean to make you spend more time responding to me. Please feel free to ignore this one. Thanks. -Jeff > [0]: https://lore.kernel.org/all/lhe2mky6ahlk2jzvvfjyongqiseelyx2uy7sbyus= o6jcy3b2dq@7ju6cea62jgk/ > > > > > Thanks > > -Jeff > > > > > > > Thanks, > > > Liam