Bug 491940 - [Stratus 4.8 bug] panic reading /proc/bus/input/devices during input device removal
[Stratus 4.8 bug] panic reading /proc/bus/input/devices during input device r...
Status: CLOSED DUPLICATE of bug 472005
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
x86_64 Linux
high Severity high
: rc
: 4.8
Assigned To: Jim Paradis
Red Hat Kernel QE team
: OtherQA, Reopened
Depends On:
Blocks: 431715
  Show dependency treegraph
Reported: 2009-03-24 14:10 EDT by Andrius Benokraitis
Modified: 2015-07-14 00:27 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 472005
Last Closed: 2009-04-22 13:26:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to add mutex locking to the dev list (3.35 KB, patch)
2009-03-24 14:12 EDT, Andrius Benokraitis
no flags Details | Diff
Incremental patch to fix locking (1.13 KB, patch)
2009-03-27 13:59 EDT, Jim Paradis
no flags Details | Diff

  None (edit)
Description Andrius Benokraitis 2009-03-24 14:10:49 EDT
+++ This bug was initially created as a clone of Bug #472005 +++

Description of problem:
General protection exception during input device removal.

Version-Release number of selected component (if applicable):

How reproducible:
surprise removal of USB root hub or USB input devices triggers this problem.  It is infrequent and occurs perhaps once per several hundred device removals.  This has only been seen on systems with 8 CPUs.

Steps to Reproduce:
1. Induce moderate (disk-IO) workload.
2. Perform suprise device removals.
Actual results:
Kernel panic occurs

Expected results:
No panic

Additional info:
Two memory dumps from this problem are available.  Analysis of the dumps will be attached.  In summary, the problem seems to occur because there is no locking or reference counting to protect input_devices_read from referencing structures concurrently with their deallocation by unregistering input devices.
Comment 1 Andrius Benokraitis 2009-03-24 14:12:56 EDT
Created attachment 336513 [details]
Patch to add mutex locking to the dev list 

the following patch is a follow-on to the patch originally committed in bugzilla 472005.
Comment 2 Peter Martuccelli 2009-03-24 14:31:14 EDT
Patch needs to be tested and posted by 3/25, and clean up the patch before posting please.
Comment 3 RHEL Product and Program Management 2009-03-24 14:37:51 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 4 Andrius Benokraitis 2009-03-26 11:04:06 EDT
Jim - this is now late per PeterM's comment - what's the status?
Comment 5 Jim Paradis 2009-03-27 13:59:58 EDT
Created attachment 337047 [details]
Incremental patch to fix locking

This is an incremental patch to fix the locking.  This applies on top of the main patch attached to Bug 472005.  This patch has already been ack'ed on rhkernel-list.
Comment 6 Andrius Benokraitis 2009-03-27 14:15:03 EDT
I'm assuming this follow-on patch has been POSTed as well (not just the initial patch?)
Comment 8 Vivek Goyal 2009-03-31 11:44:20 EDT
Committed in 86.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/
Comment 10 Chris Ward 2009-04-09 03:43:50 EDT
~~ Attention Partners! Snap 3 Released ~~
RHEL 4.8 Snapshot 3 has been released on partners.redhat.com. There
should be a fix present that resolves this bug.

If you encounter any issues, please set the bug back to the ASSIGNED state and
describe the issues you encountered. If you have found a NEW bug, clone this
bug and describe the issues you encountered. Further questions can be
directed to your Red Hat Partner Manager.

If you have VERIFIED the bug fix. Please select your PartnerID from the
Verified field above. Please leave a comment with your test results details.
Include which arches tested, package version and any applicable logs.
Comment 11 Chris Ward 2009-04-15 05:57:33 EDT
Jim, could you please provide additional details regarding Status's verification results?
Comment 12 Andrius Benokraitis 2009-04-15 18:25:02 EDT
The patch in this BZ has caused a regression. Please post a patch ASAP.

mutex_lock() was getting called twice in a row.  Specifically:

+	mutex_unlock(&input_mutex);
 	input_call_hotplug("remove", dev);
+	mutex_lock(&input_mutex);
Comment 13 Andrius Benokraitis 2009-04-16 15:42:52 EDT
Closing as a dupe of the original bug, since this will be fixed for sure in RHEL 4.9.

*** This bug has been marked as a duplicate of bug 472005 ***
Comment 16 Prarit Bhargava 2009-04-21 08:27:03 EDT
Commits 2e15431e2b263e57b39db872f0431e2aaedd239a (incremental patch) and 6081c416296fd779c2211df4a31bce514aa9a7d2 need to be reverted.

Comment 18 Vivek Goyal 2009-04-21 10:54:51 EDT
I have reverted following two patches in 89.EL. Rpms are available at http://people.redhat.com/vgoyal/rhel4/.


-Revert "fix race condition in input.c (Vivek Goyal) [491940]
-Revert "more fixes for fix race condition in input.c" (Vivek Goyal) [491940]

git commits.
Comment 20 Andrius Benokraitis 2009-04-22 13:26:08 EDT

*** This bug has been marked as a duplicate of bug 472005 ***

Note You need to log in before you can comment on or make changes to this bug.