From: sashiko-bot@kernel.org
To: "Martin Kaiser" <martin@kaiser.cx>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH] libbpf: don't preserve ownership during install
Date: Tue, 28 Jul 2026 07:25:17 +0000 [thread overview]
Message-ID: <20260728072519.118D11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260728071516.2706695-1-martin@kaiser.cx>
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.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260728071516.2706695-1-martin@kaiser.cx?part=1
next prev parent reply other threads:[~2026-07-28 7:25 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 [this message]
2026-07-28 8:22 ` Martin Kaiser
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=20260728072519.118D11F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=martin@kaiser.cx \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox