Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 315849 Details for
Bug 248710
Local keyboard DoS through LED switching
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Upstream patch for this issue
0001-Input-atkbd-throttle-LED-switching.patch (text/plain), 3.27 KB, created by
Eugene Teo (Security Response)
on 2008-09-05 08:49:03 UTC
(
hide
)
Description:
Upstream patch for this issue
Filename:
MIME Type:
Creator:
Eugene Teo (Security Response)
Created:
2008-09-05 08:49:03 UTC
Size:
3.27 KB
patch
obsolete
>From da4249c99fd59c4e224e4f9acaf07669d205bb1d Mon Sep 17 00:00:00 2001 >From: Dmitry Torokhov <dtor@insightbb.com> >Date: Thu, 28 Jun 2007 00:46:56 -0400 >Subject: [PATCH] Input: atkbd - throttle LED switching > >On some boxes keyboard controllers are too slow to withstand >continuous flow of requests to turn keyboard LEDs on and off >and start losing some keypresses or even all of them. > >Delay executing of LED switching request if we had another one >within 50 ms thus easing load on the controller. > >Signed-off-by: Dmitry Torokhov <dtor@mail.ru> >--- > drivers/input/keyboard/atkbd.c | 40 ++++++++++++++++++++++++++-------------- > 1 files changed, 26 insertions(+), 14 deletions(-) > >diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c >index be1fe46..9e80012 100644 >--- a/drivers/input/keyboard/atkbd.c >+++ b/drivers/input/keyboard/atkbd.c >@@ -219,7 +219,8 @@ struct atkbd { > unsigned long time; > unsigned long err_count; > >- struct work_struct event_work; >+ struct delayed_work event_work; >+ unsigned long event_jiffies; > struct mutex event_mutex; > unsigned long event_mask; > }; >@@ -565,7 +566,7 @@ static int atkbd_set_leds(struct atkbd *atkbd) > > static void atkbd_event_work(struct work_struct *work) > { >- struct atkbd *atkbd = container_of(work, struct atkbd, event_work); >+ struct atkbd *atkbd = container_of(work, struct atkbd, event_work.work); > > mutex_lock(&atkbd->event_mutex); > >@@ -579,12 +580,30 @@ static void atkbd_event_work(struct work_struct *work) > } > > /* >+ * Schedule switch for execution. We need to throttle requests, >+ * otherwise keyboard may become unresponsive. >+ */ >+static void atkbd_schedule_event_work(struct atkbd *atkbd, int event_bit) >+{ >+ unsigned long delay = msecs_to_jiffies(50); >+ >+ if (time_after(jiffies, atkbd->event_jiffies + delay)) >+ delay = 0; >+ >+ atkbd->event_jiffies = jiffies; >+ set_bit(event_bit, &atkbd->event_mask); >+ wmb(); >+ schedule_delayed_work(&atkbd->event_work, delay); >+} >+ >+/* > * Event callback from the input module. Events that change the state of > * the hardware are processed here. If action can not be performed in > * interrupt context it is offloaded to atkbd_event_work. > */ > >-static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) >+static int atkbd_event(struct input_dev *dev, >+ unsigned int type, unsigned int code, int value) > { > struct atkbd *atkbd = input_get_drvdata(dev); > >@@ -594,19 +613,12 @@ static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int co > switch (type) { > > case EV_LED: >- set_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask); >- wmb(); >- schedule_work(&atkbd->event_work); >+ atkbd_schedule_event_work(atkbd, ATKBD_LED_EVENT_BIT); > return 0; > > case EV_REP: >- >- if (!atkbd->softrepeat) { >- set_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask); >- wmb(); >- schedule_work(&atkbd->event_work); >- } >- >+ if (!atkbd->softrepeat) >+ atkbd_schedule_event_work(atkbd, ATKBD_REP_EVENT_BIT); > return 0; > } > >@@ -940,7 +952,7 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv) > > atkbd->dev = dev; > ps2_init(&atkbd->ps2dev, serio); >- INIT_WORK(&atkbd->event_work, atkbd_event_work); >+ INIT_DELAYED_WORK(&atkbd->event_work, atkbd_event_work); > mutex_init(&atkbd->event_mutex); > > switch (serio->id.type) { >-- >1.5.5.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 248710
: 315849