On some machines when the pckbc(4) keyboard controller driver attaches
to the console, it's possible to inject characters by moving your mouse
in to the keyboard channel.  When injecting enough noise the keyboard
will stop operating at some point.  A nice way to test this, e.g. on my
ThinkPad, is by entering in to UKC at boot time and then move your
mouse.

This diff will discard characters coming from the aux slot which are
mixed in to the keyboard slot when we're still in console mode.

This issue has been reported by deraadt@ who already has OK'ed the diff.

Comments?  Testing?  More OKs?

Thanks,
Marcus


Index: sys/dev/ic/pckbc.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/pckbc.c,v
retrieving revision 1.50
diff -u -p -u -p -r1.50 pckbc.c
--- sys/dev/ic/pckbc.c  11 Mar 2017 11:55:03 -0000      1.50
+++ sys/dev/ic/pckbc.c  27 Jan 2019 09:01:31 -0000
@@ -161,6 +161,9 @@ pckbc_poll_data1(bus_space_tag_t iot, bu
                                if (slot == PCKBC_AUX_SLOT) {
                                        DPRINTF("lost kbd 0x%x\n", c);
                                        continue;
+                               } else if (stat & KBS_AUXDATA) {
+                                       DPRINTF("discard aux data 0x%x\n", c);
+                                       continue;
                                }
                        }
                        return (c);

Reply via email to