[PATCH 09/13] bpf: return NULL from bpf_real_data_inode() on errors

sashiko-bot at kernel.org sashiko-bot at kernel.org
Sun Nov 15 14:08:09 UTC 2026


> d_real() is about to be able to fail for D_REAL_DATA. So switch
> bpf_real_data_inode() from d_real_inode() to d_real_data_inode() and
> return NULL if the data can't be resolved.
> 
> The kfunc is already KF_SLEEPABLE | KF_RET_NULL and its documentation
> says it may return NULL. So programs already have to deal with NULL and
> the verifier enforces that. Note that this is the caller that most
> easily ends up with a file whose data was never looked up.
> lsm.s/file_open runs before ovl_open() and lsm.s/file_receive sees
> O_PATH files passed via SCM_RIGHTS.
> 
> Spell that out in the documentation.
> 
> This is a no-op until d_real() can actually fail.
> 
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261115-work-ovl-d_real-v1-0-ca155efbcb2e@kernel.org?part=9




More information about the Linux-security-module-archive mailing list