Message ID | 20220306024620.5847-1-rdunlap@infradead.org (mailing list archive) |
---|---|
State | Mainlined, archived |
Headers | show |
Series | ACPI: APEI: fix return value of __setup handlers | expand |
Randy Dunlap <rdunlap@infradead.org> writes: > __setup() handlers should return 1 to indicate that the boot option > has been handled. Returning 0 causes a boot option to be listed in > the Unknown kernel command line parameters and also added to init's > arg list (if no '=' sign) or environment list (if of the form 'a=b'). > > Unknown kernel command line parameters "erst_disable > bert_disable hest_disable BOOT_IMAGE=/boot/bzImage-517rc6", will be > passed to user space. > > Run /sbin/init as init process > with arguments: > /sbin/init > erst_disable > bert_disable > hest_disable > with environment: > HOME=/ > TERM=linux > BOOT_IMAGE=/boot/bzImage-517rc6 > > Fixes: a3e2acc5e37b ("ACPI / APEI: Add Boot Error Record Table (BERT) support") > Fixes: a08f82d08053 ("ACPI, APEI, Error Record Serialization Table (ERST) support") > Fixes: 9dc966641677 ("ACPI, APEI, HEST table parsing") > Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Good catch! Thanks for fixing! Reviewed-by: "Huang, Ying" <ying.huang@intel.com> Best Regards, Huang, Ying > Reported-by: Igor Zhbanov <i.zhbanov@omprussia.ru> > Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru > Cc: Huang Ying <ying.huang@intel.com> > Cc: "Rafael J. Wysocki" <rafael@kernel.org> > Cc: Len Brown <lenb@kernel.org> > Cc: linux-acpi@vger.kernel.org > Cc: James Morse <james.morse@arm.com> > Cc: Tony Luck <tony.luck@intel.com> > Cc: Borislav Petkov <bp@alien8.de> > --- > drivers/acpi/apei/bert.c | 2 +- > drivers/acpi/apei/erst.c | 2 +- > drivers/acpi/apei/hest.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > --- lnx-517-rc6.orig/drivers/acpi/apei/bert.c > +++ lnx-517-rc6/drivers/acpi/apei/bert.c > @@ -77,7 +77,7 @@ static int __init setup_bert_disable(cha > { > bert_disable = 1; > > - return 0; > + return 1; > } > __setup("bert_disable", setup_bert_disable); > > --- lnx-517-rc6.orig/drivers/acpi/apei/erst.c > +++ lnx-517-rc6/drivers/acpi/apei/erst.c > @@ -891,7 +891,7 @@ EXPORT_SYMBOL_GPL(erst_clear); > static int __init setup_erst_disable(char *str) > { > erst_disable = 1; > - return 0; > + return 1; > } > > __setup("erst_disable", setup_erst_disable); > --- lnx-517-rc6.orig/drivers/acpi/apei/hest.c > +++ lnx-517-rc6/drivers/acpi/apei/hest.c > @@ -224,7 +224,7 @@ err: > static int __init setup_hest_disable(char *str) > { > hest_disable = HEST_DISABLED; > - return 0; > + return 1; > } > > __setup("hest_disable", setup_hest_disable);
On Mon, Mar 7, 2022 at 2:51 AM Huang, Ying <ying.huang@intel.com> wrote: > > Randy Dunlap <rdunlap@infradead.org> writes: > > > __setup() handlers should return 1 to indicate that the boot option > > has been handled. Returning 0 causes a boot option to be listed in > > the Unknown kernel command line parameters and also added to init's > > arg list (if no '=' sign) or environment list (if of the form 'a=b'). > > > > Unknown kernel command line parameters "erst_disable > > bert_disable hest_disable BOOT_IMAGE=/boot/bzImage-517rc6", will be > > passed to user space. > > > > Run /sbin/init as init process > > with arguments: > > /sbin/init > > erst_disable > > bert_disable > > hest_disable > > with environment: > > HOME=/ > > TERM=linux > > BOOT_IMAGE=/boot/bzImage-517rc6 > > > > Fixes: a3e2acc5e37b ("ACPI / APEI: Add Boot Error Record Table (BERT) support") > > Fixes: a08f82d08053 ("ACPI, APEI, Error Record Serialization Table (ERST) support") > > Fixes: 9dc966641677 ("ACPI, APEI, HEST table parsing") > > Signed-off-by: Randy Dunlap <rdunlap@infradead.org> > > Good catch! Thanks for fixing! > > Reviewed-by: "Huang, Ying" <ying.huang@intel.com> Applied as 5.18 material, thanks!
--- lnx-517-rc6.orig/drivers/acpi/apei/bert.c +++ lnx-517-rc6/drivers/acpi/apei/bert.c @@ -77,7 +77,7 @@ static int __init setup_bert_disable(cha { bert_disable = 1; - return 0; + return 1; } __setup("bert_disable", setup_bert_disable); --- lnx-517-rc6.orig/drivers/acpi/apei/erst.c +++ lnx-517-rc6/drivers/acpi/apei/erst.c @@ -891,7 +891,7 @@ EXPORT_SYMBOL_GPL(erst_clear); static int __init setup_erst_disable(char *str) { erst_disable = 1; - return 0; + return 1; } __setup("erst_disable", setup_erst_disable); --- lnx-517-rc6.orig/drivers/acpi/apei/hest.c +++ lnx-517-rc6/drivers/acpi/apei/hest.c @@ -224,7 +224,7 @@ err: static int __init setup_hest_disable(char *str) { hest_disable = HEST_DISABLED; - return 0; + return 1; } __setup("hest_disable", setup_hest_disable);
__setup() handlers should return 1 to indicate that the boot option has been handled. Returning 0 causes a boot option to be listed in the Unknown kernel command line parameters and also added to init's arg list (if no '=' sign) or environment list (if of the form 'a=b'). Unknown kernel command line parameters "erst_disable bert_disable hest_disable BOOT_IMAGE=/boot/bzImage-517rc6", will be passed to user space. Run /sbin/init as init process with arguments: /sbin/init erst_disable bert_disable hest_disable with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc6 Fixes: a3e2acc5e37b ("ACPI / APEI: Add Boot Error Record Table (BERT) support") Fixes: a08f82d08053 ("ACPI, APEI, Error Record Serialization Table (ERST) support") Fixes: 9dc966641677 ("ACPI, APEI, HEST table parsing") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: Igor Zhbanov <i.zhbanov@omprussia.ru> Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Cc: Huang Ying <ying.huang@intel.com> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Cc: Len Brown <lenb@kernel.org> Cc: linux-acpi@vger.kernel.org Cc: James Morse <james.morse@arm.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Borislav Petkov <bp@alien8.de> --- drivers/acpi/apei/bert.c | 2 +- drivers/acpi/apei/erst.c | 2 +- drivers/acpi/apei/hest.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)