Patch "efi: fix return value of __setup handlers" has been added to the 5.16-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    efi: fix return value of __setup handlers

to the 5.16-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     efi-fix-return-value-of-__setup-handlers.patch
and it can be found in the queue-5.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 8c4368b3c6d657c6d1ecc7f738567eb14f9d4a5e
Author: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Date:   Mon Feb 28 20:18:51 2022 -0800

    efi: fix return value of __setup handlers
    
    [ Upstream commit 9feaf8b387ee0ece9c1d7add308776b502a35d0c ]
    
    When "dump_apple_properties" is used on the kernel boot command line,
    it causes an Unknown parameter message and the string is added to init's
    argument strings:
    
      Unknown kernel command line parameters "dump_apple_properties
        BOOT_IMAGE=/boot/bzImage-517rc6 efivar_ssdt=newcpu_ssdt", will be
        passed to user space.
    
     Run /sbin/init as init process
       with arguments:
         /sbin/init
         dump_apple_properties
       with environment:
         HOME=/
         TERM=linux
         BOOT_IMAGE=/boot/bzImage-517rc6
         efivar_ssdt=newcpu_ssdt
    
    Similarly when "efivar_ssdt=somestring" is used, it is added to the
    Unknown parameter message and to init's environment strings, polluting
    them (see examples above).
    
    Change the return value of the __setup functions to 1 to indicate
    that the __setup options have been handled.
    
    Fixes: 58c5475aba67 ("x86/efi: Retrieve and assign Apple device properties")
    Fixes: 475fb4e8b2f4 ("efi / ACPI: load SSTDs from EFI variables")
    Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
    Reported-by: Igor Zhbanov <i.zhbanov@xxxxxxxxxxxx>
    Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@xxxxxxxxxxxx
    Cc: Ard Biesheuvel <ardb@xxxxxxxxxx>
    Cc: linux-efi@xxxxxxxxxxxxxxx
    Cc: Lukas Wunner <lukas@xxxxxxxxx>
    Cc: Octavian Purdila <octavian.purdila@xxxxxxxxx>
    Cc: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
    Cc: Matt Fleming <matt@xxxxxxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220301041851.12459-1-rdunlap@xxxxxxxxxxxxx
    Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/firmware/efi/apple-properties.c b/drivers/firmware/efi/apple-properties.c
index 4c3201e290e2..ea84108035eb 100644
--- a/drivers/firmware/efi/apple-properties.c
+++ b/drivers/firmware/efi/apple-properties.c
@@ -24,7 +24,7 @@ static bool dump_properties __initdata;
 static int __init dump_properties_enable(char *arg)
 {
 	dump_properties = true;
-	return 0;
+	return 1;
 }
 
 __setup("dump_apple_properties", dump_properties_enable);
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 7de3f5b6e8d0..5502e176d51b 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -212,7 +212,7 @@ static int __init efivar_ssdt_setup(char *str)
 		memcpy(efivar_ssdt, str, strlen(str));
 	else
 		pr_warn("efivar_ssdt: name too long: %s\n", str);
-	return 0;
+	return 1;
 }
 __setup("efivar_ssdt=", efivar_ssdt_setup);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux