Check list_head->next/prev for NULL in __list_del_entry_valid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steve, all,

I am trying to track down a NULL deref that happens during cifs_reconnect().
I don't have the root cause yet but I can mitigate the issue slightly by adding
NULL checks in the list_debug code and avoid the bug I am chasing from
causing a NULL deref to to just become a harmless run-time check.

This is not a fix for the underlying bug, I have yet for find it, but it
will avoif the debugging code from making things worse by causing a crash.

During cifs_reconnect() we are calling
                list_del_init(&mid_entry->qhead);

at this point entry->prev->next is equal to entry and all is good,
but entry->next is NULL which causes the crash in
list_debug.c:__list_del_entry_valid() :
            CHECK_DATA_CORRUPTION(next->prev != entry,

Since __list_del_entry_valid() is used to check that the pointers are all
valid, I think is is acceptable to also add NULL checks here as NULL
is a common value for invalid pointers.


--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux