Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Ibrahim Hashimov <security@auditcode.ai>
To: bvanassche@acm.org
Cc: dlemoal@kernel.org, martin.petersen@oracle.com,
	James.Bottomley@HansenPartnership.com,
	shinichiro.kawasaki@wdc.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] scsi: scsi_debug: fix REPORT ZONES alloc_len underflow OOB write
Date: Sun, 12 Jul 2026 20:36:29 +0200	[thread overview]
Message-ID: <20260712183629.83851-1-security@auditcode.ai> (raw)
In-Reply-To: <512639c6-3f18-4577-bc4f-7aa8b7e1caf4@acm.org>

On 7/10/26, Bart Van Assche wrote:
> Ibrahim, do you plan to address this finding?

Yes -- addressed in v4, which I will send shortly. The v3 ALIGN() can
round an alloc_len near U32_MAX up to 0x100000000, and on 32-bit that
4 GB arr_len truncates to 0 in kzalloc()'s size_t, returning
ZERO_SIZE_PTR and slipping past the !arr check as the bot noted.

v4 clamps rep_max_zones to devip->nr_zones, so arr_len is bounded by
the real zone count and can never reach 0x100000000 or truncate on
32-bit. The descriptor loop already stops at sdebug_capacity, so the
clamp does not change any report -- it is purely an additive bound, and
Damien's ALIGN sizing is untouched.

Thanks for catching the 32-bit corner.

Ibrahim

  reply	other threads:[~2026-07-12 18:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 15:06 [PATCH] scsi: scsi_debug: fix REPORT ZONES alloc_len underflow OOB write Ibrahim Hashimov
2026-07-09 15:18 ` sashiko-bot
2026-07-09 19:48 ` [PATCH v2] " Ibrahim Hashimov
2026-07-10  0:58   ` Damien Le Moal
2026-07-10  5:57     ` [PATCH v3] " Ibrahim Hashimov
2026-07-10  6:03       ` Damien Le Moal
2026-07-10  6:05       ` sashiko-bot
2026-07-10 14:37         ` Bart Van Assche
2026-07-12 18:36           ` Ibrahim Hashimov [this message]
2026-07-12 18:37       ` [PATCH v4] " Ibrahim Hashimov
2026-07-13  5:43         ` Damien Le Moal
2026-07-13 17:12         ` Bart Van Assche
2026-07-10  5:59     ` [PATCH v2] " Ibrahim Hashimov

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=20260712183629.83851-1-security@auditcode.ai \
    --to=security@auditcode.ai \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=bvanassche@acm.org \
    --cc=dlemoal@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=shinichiro.kawasaki@wdc.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