From: Martin Kaiser <martin@kaiser.cx>
To: sashiko-reviews@lists.linux.dev
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH] libbpf: don't preserve ownership during install
Date: Tue, 28 Jul 2026 10:22:56 +0200 [thread overview]
Message-ID: <amhm4G33dMpLJx/k@nb282.user.codasip.com> (raw)
In-Reply-To: <20260728072519.118D11F000E9@smtp.kernel.org>
Thus wrote sashiko-bot@kernel.org (sashiko-bot@kernel.org):
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The use of the GNU-specific `cp --preserve` extension breaks `make install` on platforms with BSD or BusyBox `cp` implementations (e.g., macOS, FreeBSD, Alpine).
> --
> --- Patch [1]: [PATCH] libbpf: don't preserve ownership during install ---
> commit 20b6f948388a1067581300a57d47fc33d1950c11
> Author: Martin Kaiser <martin@kaiser.cx>
> libbpf: don't preserve ownership during install
> This commit modifies the libbpf install_lib target in the Makefile to
> prevent leaking the source tree owner's UID into the root filesystem. It
> replaces the cp -p flag with the --preserve=mode,timestamps flag to only
> preserve specific file attributes during installation.
> > diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> > --- a/tools/lib/bpf/Makefile
> > +++ b/tools/lib/bpf/Makefile
> > @@ -231,7 +231,7 @@ endef
> > install_lib: all_cmd
> > $(call QUIET_INSTALL, $(LIB_TARGET)) \
> > $(call do_install_mkdir,$(libdir_SQ)); \
> > - cp -fpR $(LIB_FILE) $(DESTDIR)$(libdir_SQ)
> > + cp -fR --preserve=mode,timestamps $(LIB_FILE) $(DESTDIR)$(libdir_SQ)
> [Severity: Medium]
> Will this break the installation process on platforms that do not use GNU
> coreutils?
> The --preserve argument is a GNU-specific extension. It appears this might
> cause the make install target to fail with an unrecognized option error on
> systems relying on BSD or BusyBox implementations of cp, such as macOS,
> FreeBSD, or Alpine Linux.
commit 1375152bb02a ("tools: lib: thermal: don't preserve owner in install")
makes a similar change for tools/lib/thermal/Makefile.
I'd assume that it's reasonable to require coreutils for kernel compilation.
AFAICS, kernel builds on Alpine linux require the alpine-sdk package which
contains coreutils.
Thanks,
Martin
prev parent reply other threads:[~2026-07-28 8:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 7:14 [PATCH] libbpf: don't preserve ownership during install Martin Kaiser
2026-07-28 7:25 ` sashiko-bot
2026-07-28 8:22 ` Martin Kaiser [this message]
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=amhm4G33dMpLJx/k@nb282.user.codasip.com \
--to=martin@kaiser.cx \
--cc=bpf@vger.kernel.org \
--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.