From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 4023535C185 for ; Tue, 18 Aug 2026 08:25:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787041516; cv=none; b=nvOpfNrKG1KZQPrVafRfaxVxuTHWwdDZ8yCx8y7527RR8yQZ4BtflP04guROTkW1sIJFeV/ybDsRDdXOYwzxegxn40vVd8sDd5MWB8os2cdHXvli3bPD+MVf6E+feM7p89GKEkfipBEjIIUO9RCciuRTszMufAmeZ9qw6s3VROo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787041516; c=relaxed/simple; bh=MoKxMu3trW179Mtx8T4bCvrDvhYRCia9C6wY8DzRR0g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JYvL2nSE3rtlKQeDfGgODBNbNR986X81tTitutfvhQxj3av4lGot5Zj561xU8xxMb5mmKGmHfaQY1lwjkDuzb3lgtmGK4BLPBi8rxUm/0Ht1hpYREfZ8RXLJRQ6Dfgm+RnGNDHOVz5jEEIub3zoSmrA88FtTpuyD1acgvLzwtUI= 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=qvKG9+94; arc=none smtp.client-ip=209.85.221.44 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="qvKG9+94" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-480033bdcf4so2601057f8f.2 for ; Tue, 18 Aug 2026 01:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787041512; x=1787646312; darn=vger.kernel.org; h=content-transfer-encoding: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=MoKxMu3trW179Mtx8T4bCvrDvhYRCia9C6wY8DzRR0g=; b=qvKG9+947OEymD95nqWCTSTa6+9aWjlcxfnGFM/3eCE5QYh4j41vIvS1Bao6h1ZPEq Z3zN8vuTaTq1BZAorKCnsj+LRSMd2KC4PafUtK9lQp3iaABI1Cp3Wu+Bh6ghK+Oge0uA SWjSQbez0MabHBqfoulRqacou8Wl/88+MBVaUVhKUVmEBdKikyv4L1pxzAJnPDLhHNuY E1msif29CTbVZd0xlh58vyhJcJRsbSyTAixDtUAV9RubUzBj/bRBX8Ytxi3PNhyFD+6o TfuJtPVCtwFebPklZOTtEg0YpALYowMc1tt058vn7Z4Wt4kgcTOL0p31XRzc6k3GrhTd VrkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787041512; x=1787646312; h=content-transfer-encoding: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=MoKxMu3trW179Mtx8T4bCvrDvhYRCia9C6wY8DzRR0g=; b=ZkvuSaRNVj65vXyXrH2/14GHg7UnoR5Y3btQpQ9geYVOjoT9EsSFJ9Qpk7UIqQyDVz ei/w1tzSbE4U6fOSxBmzOH8TpbZSE5kBOHVyBTAMzIvFFl1qszB0/jAJnOL2fSLAfzN9 +bYlsRKnc5mKW23KpsxtgzvYjHo+jD9Nn9oZxrEYbzBCGUpNthhKwWrGePDBXU7Hyt/1 qQ3+7OpmQC1gEKRnPrhtuk0uiypkrUWqJcnC5Q7OvpCOYALhwUwzjWnMKctVWI2ObhLd DjWC7lporoB0xKKprwFwF+msdJfkSVfXv36wvmwIH/qInCja5SOBlluikZ+Kaxlo5u5K 2Miw== X-Forwarded-Encrypted: i=1; AHgh+RoIVQeXv9uXv16y82MQVjXSNjAn7G9ZLlBuJ7z1TJBjcVhshfHWrdrJwUA/WHHdWCGF838bOH64Zs4xuI0=@vger.kernel.org X-Gm-Message-State: AOJu0YwAFVpdxqNX/3H34zAtxKTN7UfhrcOc/fPxyVYauOVR7YL4U4Gl vzdTB52R4NsKHoFluRBs/bdYUBuzotADjWSLCu7hYrokO5T+y3hYCNlqTcmh+elD X-Gm-Gg: AR+sD12G41zUR8Vg2tAf/OtOhfVS1xEHD3cuZhLSUG60U1Ydf20D9GxvW51xgNw316J VK0KSoVtDYNjGdiVG+wJvAYt1VmA7KRQpYq3XBr9YuV1IMcgcGzxCx562al2ceXVvJzlPvTyHFl omNh+1dcUPYrd4mlFgxzr93CCWetFyjRfFSHJ10WgG1QOECx8A/PisM4tshXqjsNHRL9I9HySHZ QV7V0FWbPfY3J8U1I5g8Khx5JGay+sdPZTOCjrQ36a1KkbNbp3ygMR5tKjUuFnET4etxw6APmvI uZ4F9qt79Se8jZHg7JmsAKOAnTyvIR9xgLNVfmdD7Cu9Lt5nVm5lkAunMOYE1i9SMSiNattqN4l UcD5MEjfxg7oRNqVn6fNG8VASxTdTNNz0WhvcdWEgVFeot26RjPnvZGAWMDciSGOv83Hx3RexCX w4tarANlmnsoB5cjQpJ7WHXsFhw9bo8+ul4BdFkCYR1rL18NyEI2Yb/9wDEP7FpW1Ri59w4Mb7A VER X-Received: by 2002:a05:600c:3f06:b0:499:484a:81d0 with SMTP id 5b1f17b1804b1-49987961c32mr517262115e9.9.1787041511977; Tue, 18 Aug 2026 01:25:11 -0700 (PDT) Received: from dell-desktop ([2a02:587:4b5e:1100:7303:647d:7cc4:8552]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482aa084a64sm4907363f8f.17.2026.08.18.01.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2026 01:25:10 -0700 (PDT) From: Anastasios Papagiannis To: utilityemal77@gmail.com 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, tasos.papagiannnis@gmail.com, viro@zeniv.linux.org.uk Subject: Re: [PATCH bpf-next 2/3] bpf: Add user memory access kfuncs for linux_binprm Date: Tue, 18 Aug 2026 11:24:41 +0300 Message-ID: <20260818082441.4091-1-tasos.papagiannnis@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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? Thanks, Anastasios