Linux-SCSI Archive on
 help / color / Atom feed
From: Bart Van Assche <>
To: zhengbin <>,,,
Subject: Re: [PATCH] scsi: core: fix uninit-value access of variable sshdr
Date: Fri, 11 Oct 2019 10:17:54 -0700
Message-ID: <> (raw)
In-Reply-To: <>

On 10/10/19 5:05 AM, zhengbin wrote:
> +	/*
> +	 * need to initial sshdr to avoid uninit-value access
> +	 */
> +	if (sshdr)
> +		memset(sshdr, 0, sizeof(struct scsi_sense_hdr));
> +

I think the above comment is slightly confusing because it is correct 
for some callers but not for all callers of scsi_execute(). How about 
changing the comment into something like the following: "Zero-initialize 
sshdr for those callers that check the *sshdr contents even if no sense 
data is available"?



      parent reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 12:05 zhengbin
2019-10-10 17:03 ` Bart Van Assche
2019-10-11  3:07   ` zhengbin (A)
2019-10-11 17:15     ` Bart Van Assche
2019-10-11 17:17 ` Bart Van Assche [this message]

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-SCSI Archive on

Archives are clonable:
	git clone --mirror linux-scsi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-scsi linux-scsi/ \
	public-inbox-index linux-scsi

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox