Thread (2 messages) flat view 2 messages, 2 authors, 2015-08-20

Re: [PATCH] usbnet: dereference after null check in usbnet_start_xmit() and __usbnet_read_cmd()

From: Bjørn Mork <bjorn@mork.no>
Date: 2015-08-20 07:29:20

Vivek Kumar Bhagat [off-list ref] writes:
Dear Bjorn,
quoted
quoted
This is wrong.  There are usbnet minidrivers depending on info->tx_fixup
being called with a NULL skb.
Also, if dev_hard_start_xmit() ensures that skb can not be NULL in usbnet_start_xmit()
then we should remove below check.
    if (skb)      <--- This check is confusing which says skb can be NULL.
                skb_tx_timestamp(skb); 

No, that test is there because of the ugly hack in cdc_ncm.  It doesn't
go through dev_hard_start_xmit(), but calls usbnet_start_xmit() directly
with a NULL skb as a signal to itself.  Yes, I told you it was ugly ;)

I do agree that it would be nice to make this go away.  But until that
happens usbnet_start_xmit() has to deal with NULL skbs, forwarding them
to the tx_fixup hook.


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