Thread (1 message) 1 message, 1 author, 2013-06-20

Fwd: [PATCH] net bridge: add null pointer check, fix panic

From: xiaoming gao <hidden>
Date: 2013-06-20 06:53:44
Also in: bridge

HI Eric
the problem is as follow:
br_del_if()-->del_nbp():

list_del_rcu(&p->list);
dev->priv_flags &= ~IFF_BRIDGE_PORT;

------>at this point, the nic be deleting still have rx_handler , so , may
in br_handle_frame()
------>br_port_exists() will return false,so br_get_port_rcu() will return
NULL
------>so in br_handle_frame , there will be a null panic.

netdev_rx_handler_unregister(dev);
synchronize_net();


i have checked commit 00cfec37484761a44, i think it didn't fix this bug..

thanks.




On Thu, Jun 20, 2013 at 12:55 PM, Eric Dumazet [off-list ref]wrote:
On Thu, 2013-06-20 at 11:08 +0800, xiaoming gao wrote:
quoted
From: newtongao <redacted>
Date: Wed, 19 Jun 2013 14:58:33 +0800
Subject: [PATCH] net bridge: add null pointer check,fix panic

in kernel 3.0, br_port_get_rcu() may return NULL when network interface
be deleting from bridge,
quoted
but in function br_handle_frame and br_handle_local_finish, the pointer
didn't be checked before using,
quoted
so all br_port_get_rcu callers must do null check,or there occurs the
null pointer panic.
quoted
kernel 3.4 also has this bug,i have verified.
mainline kernel still did not  check br_port_get_rcu()'s NULL pointer,
but i have not tested it yet.

Please check current version before sending a patch.

This was most probably fixed in commit 00cfec37484761a44
("net: add a synchronize_net() in netdev_rx_handler_unregister()")

Thanks

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help