All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Christian Brauner" <brauner@kernel.org>,
	"Amir Goldstein" <amir73il@gmail.com>
Cc: "Chris Down" <chris@chrisdown.name>,
	"Miklos Szeredi" <mszeredi@redhat.com>,
	bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 12/13] selftests/ftrace: add uprobe tests on overlayfs
Date: Sun, 15 Nov 2026 14:18:18 +0000	[thread overview]
Message-ID: <sashiko-outbox-215574@kernel.org> (raw)
In-Reply-To: <20261115-work-ovl-d_real-v1-12-ca155efbcb2e@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] selftests/ftrace: cleanup() in uprobe overlayfs test fails if
  event is enabled
- [Low] selftests/ftrace: uprobe overlayfs test misses tmpfs xattr skip
  and configs
--

commit cdef3f0121f6552797f32e8a89d02391a6081a77
Author: Christian Brauner <brauner@kernel.org>

selftests/ftrace: add uprobe tests on overlayfs

This commit adds an ftrace selftest that exercises creating and firing uprobe
events on overlayfs metacopy files backed by a data-only layer.

> diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe_overlayfs.tc b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe_overlayfs.tc
> new file mode 100644
> index 0000000000000..a4351e6a3b181
> --- /dev/null
> +++ b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe_overlayfs.tc
> @@ -0,0 +1,92 @@
[ ... ]
> +cleanup() {
> +  echo > uprobe_events
> +  umount $OVL/merged 2> /dev/null || :
> +  umount $OVL 2> /dev/null || :
> +}
> +trap cleanup EXIT

[Severity: Low]
Does cleanup() fail to remove myevent and unmount the filesystems if the test
exits while myevent is enabled?

ftracetest runs test scripts under set -e.  If executing $OVL/merged/sh fails
between enabling and disabling events/uprobes/myevent/enable, the EXIT trap
runs while myevent is still enabled.  Truncating uprobe_events then returns
-EBUSY from trace_uprobe_is_busy() and aborts cleanup() under set -e before
the umount commands run, leaving the uprobe registered and the overlayfs and
tmpfs mounts leaked.  Writing 0 to events/enable at the start of cleanup()
would avoid this.

> +
> +mkdir $OVL/lower $OVL/data $OVL/merged
> +
> +# A metacopy file whose data lives in the data-only layer.
> +REALBIN=`readlink -f /bin/sh`
> +cp $REALBIN $OVL/data/sh
> +truncate -s `stat -c %s $REALBIN` $OVL/lower/sh
> +chmod 755 $OVL/lower/sh
> +setfattr -n trusted.overlay.metacopy $OVL/lower/sh
> +setfattr -n trusted.overlay.redirect -v /sh $OVL/lower/sh

[Severity: Low]
Will this test fail instead of skipping with exit_unsupported when
CONFIG_TMPFS_XATTR is disabled?

tmpfs only supports trusted.* xattrs when CONFIG_TMPFS_XATTR is enabled, which
defaults to n and is not selected by CONFIG_OVERLAY_FS.  Without it, setfattr
on $OVL/lower/sh fails with EOPNOTSUPP and aborts the script under set -e.
Also, should CONFIG_OVERLAY_FS=y and CONFIG_TMPFS_XATTR=y be added to
tools/testing/selftests/ftrace/config?

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


  reply	other threads:[~2026-11-15 14:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 14:01 [PATCH 00/13] fs: let d_real() fail Christian Brauner
2026-11-15 14:01 ` [PATCH 01/13] ovl: don't warn when the lazy lowerdata lookup fails in ovl_d_real() Christian Brauner
2026-11-15 14:12   ` sashiko-bot
2026-11-15 14:01 ` [PATCH 02/13] fs: add d_real_data_inode() and d_real_metadata_inode() Christian Brauner
2026-11-15 14:05   ` sashiko-bot
2026-11-15 14:01 ` [PATCH 03/13] tracing/uprobes: handle errors from resolving the real inode Christian Brauner
2026-11-15 14:07   ` sashiko-bot
2026-11-15 14:01 ` [PATCH 04/13] bpf: handle errors from resolving the real inode in uprobe_multi Christian Brauner
2026-11-15 14:06   ` sashiko-bot
2026-11-15 14:01 ` [PATCH 05/13] selftests/bpf: handle d_real_data_inode() errors in bpf_testmod Christian Brauner
2026-11-15 14:05   ` sashiko-bot
2026-11-15 14:01 ` [PATCH 06/13] ima: handle errors from resolving the real inode Christian Brauner
2026-11-15 14:10   ` sashiko-bot
2026-11-15 14:01 ` [PATCH 07/13] ima,evm: use d_real_metadata_inode() Christian Brauner
2026-11-15 14:05   ` sashiko-bot
2026-11-15 14:01 ` [PATCH 08/13] ipe: handle errors from resolving the real inode Christian Brauner
2026-11-15 14:07   ` sashiko-bot
2026-11-15 14:37   ` bot+bpf-ci
2026-11-15 14:01 ` [PATCH 09/13] bpf: return NULL from bpf_real_data_inode() on errors Christian Brauner
2026-11-15 14:08   ` sashiko-bot
2026-11-15 14:01 ` [PATCH 10/13] ovl: return the error from the lazy lowerdata lookup in ovl_d_real() Christian Brauner
2026-11-15 14:15   ` sashiko-bot
2026-11-15 14:01 ` [PATCH 11/13] fs: remove d_real_inode() Christian Brauner
2026-11-15 14:07   ` sashiko-bot
2026-11-15 14:01 ` [PATCH 12/13] selftests/ftrace: add uprobe tests on overlayfs Christian Brauner
2026-11-15 14:18   ` sashiko-bot [this message]
2026-11-15 14:01 ` [PATCH 13/13] selftests/bpf: add uprobe_multi test on overlayfs without data Christian Brauner
2026-11-15 14:12   ` sashiko-bot

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-215574@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=chris@chrisdown.name \
    --cc=linux-mm@kvack.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mszeredi@redhat.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.