Skip to contentSkip to conversation

Locking question, is this cool?

DISCUSSION George Anzinger 2 participants 3 messages Oct 31, 2000

lore
Share & tools
lore
#0 lore raw

At line 1073 of ../drivers/char/i2lib.c (2.4.0-test9) we find:

WRITE_LOCK_IRQSAVE(...

this is followed by:

COPY_FROM_USER(...

It seems to me that this could result in a page fault with interrupts off. Is this ok?

George
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 10 lines

At line 1073 of ../drivers/char/i2lib.c (2.4.0-test9) we find:

WRITE_LOCK_IRQSAVE(...

this is followed by:

COPY_FROM_USER(...

It seems to me that this could result in a page fault with interrupts off. Is this ok?

It wont do what you want - it'll re-enable irqs and may then deadlock. It might need to copy the buffer to a temporary space then take the lock > -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 7 lines · Alan Cox
Quoted 7 lines

At line 1073 of ../drivers/char/i2lib.c (2.4.0-test9) we find:

WRITE_LOCK_IRQSAVE(...

this is followed by:

Quoted 8 lines
Quoted 4 lines

COPY_FROM_USER(...

It seems to me that this could result in a page fault with interrupts off. Is this ok?

It wont do what you want - it'll re-enable irqs and may then deadlock. It might need to copy the buffer to a temporary space then take the lock > -

I suspected as much. I see the same error (bug?) at line 978 of ../drivers/char/riotty.c

Seems like a common problem.

george
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/