From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794965346; b=M5Xf+JzJrJX2JLSFBId/t6in0UiR1dl/Y6nBwTojzHGpjeXlf8dQkQ0Z20eLt2fY05DL YA9ejmd1p864HzghtWx/+FO+33XDa4A7XwxCGAN7PWsHMPT/aBjrGBkCMsQV4+zjXtbJq XqCizhyfBncYjnXlyzZ/gf6M3Fw9rnXMiIlrh6BRotmIUk1wCSbEWlRe3k3/S+EL+eKRc gpTbnaUXrnZjPiA/zK6VMvRR1bBI/YzarM0uBHjyTQEi7VBwAL73PsWqtbOyL5wksgvFs CGPAOHurBm34zbqBHklTHLtKxdYetjycTL9WhEiU6g/PZEUJm8qaPWbdMdMD8Dz0edg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794965346; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=9QrBc0w3KV6ChVNAVMzB1hWL9AMrXve7Stq4IEHc3B0=; b=hpKB8V+iZbGInXcpAwcBJWfovldT7tOgKcu5lzSif8EtslsrDgjBXLS3qFwQop9CPIuj oD5pgtsatl1a9AoromXU/pW+hnyRzObBAS3Flmtj/Gug3Z9XcFNIGvBt9gP/+sGjS3gL9 8zDhIT76sQDy9ZFIO4FCVCgk4hOMYDb8MigNvGQy/z5XQAs+bnI0Ibd4GTt8YvF//gmO+ yBAIW1s0QnuSl2vuQecqG8GzlLFTzrfO43gOm2F5nmXDbQbga5DL1utFv34O5y4PdWkHy A6iZJlOWildqqrAUEFfWoZgKBphIKXL05xRmRreSfDXLW/ZcOabYdYwh/4yp6veQ6Ng== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=H1AWSx2s; arc=none smtp.remote-ip=209.85.216.48 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCDC7606A31C for ; Wed, 18 Nov 2026 01:29:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DCDC7606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=H1AWSx2s Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-3b147e50af1so27952a91.2 for ; Tue, 17 Nov 2026 17:29:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1794965345; x=1795570145; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=9QrBc0w3KV6ChVNAVMzB1hWL9AMrXve7Stq4IEHc3B0=; b=H1AWSx2s6yA5CZ4Kphq2OZbv2w2xBgnzcUeDJNakKtwKJr6At3ZCbGY3hZkAUsj/yp b5eUHT+IBOFEmxJxWhffm3Hlml2THIgqdS86xaG1IYJpNQXva7wATT2dVNqb6auf9kHq Hf8xzqkAwAP9npo0A8KFtaAQ+dIAC/LDfvn9w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794965345; x=1795570145; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=9QrBc0w3KV6ChVNAVMzB1hWL9AMrXve7Stq4IEHc3B0=; b=GH4RsO1dTAT/vX/HlsufTIAos06NEbPruyhmHPABgwsCQQ6gk7C7rQkROovGeBpyJy s6GClnF5P5ymcUdsykFVCBHWdzL17kYFqHSJaVaI8MXfP30Ojtl6DeCdM195TBmh37+8 A/r+Qops7k4d7J7Kg7hkHxPSRORIQyY6+UGuILNduEkMJBpsaw+o0q/mdjlJeAzh73yw 9HKkY5MZ9pGd4gEu0bgfzbGeMwlvbLqM2sr0Wv4CSbEdNW6r9E5E+jb6c1AAxeasxkF+ ivYaNBtxXKOOKU5mDWtOL5uBd3y+FeZxs+BUZ9XLqyibDGscbhdJS8iceygP26rnuh20 xiBg== X-Forwarded-Encrypted: i=1; AL+hErEmxu1xd0wcJhUCObm4e8XydyVFGmI4eFXrf4eqfaaQPS1IqsyaoeJwD2kW0d1OFeDZy6/3UpI=@vger.kernel.org X-Gm-Message-State: APuU4Z/qjfKD4SETtvX0AJRB7jtwWBHOjLw7778EiuFFXNwc04SPHkog lv2al13fAYi0VeL8N0I0gkVkX4Sx5LBF3N7gnqTU6ZV18xuz9Tos10K5hQtJipGKFQ== X-Gm-Gg: AZFdTZfysb1LXq4XEXZjcR/wNPRik/eXDka86eHI2s7QUlAw27ZKG9cfNAJqJddEQpA OnMAO8DqOHHmIhgvjdjzWYAZ9kL7NCGHRlwQ7skuvd28ecMzbAxB7mJ+fJ8E33joyxf6HD6AlOL hhKgkP3uPPplVCY64qt+7yayX32KRmt3oV9VIQCT/ptZxbmDOHaBxoi6QglaGokMmWyLMVEn/zs /rYg3lApu0whMTVhoODPOPspUEtNPJVE+DkepSlA9uo91P/uWtH8/XsWFnkARzAGDxoywaF/UmR +IdDGcdqtvlXOWSmpXnfauQlR7WUlZ2rK4y6adqEhRMQVVGMHRP6+rR05aw3Po5M4oc+Gf+samb OrYjTStZs6XrvJW9FyC2KR3NyboVNp5OS+AFWi5HJEOABGykXz2UTTTnWsh8ly3NgNdSkx/2qKF qMM34g5yAiY/ZjZYeGpoTogXxhZTXMVGF1PKstllACwd5xn5NNxf6FG6Z3F7mb//V6m0Yn8anHT CmDQvfuKBncm6lSPAvIB3DZXYfzYsEJUnbewieWSgTEuliyLanCB8sgVIQuw/pfPdcWb0lSqVuL jY9e1l9f1PsI3PWXmGQ0bFnxAWiJcWjygo5uhCcv6LAgx0Gug95QcZG5H2JYKug38TYad9Q= X-Received: by 2002:a17:90b:5390:b0:3ac:a11a:7c88 with SMTP id 98e67ed59e1d1-3b3d07af9f8mr1892178a91.3.1794965345247; Tue, 17 Nov 2026 17:29:05 -0800 (PST) Received: from localhost (221.247.125.34.bc.googleusercontent.com. [34.125.247.221]) by smtp.gmail.com with UTF8SMTPSA id 41be03b00d2f7-cde3b98c75bsm243073a12.10.2026.11.17.17.29.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Nov 2026 17:29:04 -0800 (PST) From: Jeff Xu To: David Hildenbrand , Tomasz Figa Cc: Jeff Xu , Andrew Morton , Vlastimil Babka , Johannes Weiner , Andrey Ryabinin , Lorenzo Stoakes , "Liam R . Howlett" , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Zi Yan , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Marco Elver , Boris Brezillon , Catalin Marinas , Chia-I Wu , Dev Jain , Evgenii Stepanov , Ian Rickards , Jann Horn , Jeff Vander Stoep , Jeff Xu , Kees Cook , Mark Rutland , Peter Collingbourne , =?UTF-8?q?Pierre-Cl=C3=A9ment=20Tosi?= , Ryan Roberts , Will Deacon , Alexander Viro , Christian Brauner , Jan Kara , Miklos Szeredi , Baoquan He , Pasha Tatashin , Pratyush Yadav , Allison Henderson , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , linux-mm@kvack.org, kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, fuse-devel@lists.linux.dev, kexec@lists.infradead.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 0/7] mm: kasan: skip KASAN for GFP_HIGHUSER Date: Tue, 17 Nov 2026 17:28:58 -0800 Message-ID: <20261118012858.289236-1-jeffxu@chromium.org> X-Mailer: git-send-email 2.56.1.703.gf848ed807c-goog In-Reply-To: References: <20261116230627.3537051-1-jeffxu@chromium.org> <2066d131-f999-4747-beb8-520d5e0ce1db@kernel.org> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Tue, Nov 17, 2026 at 11:11 PM Tomasz Figa wrote: > > On Tue, Nov 17, 2026 at 7:10 PM David Hildenbrand (Arm) > wrote: > > > > I really don't want us to spread KASAN-related GFP flags in the kernel. > > > > There must be a proper way to abstract this. > > > > Why is GFP_HIGHUSER not sufficient? We were already told that this is memory to > > be mapped into user space. Placing data structure on it and handing out pointers > > to that would already be a bit questionable. > > > > So what are the ways to avoid GFP_HIGHUSER_KASAN? > > I think the idea behind GFP_HIGHUSER_KASAN is to make it possible to > skip KASAN for GFP_HIGHUSER by default (for most of its users), but > keep it for some of the users which today use GFP_HIGHUSER for their > memory allocations, but could benefit from the added security. As per > the other patches in the series: > > pipe, fuse: use GFP_HIGHUSER_KASAN for pipe buffer pages > kexec: use GFP_HIGHUSER_KASAN for segment pages > net/rds: use GFP_HIGHUSER_KASAN for message pages > > That said, I'm not familiar with any of the code mentioned by those > patches, so I can't really tell how much they would benefit from KASAN > or if their choice of GFP_HIGHUSER to begin with is correct. Thanks David and Tomasz for the feedback. Tomasz is right about why I added GFP_HIGHUSER_KASAN in v1: out of caution, I audited existing GFP_HIGHUSER callers to find any that never map the pages to userspace and instead fill/drain them in the kernel via kmap_local_page() (pipe, FUSE, kexec, rds). Since this series intends to improve KASAN performance while preserving its security aspects, and the performance impact on pipe/FUSE/kexec/rds was negligible in my testing, v1 was optimized for minimum behavioral change. Looking closer at both of your questions, I agree that the security benefit of keeping those 4 under KASAN is minimal -- e.g., only linear overflows out of the pipe/FUSE/kexec/rds page, since none of them store kernel structures or pointers. That is the exact same trade-off we already make for GFP_HIGHUSER_MOVABLE. To avoid introducing GFP_HIGHUSER_KASAN, I see two options: 1) Simply keep those 4 cases under GFP_HIGHUSER (drop patches 1-4 and 7), reducing the series to just the GFP_HIGHUSER change and its KUnit test. 2) Switch those 4 callers to GFP_USER. Since CONFIG_KASAN_HW_TAGS is 64-bit arm64 only (!CONFIG_HIGHMEM), GFP_USER is identical to today's GFP_HIGHUSER on arm64 and all other 64-bit builds (and if 32-bit CONFIG_HIGHMEM=y builds still need ZONE_HIGHMEM, that could be gated on CONFIG_HIGHMEM, though that feels ugly at call sites). (1) seems much cleaner to me. David, would (1) work for you? Thanks, Jeff