public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: coverity-bot <keescook@chromium.org>
To: Edward Cree <ecree.xilinx@gmail.com>
Cc: linux-kernel@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Martin Habets <habetsm.xilinx@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Coverity: efx_tc_rx(): Memory - illegal accesses
Date: Thu, 17 Nov 2022 14:17:15 -0800	[thread overview]
Message-ID: <202211171416.0BC0EDDA36@keescook> (raw)

Hello!

This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20221117 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan

You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:

  Wed Nov 16 09:07:02 2022 +0000
    25730d8be5d8 ("sfc: add extra RX channel to receive MAE counter updates on ef100")

Coverity reported the following:

*** CID 1527356:  Memory - illegal accesses  (OVERRUN)
drivers/net/ethernet/sfc/tc_counters.c:483 in efx_tc_rx()
477     	}
478
479     	/* Update seen_gen unconditionally, to avoid a missed wakeup if
480     	 * we race with efx_mae_stop_counters().
481     	 */
482     	efx->tc->seen_gen[type] = mark;
vvv     CID 1527356:  Memory - illegal accesses  (OVERRUN)
vvv     Overrunning array "efx->tc->flush_gen" of 3 4-byte elements at element index 3 (byte offset 15) using index "type" (which evaluates to 3).
483     	if (efx->tc->flush_counters &&
484     	    (s32)(efx->tc->flush_gen[type] - mark) <= 0)
485     		wake_up(&efx->tc->flush_wq);
486     out:
487     	efx_free_rx_buffers(rx_queue, rx_buf, 1);
488     	channel->rx_pkt_n_frags = 0;

If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527356 ("Memory - illegal accesses")
Fixes: 25730d8be5d8 ("sfc: add extra RX channel to receive MAE counter updates on ef100")

AFAICT, efx_tc_rx_version_2() may return EFX_TC_COUNTER_TYPE_MAX.

Thanks for your attention!

-- 
Coverity-bot

                 reply	other threads:[~2022-11-17 22:17 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=202211171416.0BC0EDDA36@keescook \
    --to=keescook@chromium.org \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=gustavo@embeddedor.com \
    --cc=habetsm.xilinx@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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