mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: YueHaibing <yuehaibing@huawei.com>,
	gregkh@linuxfoundation.org, wlanfae@realtek.com,
	Larry.Finger@lwfinger.net, mikem@ring3k.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()
Date: Wed, 23 Nov 2022 22:26:52 +0100	[thread overview]
Message-ID: <37f3b74d-2354-66c4-1ebb-3e1cefd2ba19@gmail.com> (raw)
In-Reply-To: <20221123081253.22296-1-yuehaibing@huawei.com>

On 11/23/22 09:12, YueHaibing wrote:
> The skb is delivered to netif_rx() in rtllib_monitor_rx(), which may free it,
> after calling this, dereferencing skb may trigger use-after-free.
> Found by Smatch.
> 
> Fixes: 94a799425eee ("From: wlanfae <wlanfae@realtek.com> [PATCH 1/8] rtl8192e: Import new version of driver from realtek")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>   drivers/staging/rtl8192e/rtllib_rx.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
> index 6a0f5bbb99ef..f8965afab767 100644
> --- a/drivers/staging/rtl8192e/rtllib_rx.c
> +++ b/drivers/staging/rtl8192e/rtllib_rx.c
> @@ -1489,9 +1489,9 @@ static int rtllib_rx_Monitor(struct rtllib_device *ieee, struct sk_buff *skb,
>   		hdrlen += 4;
>   	}
>   
> -	rtllib_monitor_rx(ieee, skb, rx_stats, hdrlen);
>   	ieee->stats.rx_packets++;
>   	ieee->stats.rx_bytes += skb->len;
> +	rtllib_monitor_rx(ieee, skb, rx_stats, hdrlen);
>   
>   	return 1;
>   }

I was able to set the driver to Monitor mode but I did not get any 
information from it. I think this happens due to the missing support for 
nl80211. Please give me a hint how to do this.

Thanks for your support.

Bye Philipp

      reply	other threads:[~2022-11-23 21:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23  8:12 YueHaibing
2022-11-23 21:26 ` Philipp Hortmann [this message]

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=37f3b74d-2354-66c4-1ebb-3e1cefd2ba19@gmail.com \
    --to=philipp.g.hortmann@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mikem@ring3k.org \
    --cc=wlanfae@realtek.com \
    --cc=yuehaibing@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®