dcb: use after free in dcb_flushapp()
Subsystems (3)
PATCH 2/2 dcb: use after free in dcb_flushapp()
The original code has a use after free bug because it's not using the _safe() version of the list_for_each_entry() macro.
Signed-off-by Dan Carpenter <[email protected]>
net/dcb/dcbnl.c +2 -1
@@ -1650,9 +1650,10 @@ EXPORT_SYMBOL(dcb_setapp);static void dcb_flushapp (void ) {struct dcb_app_type *app; +struct dcb_app_type *tmp;spin_lock (&dcb_lock); -list_for_each_entry (app, &dcb_app_list, list) { +list_for_each_entry_safe (app, tmp, &dcb_app_list, list) {list_del (&app->list);kfree (app); }
David Miller
maintainerFrom: Dan Carpenter <[email protected]>
Date: Wed, 5 Jan 2011 10:03:44 +0300
Quoted 4 lines
The original code has a use after free bug because it's not using the
_safe()version of thelist_for_each_entry()macro.Signed-off-by Dan Carpenter <[email protected]>
Also applied.