Hi Alex, > Looking at current situation of memory management in 6lowpan receive > function I detected some invalid handling. After calling > lowpan_invoke_rx_handlers we will do a kfree_skb and then NET_RX_DROP on > error handling. We don't do this before, also on > skb_share_check/skb_unshare which might manipulate the reference > counters. > > After running some 'grep -r "dev_add_pack" net/' to look how others > packet-layer receive callbacks works I detected that every subsystem do > a kfree_skb, then NET_RX_DROP without calling skb functions which > might manipulate the skb reference counters. This is the reason why we > should do the same here like all others subsystems. I didn't find any > documentation how the packet-layer receive callbacks handle NET_RX_DROP > return values either. > > This patch will add a kfree_skb, then NET_RX_DROP handling for the > "trivial checks", in case of skb_share_check/skb_unshare the kfree_skb > call will be done inside these functions. > > Signed-off-by: Alexander Aring <alex.aring@xxxxxxxxx> > --- > References how other filesystem handle the callback: > > [0] http://lxr.free-electrons.com/source/net/ipx/af_ipx.c#L1638 > [1] http://lxr.free-electrons.com/source/net/can/af_can.c#L709 > [2] http://lxr.free-electrons.com/source/net/phonet/af_phonet.c#L371 > > net/ieee802154/6lowpan/rx.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel -- To unsubscribe from this list: send the line "unsubscribe linux-wpan" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html