linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Tuo <islituo@gmail.com>
To: stf_xl@wp.pl, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, baijiaju1990@gmail.com
Subject: [BUG] iwlegacy: 3945-rs: possible null-pointer dereference in il3945_rs_get_rate()
Date: Sat, 31 Jul 2021 11:39:53 +0800	[thread overview]
Message-ID: <c9663714-a352-7c5c-1826-c7a1cd6d9abf@gmail.com> (raw)

Hello,

Our static analysis tool finds a possible null-pointer dereference in 
the iwlegacy driver in Linux 5.14.0-rc3:

The variable rs_sta is checked in:
629:    if (rs_sta && !rs_sta->il)

This indicates that rs_sta can be NULL.
If so, some null-pointer dereferences will occur in some statements such as:
643:    idx = min(rs_sta->last_txrate_idx & 0xffff, RATE_COUNT_3945 - 1);
653:    if (rs_sta->start_rate != RATE_INVALID)

I am not quite sure whether this possible null-pointer dereference is 
real and how to fix it if it is real.
Any feedback would be appreciated, thanks!

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>

Best wishes,
Tuo Li

                 reply	other threads:[~2021-07-31  3:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=c9663714-a352-7c5c-1826-c7a1cd6d9abf@gmail.com \
    --to=islituo@gmail.com \
    --cc=baijiaju1990@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stf_xl@wp.pl \
    /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;
as well as URLs for NNTP newsgroup(s).