Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer USB keyboard support by default (and require optional enablement of USB Keyboard in configuration settings to enable and flash config change to persist across reboot and upgrades) #1780

Closed
tlaurion opened this issue Sep 5, 2024 · 7 comments · Fixed by #1838

Comments

@tlaurion
Copy link
Collaborator

tlaurion commented Sep 5, 2024

CONFIG_SUPPORT_USB_KEYBOARD=y allows the user to enable USB keyboard support in config. It's off by default. I provide this for Librems due to popular demand.

You're thinking of CONFIG_USB_KEYBOARD_REQUIRED=y which means the device only has USB keyboards.

I'm not familiar with this hardware, but typically the internal keyboard is a PS/2 keyboard (well, really provided by the EC as an 8042 interface, no actual PS/2 port or signaling, but I digress). So I think you have this right @loftlifter31

Originally posted by @JonathonHall-Purism in #1774 (comment)

@tlaurion
Copy link
Collaborator Author

tlaurion commented Sep 5, 2024

This has convenience VS security implications.

@marmarek is that what you would request for platforms having ps2 keyboards but where usb is needed for testing?

Remember rubber ducky with usb+hid support. Thoughts welcome

@marmarek
Copy link
Contributor

marmarek commented Sep 5, 2024

Right, but since it's disabled by default, an USB keyboard can't enable itself on its own. And also the option is placed in the menu deep enough that IMO it can't be switched unknowingly.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Sep 5, 2024

Alright so plan is.

  • Make sure that usb keyboard only boards are enforcing usb required in board configs
  • have all ps2 boards enable usb keyboard optional to be setup by ps2 keyboard if needed
  • make sure config menu warns user of security implication, telling ps2 better for security vs convenience.

@marmarek @JonathonHall-Purism good enough as a plan?

@JonathonHall-Purism
Copy link
Collaborator

* Make sure that usb keyboard only boards are enforcing usb required in board configs

This should already be the case, but never hurts to double check 🤞

* have all ps2 boards enable usb keyboard optional to be setup by ps2 keyboard if needed

Agree. I would do this by removing the CONFIG_SUPPORT_USB_KEYBOARD, since all boards will support it now, there's no need for the config any more. Just update config-gui.sh and modules/linux by removing the tests and keeping the logic that used to apply when it was 'y'.

* make sure config menu warns user of security implication, telling ps2 better for security vs convenience.

Yeah we have that:

        if (whiptail --title 'Enable USB Keyboard?' \
             --yesno "USB keyboards will be usable in $CONFIG_BRAND_NAME.
                    \n\nEnabling USB keyboards could allow a compromised USB device to control
                    \n$CONFIG_BRAND_NAME.
                    \n\nDo you want to proceed?" 0 80) then

I think that's clear and concise. It could allow a compromised USB device to control Heads.

@marmarek
Copy link
Contributor

I just tried t430-hotp-maximized with added CONFIG_SUPPORT_USB_KEYBOARD=y, and it worked as expected:

  1. Initially USB keyboard was not enabled
  2. There is a menu option to enable it, that gives the above warning.
  3. After enabling, USB keyboard works.

@tlaurion
Copy link
Collaborator Author

Should be part of #1821, assigned myself

@tlaurion
Copy link
Collaborator Author

tlaurion commented Nov 5, 2024

@tlaurion tlaurion changed the title Put CONFIG_SUPPORT_USB_KEYBOARD=y in all board configs Offer USB keyboard support by default (and require optional enablement of USB Keyboard in configuration settings to enable and flash config change to persist across reboot and upgrades) Nov 5, 2024
@tlaurion tlaurion removed their assignment Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants