From: Oliver Neukum <oneukum@suse.com>
To: "Bjørn Mork" <bjorn@mork.no>, "Oliver Neukum" <oneukum@suse.com>
Cc: Ren Mingshuai <renmingshuai@huawei.com>,
kuba@kernel.org, caowangbao@huawei.com, davem@davemloft.net,
khlebnikov@openvz.org, liaichun@huawei.com,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
yanan@huawei.com
Subject: Re: [PATCH] net: usbnet: Fix potential NULL pointer dereference
Date: Mon, 6 Nov 2023 13:53:12 +0100 [thread overview]
Message-ID: <0ed0f964-f8c8-4776-a2ae-ca25071bd0cd@suse.com> (raw)
In-Reply-To: <871qd3up56.fsf@miraculix.mork.no>
On 06.11.23 11:55, Bjørn Mork wrote:
> I believe that code is based on the (safe?) assumption that the struct
> usbnet driver_info->tx_fixup points to cdc_ncm_tx_fixup(). And
That seems to be a correct assumption, but one that is far from obvious.
Could you add a big, fat comment?
> cdc_ncm_tx_fixup does lots of weird stuff, including special handling of
> NULL skb. It might return a valid skb for further processing by
> usbnet_start_xmit(). If it doesn't, then we jump straight to
> "not_drop", like we do when cdc_ncm_tx_fixup decides to eat the passed
> skb.
>
> But "funky" is i precise description of all this... If someone feels
> like it, then all that open coded skb queing inside cdc_ncm should be
> completely rewritten.
I understand what you mean, but I need a generic answer. Can you call
ndo_start_xmit() with skb == NULL?
Regards
Oliver
next prev parent reply other threads:[~2023-11-06 12:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-01 12:35 Ren Mingshuai
2023-11-01 12:55 ` Ren Mingshuai
2023-11-02 4:38 ` Jakub Kicinski
2023-11-02 9:06 ` Ren Mingshuai
2023-11-06 10:18 ` Oliver Neukum
2023-11-06 10:55 ` Bjørn Mork
2023-11-06 12:53 ` Oliver Neukum [this message]
2023-11-06 12:59 ` Oliver Neukum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0ed0f964-f8c8-4776-a2ae-ca25071bd0cd@suse.com \
--to=oneukum@suse.com \
--cc=bjorn@mork.no \
--cc=caowangbao@huawei.com \
--cc=davem@davemloft.net \
--cc=khlebnikov@openvz.org \
--cc=kuba@kernel.org \
--cc=liaichun@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=renmingshuai@huawei.com \
--cc=yanan@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®