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]
Message-ID: <YyyZRt5j180KzGqc@nixie71>
Date:   Thu, 22 Sep 2022 12:20:06 -0500
From:   Jeff LaBundy <jeff@...undy.com>
To:     Quentin Schulz <foss+kernel@...il.net>
Cc:     robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org,
        heiko@...ech.de, dmitry.torokhov@...il.com,
        klaus.goger@...obroma-systems.com, devicetree@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-input@...r.kernel.org,
        Quentin Schulz <quentin.schulz@...obroma-systems.com>
Subject: Re: [PATCH 1/3] Input: add `SW_BOOT_ALT`

Hi Quentin,

On Thu, Sep 22, 2022 at 12:12:09PM +0200, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@...obroma-systems.com>
> 
> This event code represents the firmware source to use at boot.
> Value 0 means using "standard" firmware source, value 1 means using
> "alternative" firmware source.
> 
> For example, some hardware has the ability to force the BOOTROM to load
> the bootloader from a secondary firmware source (say SD card) instead of
> trying with the standard first and then the secondary. This event allows
> the userspace to know which firmware source was requested *in hardware*.
> 
> Signed-off-by: Quentin Schulz <quentin.schulz@...obroma-systems.com>

This does not seem like the right approach, especially since the switch
can easily be flipped after the state is already latched.

If the bootloader needs to pass information to the kernel (boot source or
otherwise), a safer and more flexible approach is to share some variables
in eMMC, or pass information using the kernel cmdline.

> ---
>  include/linux/mod_devicetable.h        | 2 +-
>  include/uapi/linux/input-event-codes.h | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> index 549590e9c644..009e71376a61 100644
> --- a/include/linux/mod_devicetable.h
> +++ b/include/linux/mod_devicetable.h
> @@ -326,7 +326,7 @@ struct pcmcia_device_id {
>  #define INPUT_DEVICE_ID_LED_MAX		0x0f
>  #define INPUT_DEVICE_ID_SND_MAX		0x07
>  #define INPUT_DEVICE_ID_FF_MAX		0x7f
> -#define INPUT_DEVICE_ID_SW_MAX		0x10
> +#define INPUT_DEVICE_ID_SW_MAX		0x11
>  #define INPUT_DEVICE_ID_PROP_MAX	0x1f
>  
>  #define INPUT_DEVICE_ID_MATCH_BUS	1
> diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
> index dff8e7f17074..8cd2b58c81d7 100644
> --- a/include/uapi/linux/input-event-codes.h
> +++ b/include/uapi/linux/input-event-codes.h
> @@ -917,7 +917,8 @@
>  #define SW_MUTE_DEVICE		0x0e  /* set = device disabled */
>  #define SW_PEN_INSERTED		0x0f  /* set = pen inserted */
>  #define SW_MACHINE_COVER	0x10  /* set = cover closed */
> -#define SW_MAX			0x10
> +#define SW_BOOT_ALT		0x11  /* set = alternative boot firmware source */
> +#define SW_MAX			0x11
>  #define SW_CNT			(SW_MAX+1)
>  
>  /*
> -- 
> 2.37.3
> 

Kind regards,
Jeff LaBundy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ