From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yx1-f45.google.com (mail-yx1-f45.google.com [74.125.224.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E467E313E38 for ; Tue, 18 Aug 2026 21:34:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787088854; cv=none; b=ts4R+5kEG7UQVkfUAbeVud94RLe+GFB0m1ZkBGzwFbEoSk0vfaYCbzkYy4Lnh9dFzLBPWTQeFQCs31UIIquloLGtx4aNuVCbdg4N8nCWM/32XGSuulV/bnwJPoM2FzLbe/wQltn6tQxajNyiQZWNhr5ImW41Kw2Xc8+TzhqrbEM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787088854; c=relaxed/simple; bh=avzpMIpWk8G0UsinOiaW/I+zSHwJiOsnpz63IET9gm8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oKo5YztG5Phw4IiXx1LsmFsX14QRDeb1/jqH5uQR5wwCsmFAO2VfQujZj1ydnYvL/FSN1AJsrA1y7Ltk46ckBClIgPuI0TAsUTRKr/GgeZX0rmmROwOhaAM3Uw952+++y/+mOwET9KsPt24/1r6VpLBzvHVrc5adl3YwQJesCzo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kF3W6/jt; arc=none smtp.client-ip=74.125.224.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kF3W6/jt" Received: by mail-yx1-f45.google.com with SMTP id 956f58d0204a3-66c70e2904dso561777d50.1 for ; Tue, 18 Aug 2026 14:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787088852; x=1787693652; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=3sDmUeEbcal2gxd06G7R/9k1xkDLSkoYHHtzuG733R4=; b=kF3W6/jtJwvv4A0H6CNDc2vwexeyPGmkzPlmKMXuLoLpQh/DyCrEcWXJqQfu/Ty1dh RJZF2DJvF4X0+kbqJN7bEGy+A0cm9HDKJOHD/CGbhpsVBZ5sQWXkFFXP7X/LIYUPSlEX jHsZxiHyMuup2x96l1R33XK3s8pH2xWrbxkQ7Npts+qabNAuoPxaXglnbJs+oT7g2Xjm Un11fCY4a0Drnj6Vk1ZiegGjLhDm7M9lPDPHy8ZT4bzbF5c3R+cOMJfNsZlXFACYgI/f wK+ThaZzLvlgguNvVXuAxIg1vvTV/mwPe/BW+iMj9qf8OZkRBazuKDdy7cvcxjLQrwsD siwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787088852; x=1787693652; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3sDmUeEbcal2gxd06G7R/9k1xkDLSkoYHHtzuG733R4=; b=p2wKUy64g3nhsrQyUCNJc32utQ0jToEnfWFlGoUnQKKkluBJLVpaPsXtSutOt+pXDa iuzIj8jGsIKQBuXfOU4XSaKWz3Tb7Maa7+5JmiRt9jQrQdHDIMiAmtB+bjvcjfpmLehH NZqJHHYjQJ0r1awf1ORLeDdQ5RXlnhRQ+j6RL9Zt7SLoY/PONkMNXEBgeg6Z4F4Sa31y VFSgUqo4tTcLGomQPvUm8AKYJZkAhAee3COI8mJHg2VEX1mmuM/S3XRNAjCM8P99UtcN ZdQ/yy+9yGYuxzaqI2600uQPkxwNH6sEWeR5bg5LLHro61fkMZYdIrd1MFiu9rwD4jXj COfA== X-Forwarded-Encrypted: i=1; AHgh+RqGkCG9XlQ5s7kZ3xRVs7xNML0eVig8NAMLh6+J5ZpFp0JBfqwOl8QTAM6uwhsHSKplI6Pu/II495wN0p0=@vger.kernel.org X-Gm-Message-State: AOJu0YyQy8JLZpuUXDgEkhKM2l41er0wN5d2DNhmx7Nr3byZ41jAY2K+ OK/UBa7BDbXHXLVIY6onZHYpccNQ9/uBTuom60IS12V8kC4oD49MUVac X-Gm-Gg: AR+sD11eUtIZwtPrmhvDkTr3+NZrIHAqe6gwoplkHvTUOUx+Om0vLLAplmEM1AGr5RV imcbQl7fwHVEZma5UR7ZupHXN+0tfw2UVRwQNjIgQ6oNHFQmoN3Y6aryVAiuiJdY+907f1Zmjq4 WW4ZvuDGV8CgK2HISvYtnaXGvMYIy3YZ6FINXK09ZQ7JXehzxXTF7lWbbNSvQ+ioKJM/I/QQ7zf UCGD9jO9OYRggCHAHlPgR775nzHVn60UqH1GPz903UuBAttZ72tia0ORgIFKYd2Uc1OsxHJf+wd w4C6pUpPaQEkCZmd1x6ZmRpETOg96Zwed44FadOA6Uk5hxWSiBeXIpKM7WR+Z/DSuQ8h8ZIFFk5 DLsjSTR2aWNHtd5K1IZzEXlJDX6W46gVAum8PkStkunrtw1kToyEGI20qkhcoTWpiLl2WNFG7L3 W5Kchftf/pMT95QygiRELlwfSBsK5UpLCuB37hYXWgwtHl0O8D1A1FEgesHh7HRAYA3TBU99SdD mPtmzMtBj9fuCGUzXr5p3Q= X-Received: by 2002:a53:e911:0:b0:668:9b6a:653b with SMTP id 956f58d0204a3-66ccb537d3amr50318d50.3.1787088851823; Tue, 18 Aug 2026 14:34:11 -0700 (PDT) Received: from zenbox ([2600:1700:18fb:6011:5ffe:d5c9:845d:50b5]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-66ccb19e096sm52049d50.19.2026.08.18.14.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2026 14:34:11 -0700 (PDT) Date: Tue, 18 Aug 2026 17:34:10 -0400 From: Justin Suess To: Anastasios Papagiannis Cc: akpm@linux-foundation.org, andrii@kernel.org, ast@kernel.org, bpf@vger.kernel.org, brauner@kernel.org, daniel@iogearbox.net, david@kernel.org, eddyz87@gmail.com, kpsingh@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, matt@bobrowski.net, memxor@gmail.com, song@kernel.org, viro@zeniv.linux.org.uk Subject: Re: [PATCH bpf-next 2/3] bpf: Add user memory access kfuncs for linux_binprm Message-ID: References: <20260818082441.4091-1-tasos.papagiannnis@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260818082441.4091-1-tasos.papagiannnis@gmail.com> On Tue, Aug 18, 2026 at 11:24:41AM +0300, Anastasios Papagiannis wrote: > Thanks for the review! > > > Would it be better to handle that case transparently rather than > > requiring introducing a new kfunc / leaving that gap open for NOMMU? > > > Either return an error or perform the copy from bprm->page[]. > > > Unless there's some reason I'm not seeing. > > My understanding is that there is currently no way to use these kfuncs > on a NOMMU system. Although CONFIG_BPF_LSM does not directly depend on > CONFIG_MMU, as far as I can tell, no current NOMMU architecture provides > the required support to use them. For this reason even if I write that > code, this cannot be tested. > > > It would also be better for portability across NOMMU / CONFIG_MMU > > systems (the exisiting kfunc is never registered, so a program using it > > would be rejected rather than able to handle the error). > > As you suggested, I would propose to register those kfuncs > unconditionally, move the ifdefs inside those kfuncs, in the case > of NOMMU return an error (e.g. -EOPNOTSUPP) and allow the programs to > handle those. > > Does this sound reasonable? > Yes that does. It's a small niche anyway (I don't think a lot of people are using BPF and NOMMU anyway, and BPF_LSM && !MMU is unsatisfiable unless RISC-V or some other architecture gets JIT support in nommu) And when/if (big if) it does, they wouldn't even need this kfunc and could bpf_probe_read_kernel() bprm->page[] directly. So an error is best. Justin > Thanks, > Anastasios