Bug 8341 - srmcons_get_private_struct() calls kmalloc(GFP_KERNEL) while a spinlock is held
Summary: srmcons_get_private_struct() calls kmalloc(GFP_KERNEL) while a spinlock is held
Status: RESOLVED CODE_FIX
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: Alpha (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Richard Henderson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-16 14:25 UTC by Matthias Kaehlcke
Modified: 2012-02-01 16:05 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.20
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Matthias Kaehlcke 2007-04-16 14:25:56 UTC
Problem Description:

srmcons_get_private_struct() in arch/alpha/kernel/srmcons.c calls
kmalloc(GFP_KERNEL) while the spinlock srmconsp_lock is held. this should not be
done as kmalloc(GFP_KERNEL) might sleep

as srmcons_get_private_struct() is only called from srmcons_open() and never
from interrupt context i think the right thing would be using a mutex instead of
a spinlock
Comment 1 Andrew Morton 2007-04-20 14:36:57 UTC
I queued a fix, thanks.
Comment 2 Jiri Slaby 2012-02-01 16:05:20 UTC
(In reply to comment #1)
> I queued a fix, thanks.

Hrm, that made the race there worse ;). (srmconsp is static)

This happened almost 5 years ago. I wonder if anybody uses that driver at all? 

Matthias do you or did you use some static analysis?

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