lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 11 Feb 2024 08:35:35 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Nicolas Schier <nicolas@...sle.eu>
Cc: "Russell King (Oracle)" <linux@...linux.org.uk>, Zhang Bingwu <xtex@...s.net>, 
	Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>, 
	Geert Uytterhoeven <geert@...ux-m68k.org>, Dinh Nguyen <dinguyen@...nel.org>, 
	"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>, Helge Deller <deller@....de>, 
	Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>, 
	Albert Ou <aou@...s.berkeley.edu>, Heiko Carstens <hca@...ux.ibm.com>, 
	Vasily Gorbik <gor@...ux.ibm.com>, Alexander Gordeev <agordeev@...ux.ibm.com>, 
	Christian Borntraeger <borntraeger@...ux.ibm.com>, Sven Schnelle <svens@...ux.ibm.com>, 
	"David S. Miller" <davem@...emloft.net>, Andreas Larsson <andreas@...sler.com>, 
	Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, 
	Dave Hansen <dave.hansen@...ux.intel.com>, "H. Peter Anvin" <hpa@...or.com>, 
	Zhang Bingwu <xtexchooser@...k.com>, Nathan Chancellor <nathan@...nel.org>, x86@...nel.org, 
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, 
	linux-m68k@...ts.linux-m68k.org, linux-parisc@...r.kernel.org, 
	linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org, 
	sparclinux@...r.kernel.org
Subject: Re: [PATCH 1/2] kbuild: Abort make on install failures

On Sun, Feb 11, 2024 at 6:21 AM Nicolas Schier <nicolas@...sle.eu> wrote:
>
> On Sat, Feb 10, 2024 at 10:29:00AM +0000 Russell King (Oracle) wrote:
> > On Sat, Feb 10, 2024 at 03:46:00PM +0800, Zhang Bingwu wrote:
> > > From: Zhang Bingwu <xtexchooser@...k.com>
> > >
> > > Setting '-e' flag tells shells to exit with error exit code immediately
> > > after any of commands fails, and causes make(1) to regard recipes as
> > > failed.
> > >
> > > Before this, make will still continue to succeed even after the
> > > installation failed, for example, for insufficient permission or
> > > directory does not exist.
> > >
> > > Signed-off-by: Zhang Bingwu <xtexchooser@...k.com>
> > > ---
>
> Thanks for fixing!
>
> [...]
> > > diff --git a/arch/arm/boot/install.sh b/arch/arm/boot/install.sh
> > > index 9ec11fac7d8d..34e2c6e31fd1 100755
> > > --- a/arch/arm/boot/install.sh
> > > +++ b/arch/arm/boot/install.sh
> > > @@ -17,6 +17,8 @@
> > >  #   $3 - kernel map file
> > >  #   $4 - default install path (blank if root directory)
> > >
> > > +set -e
> > > +
> >
> > What about #!/bin/sh -e on the first line, which is the more normal way
> > to do this for an entire script?
>
> are you sure?  I can find many more occurrences of 'set -e' than the
> shebang version in the Linux tree, especially in the kbuild scripts, thus
> it's bike-shedding, isn't it?
>
> Reviewed-by: Nicolas Schier <nicolas@...sle.eu>
>
> Kind regards,
> Nicolas






When you put -e on the shebang line, like

    #!/bin/sh -e

the option -e is set when you do:

    $ arch/arm/boot/install.sh


But, -e is not set when you do:

    $ sh arch/arm/boot/install.sh



The reason is obvious because the latter case
does not use the shebang line.




In Kbuild, some places run the script directly like the former case,
and others use CONFIG_SHELL like

   $(CONFIG_SHELL) arch/arm/boot/install.sh


The inconsistency is not nice, but that is a different issue.


The separate 'set -e' statement works for both cases,
so I think this is safer, though it is kind of bike-shedding.





-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ