public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Jakub Kicinski" <kuba@kernel.org>, "Arnd Bergmann" <arnd@kernel.org>
Cc: "Jeff Garzik" <jeff@garzik.org>,
	bhelgaas@google.com, "David S . Miller" <davem@davemloft.net>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Lukas Wunner" <lukas@wunner.de>,
	linux-kernel@vger.kernel.org, andrew+netdev@lunn.ch,
	giovanni.cabiddu@intel.com, Netdev <netdev@vger.kernel.org>,
	gallatin@myri.com, brice@myri.com,
	"Ingo Molnar" <mingo@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Eric Dumazet" <edumazet@google.com>
Subject: Re: [2/2,v3] myri10ge: avoid uninitialized variable use
Date: Thu, 05 Feb 2026 17:30:20 +0100	[thread overview]
Message-ID: <e561be10-ab09-41b6-8326-773ece90ac32@app.fastmail.com> (raw)
In-Reply-To: <20260205045743.2412516-1-kuba@kernel.org>

On Thu, Feb 5, 2026, at 05:57, Jakub Kicinski wrote:
>> @@ -2238,6 +2250,8 @@ static int myri10ge_get_txrx(struct myri10ge_priv *mgp, int slice)
>>  	status = 0;
>>  	if (slice == 0 || (mgp->dev->real_num_tx_queues > 1)) {
>>  		cmd.data0 = slice;
>> +		cmd.data1 = 0;
>> +		cmd.data2 = 0;
>>  		status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SEND_OFFSET,
>>  					   &cmd, 0);
>>  		ss->tx.lanai = (struct mcp_kreq_ether_send __iomem *)
>>  			    (mgp->sram + cmd.data0);
>>  	}
>>  	cmd.data0 = slice;
>>  	status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SMALL_RX_OFFSET,
>>  				    &cmd, 0);
>
> The initialization of cmd.data1 and cmd.data2 is inside the conditional
> block. When slice > 0 and real_num_tx_queues <= 1, does the subsequent
> myri10ge_send_cmd() call for MXGEFW_CMD_GET_SMALL_RX_OFFSET use
> uninitialized data1/data2 values?
>
> Simon Horman pointed this out in his review of v2:
> https://lore.kernel.org/all/20250622162715.GA297140@horms.kernel.org/
>
> He provided a diff showing that the second cmd.data0 = slice assignment
> also needs cmd.data1 and cmd.data2 initialization. This feedback does
> not appear to have been addressed in v3.

Indeed, I thought I had addressed this, but somehow ended up
rebasing to an older version of my original patch. Sent v4 now.

     Arnd

      reply	other threads:[~2026-02-05 16:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03 23:04 [PATCH 1/2] myri10ge: avoid passing uninitialized data to inline asm Arnd Bergmann
2026-02-03 23:04 ` [PATCH 2/2] [v3] myri10ge: avoid uninitialized variable use Arnd Bergmann
2026-02-05  4:57   ` [2/2,v3] " Jakub Kicinski
2026-02-05 16:30     ` Arnd Bergmann [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=e561be10-ab09-41b6-8326-773ece90ac32@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=arnd@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=brice@myri.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gallatin@myri.com \
    --cc=giovanni.cabiddu@intel.com \
    --cc=jeff@garzik.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mingo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tglx@kernel.org \
    /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