Marin Ramesa, le Tue 19 Nov 2013 07:34:22 +0100, a écrit : > Check is active_threads is NULL before calling current_task() to > avoid dereference of null pointer.
Ah, the vm_stat_sample tracing macro is extra careful about current_thread(), probably because it may be called very early during boot, but current_thread() really is always non-NULL when vm_fault_page is called. > * vm/vm_fault.c (active_threads): Check if it's NULL. > > --- > vm/vm_fault.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/vm/vm_fault.c b/vm/vm_fault.c > index 4b30f98..1089491 100644 > --- a/vm/vm_fault.c > +++ b/vm/vm_fault.c > @@ -249,7 +249,8 @@ vm_fault_return_t vm_fault_page(first_object, > first_offset, > > vm_stat_sample(SAMPLED_PC_VM_FAULTS_ANY); > vm_stat.faults++; /* needs lock XXX */ > - current_task()->faults++; > + if (active_threads[(0)] != NULL) > + current_task()->faults++; > > /* > * Recovery actions > -- > 1.8.1.4 > > -- Samuel "...Deep Hack Mode--that mysterious and frightening state of consciousness where Mortal Users fear to tread." (By Matt Welsh)