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

Disable implicit controlling TTY. #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nihilus
Copy link

@nihilus nihilus commented Oct 8, 2024

Disable the use of implicit controlling
TTYs. They will be enabled on demand.

This fixes a bug where 2 or more
consecutive Ctrl-C at the login prompt
triggers a reboot of the device.

Closes: openwrt/openwrt#11306

Disable the use of implicit controlling
TTYs. They will be enabled on demand.

This fixes a bug where 2 or more
consecutive Ctrl-C at the login prompt
triggers a reboot of the device.

Closes: openwrt/openwrt#11306

Signed-off-by: Markus Gothe <[email protected]>
@blogic
Copy link
Contributor

blogic commented Oct 8, 2024

@nihilus kindly elaborate on the issue that this patch fixes. took a quick glance and patch looks fine, but fail to understand the root cause of the issue

@nihilus
Copy link
Author

nihilus commented Oct 8, 2024

Hello, the issue is that that there is a small window where procd unintentionally gets a controlling TTY.

So at the login prompt when using a serial console and pressing Ctrl-C consecutively 2 or more times the second Ctrl-C will be propagated to procd which will reboot the device.

For more information see openwrt/openwrt#11306

@blogic
Copy link
Contributor

blogic commented Oct 8, 2024

@nihilus ok, I just tried this on an OpenWrt One and spammed ctrl+c during boot and did not see a reboot
what HW are you seeing this on ?

@nihilus
Copy link
Author

nihilus commented Oct 8, 2024

You must make sure you are at the login prompt before spamming.

We have been seeing this issue on a lot of our own HW.

@blogic
Copy link
Contributor

blogic commented Oct 8, 2024

after enabling ttylogin I was able to reproduce this. procd probably receives a SIGINT and then shuts down causing the reboot.

I'll investigate/test a bit more tomorrow and then merge the patch with an updated patch annotation.

@nihilus
Copy link
Author

nihilus commented Oct 8, 2024

after enabling ttylogin I was able to reproduce this. procd probably receives a SIGINT and then shuts down causing the reboot.

I'll investigate/test a bit more tomorrow and then merge the patch with an updated patch annotation.

Yes that's exactly what's happening because of a 0.5s window where the TTY is controlling.

@nihilus
Copy link
Author

nihilus commented Oct 10, 2024

@blogic any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sending multiple Ctrl+C to UART ttylogin will trigger a system restart
2 participants