mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Sam Sun <samsun1006219@gmail.com>,
	linux-kernel@vger.kernel.org, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, xrivendell7@gmail.com,
	syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] drivers: scsi: fix shift-out-of-bounds in sg_build_indirect
Date: Mon, 15 Apr 2024 10:26:26 -0700	[thread overview]
Message-ID: <48043100-a817-4ca2-a141-60e3ab9cbfef@acm.org> (raw)
In-Reply-To: <CAEkJfYNguDt47=KnEUX7tLwx_46ggBx3Oh3-3dAcZxqndL_OWQ@mail.gmail.com>

On 4/14/24 20:14, Sam Sun wrote:
> -    num = scatter_elem_sz;
> +    num = max(scatter_elem_sz, PAGE_SIZE);

Shouldn't the following statements be modified instead of the above
statement? I think these are the only statements that can cause
scatter_elem_sz to become smaller than PAGE_SIZE:

	scatter_elem_sz = ret_sz;
	scatter_elem_sz_prev = ret_sz;

Thanks,

Bart.

  reply	other threads:[~2024-04-15 17:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15  3:14 Sam Sun
2024-04-15 17:26 ` Bart Van Assche [this message]
2024-04-16  6:32   ` Sam Sun

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=48043100-a817-4ca2-a141-60e3ab9cbfef@acm.org \
    --to=bvanassche@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=samsun1006219@gmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=xrivendell7@gmail.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

all inboxes | Powered by JetHome®