All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Naohiro Aota" <naohiro.aota@wdc.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH 1/6] fs: add fs_dp BPF struct_ops for file data placement
Date: Tue, 01 Dec 2026 04:45:25 +0000	[thread overview]
Message-ID: <sashiko-outbox-242539@kernel.org> (raw)
In-Reply-To: <20261201043452.3866039-2-naohiro.aota@wdc.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] fs: missing __nullable suffix on fa parameter in
  __fs_dp_file_open()
--

commit 70c18d0e6fb82f627357fe30e49bdb298b3c5a44
Author: Naohiro Aota <naohiro.aota@wdc.com>

fs: add fs_dp BPF struct_ops for file data placement

This commit adds the fs_dp_ops BPF struct_ops interface and registry so a
BPF program can select a write lifetime hint when a file is opened for
writing.

> diff --git a/fs/fs_dp.c b/fs/fs_dp.c
> new file mode 100644
> index 0000000000000..1c370f6ffa42b
> --- /dev/null
> +++ b/fs/fs_dp.c
[ ... ]
> +static int __fs_dp_file_open(const struct file *file, unsigned long parent_ino,
> +			     const struct file_kattr *fa,
> +			     struct fs_dp_file_open_res *res)
> +{
> +	return 0;
> +}

[Severity: High]
Should the fa parameter in __fs_dp_file_open() (and struct fs_dp_ops) be
named fa__nullable?

The comment on struct fs_dp_ops in include/linux/fs_dp.h states that fa
may be NULL if the filesystem does not provide file attributes.  However,
prepare_arg_info() and btf_ctx_access() check the BTF parameter name on
the cfi_stubs function for the __nullable suffix.  Without fa__nullable,
the verifier marks fa as a non-NULL PTR_TO_BTF_ID | PTR_TRUSTED pointer
instead of adding PTR_MAYBE_NULL, allowing a BPF program to dereference
fa without a NULL check and trigger a kernel NULL pointer dereference when
a filesystem passes NULL.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201043452.3866039-1-naohiro.aota@wdc.com?part=1

  reply	other threads:[~2026-12-01  4:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  4:34 [PATCH 0/6] xfs: BPF data placement policy for zoned file systems Naohiro Aota
2026-12-01  4:34 ` [PATCH 1/6] fs: add fs_dp BPF struct_ops for file data placement Naohiro Aota
2026-12-01  4:45   ` sashiko-bot [this message]
2026-12-01  4:34 ` [PATCH 2/6] bpf: allow fs_dp struct_ops programs to call FS kfuncs Naohiro Aota
2026-12-01  4:34 ` [PATCH 3/6] xfs: add BPF data placement hook at file open Naohiro Aota
2026-12-01  4:49   ` sashiko-bot
2026-12-01  4:34 ` [PATCH 4/6] xfs: add ioctls to select a BPF data placement policy Naohiro Aota
2026-12-01  4:34 ` [PATCH 5/6] xfs: bind a BPF data placement policy to a project ID Naohiro Aota
2026-12-01  4:34 ` [PATCH 6/6] xfs: let XFS_IOC_{SET,GET}_DP_OPS act on " Naohiro Aota
2026-12-01  4:37 ` [PATCH 1/2] fs_dp: let a policy pick a write stream Naohiro Aota
2026-12-01  4:37   ` [PATCH 2/2] xfs: bind write streams along with a data placement policy Naohiro Aota
2026-12-01  4:56 ` [PATCH 0/6] xfs: BPF data placement policy for zoned file systems Alexei Starovoitov
2026-12-01  9:15   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-242539@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=naohiro.aota@wdc.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.