Page MenuHomeFreeBSD

Properly range check the keyboard repeat values in the KDSETREPEAT IOCTLs in the kernel
Needs ReviewPublic

Authored by hselasky on Jan 24 2018, 12:08 PM.
Tags
None
Referenced Files
F102584801: D14027.id.diff
Thu, Nov 14, 9:51 AM
Unknown Object (File)
Thu, Nov 7, 9:54 AM
Unknown Object (File)
Tue, Nov 5, 4:00 PM
Unknown Object (File)
Tue, Nov 5, 6:11 AM
Unknown Object (File)
Sat, Oct 19, 3:17 PM
Unknown Object (File)
Wed, Oct 16, 8:59 AM
Unknown Object (File)
Oct 14 2024, 11:41 PM
Unknown Object (File)
Oct 14 2024, 5:28 PM
Subscribers

Details

Summary

Make sure the keyboard repeat values are range checked in a standard way.
Valid values are listed by the kbdcontrol(1) manual page.

MFC after: 1 week
Sponsored by: Mellanox Technologies

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 15863

Event Timeline

Seem to help against ukbd irqs but the problem is still there. I now discovered how I can get the same behavior in i3 and X.
I did this in xfce4-terminal, don't know if it has to be that or not. Hold down CTRL (with USB keyboard), press any other key and let go, but hold down CTRL the whole time. Now interrupt storms start on CPU 0 timer.

Normal operation (just doing nothing)

kernel`ithread_loop                                               4
kernel`trash_dtor                                                 4
kernel`memcpy                                                     4
kernel`witness_lock                                               5
kernel`_isitmyx                                                   5
kernel`fill_kinfo_proc                                            6
kernel`bzero                                                      7
dtrace.ko`dtrace_dynvar_clean                                     7
kernel`__mtx_unlock_flags                                        10
kernel`cpu_idle                                                  12
i915kms.ko`fw_domains_get                                        12
kernel`__mtx_lock_flags                                          14
kernel`AcpiNsSearchAndEnter                                      16
kernel`witness_checkorder                                        16
kernel`witness_unlock                                            19
kernel`spinlock_exit                                             58
kernel`acpi_cpu_idle                                          83223

With irq storm

dtrace.ko`dtrace_dynvar_clean                                     4
kernel`0xffffffff809dc135                                         5
kernel`AcpiNsSearchAndEnter                                      12
kernel`lock_mtx                                                  13
i915kms.ko`fw_domains_get                                        15
kernel`callout_when                                              33
kernel`unlock_mtx                                                45
kernel`spinlock_enter                                            53
kernel`callout_reset_sbt_on                                      82
kernel`__mtx_lock_spin_flags                                     95
kernel`ukbd_timeout                                             108
kernel`softclock_call_cc                                        108
kernel`witness_lock                                             112
kernel`witness_checkorder                                       133
kernel`__mtx_assert                                             143
kernel`__mtx_unlock_flags                                       178
kernel`usbd_in_polling_mode                                     189
kernel`cpu_idle                                                 197
kernel`ukbd_interrupt                                           201
kernel`__mtx_lock_flags                                         201
kernel`witness_unlock                                           328
kernel`lock_delay                                               616
kernel`memcpy                                                   663
kernel`spinlock_exit                                          11652
kernel`acpi_cpu_idle                                          60365

Together with r331692 this issue is solved.

This revision is now accepted and ready to land.Mar 29 2018, 12:34 PM
This revision now requires review to proceed.Mar 29 2018, 4:37 PM