Linux Hardening
 help / color / mirror / Atom feed
From: Finn Thain <fthain@linux-m68k.org>
To: Kees Cook <keescook@chromium.org>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	 Erick Archer <erick.archer@outlook.com>,
	 "James E.J. Bottomley" <jejb@linux.ibm.com>,
	 Bjorn Helgaas <bhelgaas@google.com>,
	Justin Stitt <justinstitt@google.com>,
	 "Gustavo A. R. Silva" <gustavoars@kernel.org>,
	linux-scsi@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3] scsi: csiostor: Use kcalloc() instead of kzalloc()
Date: Tue, 30 Apr 2024 11:54:27 +1000 (AEST)	[thread overview]
Message-ID: <070eccee-25c1-05ae-0ae8-7c6fe2eff82f@linux-m68k.org> (raw)
In-Reply-To: <202404291259.3A8EE11@keescook>


On Mon, 29 Apr 2024, Kees Cook wrote:

> this isn't a case where we can show identical binary output, since this 
> actively adds overflow checking via kcalloc() internals.
> 
> ...
> 
> it is a trivially correct change that uses a more robust API and more 
> idiomatic allocation sizeof()s

If a change is "trivially correct" then the proof is trivial too.

Based only on what you wrote above, omitting the overflow check would give 
binary equivalence. That validates the driver change (for hardware you 
lack).

But, since a build without the overflow check must contain a second 
change, you must validate that change too by showing that kcalloc() 
internals still work for every other caller. (You do this using hardware 
you have.)

  reply	other threads:[~2024-04-30  1:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-30 16:17 [PATCH v3] scsi: csiostor: Use kcalloc() instead of kzalloc() Erick Archer
2024-04-27 13:52 ` Erick Archer
2024-04-29 17:20 ` Kees Cook
2024-04-29 18:31   ` Martin K. Petersen
2024-04-29 20:13     ` Kees Cook
2024-04-30  1:54       ` Finn Thain [this message]
2024-05-01 14:39       ` James Bottomley
2024-05-02  0:47         ` Finn Thain
2024-05-11 11:18 ` Erick Archer
2024-05-11 15:10   ` Erick Archer

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=070eccee-25c1-05ae-0ae8-7c6fe2eff82f@linux-m68k.org \
    --to=fthain@linux-m68k.org \
    --cc=bhelgaas@google.com \
    --cc=erick.archer@outlook.com \
    --cc=gustavoars@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=justinstitt@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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