Re: Fortify compilation warning in __padata_set_cpumask()

2024-11-02 Thread Kees Cook
On Thu, Oct 31, 2024 at 08:40:33PM +, Thomas Weißschuh wrote: > Hi Kees, > > I'm running into compilation warnings/errors due to fortify-string.h. > > Environment: > - Commit 0fc810ae3ae110f9e2fe80fc8c8d62f97907 (current mainline master) > - gcc (GCC) 14.2.1 20240910 > - Relevant config (

Re: [RFC PATCH 00/11] output a valid shell script when running 'make -n'

2024-11-02 Thread Nicolas Schier
On Mon, Aug 19, 2024 at 06:02:57PM +0200 Vegard Nossum wrote: > This patch series lets 'make -n' output a shell script that can be > used to build the kernel without any further use of make. For example: > > make defconfig > > # ensure some build prerequisites are built > make prepare

Re: [RFC PATCH 02/11] kbuild: document some prerequisites

2024-11-02 Thread Nicolas Schier
On Mon, Aug 19, 2024 at 06:02:59PM +0200 Vegard Nossum wrote: > When running 'make --dry-run', make will invoke itself recursively for > recipes using $(MAKE), but otherwise not execute the other commands in > a recipe. > > However, if a prerequisite is missing and 'make' does not how to create it

Re: [RFC PATCH 03/11] kbuild: pass KERNELVERSION and LOCALVERSION explicitly to setlocalversion

2024-11-02 Thread Nicolas Schier
On Mon, Aug 19, 2024 at 06:03:00PM +0200 Vegard Nossum wrote: > These environment variables are passed when invoking 'make', but if > running 'make -n' we need to pass them explicitly so they become part > of the printed command. > > Signed-off-by: Vegard Nossum > --- > Makefile | 5 - > 1 f

Re: [RFC PATCH 01/11] kbuild: ignore .config rule for make --always-make

2024-11-02 Thread Nicolas Schier
On Mon, Aug 19, 2024 at 06:02:58PM +0200 Vegard Nossum wrote: > Before this patch, using 'make --always-make' would always result in the > error message about the missing .config being displayed. > > Detect the -B/--always-make flag and leave this rule out, which allows the > rest of the build to

Re: [RFC PATCH 04/11] kbuild: don't execute .ko recipe in --dry-run mode

2024-11-02 Thread Nicolas Schier
On Mon, Aug 19, 2024 at 06:03:01PM +0200 Vegard Nossum wrote: > Prefixing a line in a make recipe with + makes that command execute even > in --dry-run mode. We don't need that here; remove it. In case somebody else also wants to know why make behaves that way: https://www.gnu.org/software/make/ma

Re: [RFC PATCH 06/11] kbuild: set $dry_run when running in --dry-run mode

2024-11-02 Thread Nicolas Schier
On Mon, Aug 19, 2024 at 06:03:03PM +0200 Vegard Nossum wrote: > Add a convenience variable that allows us to use 'ifdef dry_run...endif' > in Makefiles or '[ -v dry_run ]' in shell scripts to test whether make > was invoked with '-n'. > > See [1] for an explanation of this particular construction.

Re: [RFC PATCH 05/11] kbuild: execute modules.order recipe in --dry-run mode

2024-11-02 Thread Nicolas Schier
On Mon, Aug 19, 2024 at 06:03:02PM +0200 Vegard Nossum wrote: > modules.order is read by scripts/Makefile.modfinal to determine which > modules to build, so we need this recipe to execute if we want to be able > to output the recipes for building modules in dry-run mode. > > Signed-off-by: Vegard

Re: [PATCH v2] lib: string_helpers: silence snprintf() output truncation warning

2024-11-02 Thread Kees Cook
On Fri, 01 Nov 2024 21:54:53 +0100, Bartosz Golaszewski wrote: > The output of ".%03u" with the unsigned int in range [0, 4294966295] may > get truncated if the target buffer is not 12 bytes. This can't really > happen here as the 'remainder' variable cannot exceed 999 but the > compiler doesn't kn

Re: [RFC PATCH 01/11] kbuild: ignore .config rule for make --always-make

2024-11-02 Thread Miguel Ojeda
On Sat, Nov 2, 2024 at 10:08 PM Nicolas Schier wrote: > > As we still also support make v3.80 to v4.0, please use $(short-opts) > defined around line 27. We moved to 4.0 in 5f99665ee8f4 ("kbuild: raise the minimum GNU Make requirement to 4.0") -- or do you mean something else / am I missing somet