Bug 491940 - [Stratus 4.8 bug] panic reading /proc/bus/input/devices during input device removal
Summary: [Stratus 4.8 bug] panic reading /proc/bus/input/devices during input device r...
Keywords:
Status: CLOSED DUPLICATE of bug 472005
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.8
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: 4.8
Assignee: Jim Paradis
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks: 431715
TreeView+ depends on / blocked
 
Reported: 2009-03-24 18:10 UTC by Andrius Benokraitis
Modified: 2015-07-14 04:27 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 472005
Environment:
Last Closed: 2009-04-22 17:26:08 UTC
Target Upstream Version:
Embargoed:


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

Description Andrius Benokraitis 2009-03-24 18:10:49 UTC
+++ 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):
kernel-2.6.9-78.0.5.ELsmp

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.
3. 
  
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 18:12:56 UTC
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 18:31:14 UTC
Patch needs to be tested and posted by 3/25, and clean up the patch before posting please.

Comment 3 RHEL Program Management 2009-03-24 18:37:51 UTC
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
release.

Comment 4 Andrius Benokraitis 2009-03-26 15:04:06 UTC
Jim - this is now late per PeterM's comment - what's the status?

Comment 5 Jim Paradis 2009-03-27 17:59:58 UTC
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 18:15:03 UTC
I'm assuming this follow-on patch has been POSTed as well (not just the initial patch?)

Comment 8 Vivek Goyal 2009-03-31 15:44:20 UTC
Committed in 86.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/

Comment 10 Chris Ward 2009-04-09 07:43:50 UTC
~~ 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 09:57:33 UTC
Jim, could you please provide additional details regarding Status's verification results?

Comment 12 Andrius Benokraitis 2009-04-15 22:25:02 UTC
The patch in this BZ has caused a regression. Please post a patch ASAP.

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

 #ifdef CONFIG_HOTPLUG
+	mutex_unlock(&input_mutex);
 	input_call_hotplug("remove", dev);
+	mutex_lock(&input_mutex);
 #endif
 	mutex_lock(&input_mutex);

Comment 13 Andrius Benokraitis 2009-04-16 19:42:52 UTC
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 12:27:03 UTC
Commits 2e15431e2b263e57b39db872f0431e2aaedd239a (incremental patch) and 6081c416296fd779c2211df4a31bce514aa9a7d2 need to be reverted.

P.

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

Changelog.

-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.
--------------
6081c416296fd779c2211df4a31bce514aa9a7d2
2e15431e2b263e57b39db872f0431e2aaedd239a

Comment 20 Andrius Benokraitis 2009-04-22 17:26:08 UTC

*** 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.