lkml.org 
[lkml]   [1999]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Ok, making ready for pre-2.4 and code-freeze..yd
Date
On Wed, 15 Dec 1999 07:53:43 -0500 (EST), 
Alan Cox <alan@redhat.com> wrote:
>Anyuser can crash the code due to module races (eg open)
>
>rdtsc
>open /dev/somefile [loads module]
>close it
>rdtsc
>compute unload time
>at unload time open it again
>
>After enough goes the machine calls the open method of the driver as the
>driver is unloaded. The MOD_INC_USE_COUNT in foo_open is too late to stop
>disaster

Can this occur? sys_open() does

lock_kernel()
filp_open() -> module open code: does MOD_INC_USE_COUNT.
unlock_kernel()

sys_delete_module() does

lock_kernel()
Test module in use.
free_module()
unlock_kernel()

AFAICT, both the module open routine and the module unloading code run
under the big kernel lock, no races are possible.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.096 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site