mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "Ranganath V N" <vnranganath.20@gmail.com>,
	"Dave Täht" <dave.taht@bufferbloat.net>,
	"John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	 skhan@linuxfoundation.org, david.hunter.linux@gmail.com,
	khalid@kernel.org,
	syzbot+878ddc3962f792e9af59@syzkaller.appspotmail.com
Subject: Re: [PATCH v2] wifi: cfg80211: Fix uninitialized header access in cfg80211_classify8021d
Date: Mon, 10 Nov 2025 10:28:23 +0100	[thread overview]
Message-ID: <f3a9797eb23d9c26007652798f14b76330aa1933.camel@sipsolutions.net> (raw)
In-Reply-To: <20251108-fifth-v2-1-405da01c6684@gmail.com> (sfid-20251107_193312_898584_A71B4CAD)

On Sat, 2025-11-08 at 00:03 +0530, Ranganath V N wrote:
> 
> +++ b/net/wireless/util.c
> @@ -963,9 +963,13 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb,
>  
>  	switch (skb->protocol) {
>  	case htons(ETH_P_IP):
> +		if (!pskb_may_pull(skb, sizeof(struct iphdr)))
> +			return 0;
>  		dscp = ipv4_get_dsfield(ip_hdr(skb)) & 0xfc;
>  		break;

That doesn't seem correct to me, passing only the IP header length to
pskb_may_pull() call assumes that ip_hdr(skb) == sbk->data, which is
almost certainly not true?

MPLS seems to not have this problem.

And maybe there's a similar issue for the VLAN tag?

johannes

  reply	other threads:[~2025-11-10  9:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 18:33 Ranganath V N
2025-11-10  9:28 ` Johannes Berg [this message]
2025-11-11 18:29   ` Ranganath V N

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=f3a9797eb23d9c26007652798f14b76330aa1933.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=dave.taht@bufferbloat.net \
    --cc=david.hunter.linux@gmail.com \
    --cc=khalid@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=skhan@linuxfoundation.org \
    --cc=syzbot+878ddc3962f792e9af59@syzkaller.appspotmail.com \
    --cc=vnranganath.20@gmail.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®