The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Sungwoo Kim <iam@sung-woo.kim>, Keith Busch <kbusch@kernel.org>
Cc: Chao Shi <cshi008@fiu.edu>, Weidong Zhu <weizhu@fiu.edu>,
	Dave Tian <daveti@purdue.edu>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] block: bio-integrity: Fix null-ptr-deref in bio_integrity_map_user()
Date: Thu, 7 May 2026 01:51:15 -0600	[thread overview]
Message-ID: <3f01f3b5-f57e-4e04-8a70-ac0722f243be@kernel.dk> (raw)
In-Reply-To: <20260427040926.987166-3-iam@sung-woo.kim>

> diff --git a/block/bio-integrity.c b/block/bio-integrity.c
> index e54c6e06e1cb..766cc2d1d51c 100644
> --- a/block/bio-integrity.c
> +++ b/block/bio-integrity.c
> @@ -403,6 +403,23 @@ int bio_integrity_map_user(struct bio *bio, struct iov_iter *iter)
>  	if (unlikely(ret < 0))
>  		goto free_bvec;
>  
> +	/* Handle partial pinning. This can happen when pin_user_pages_fast()
> +	 * returns fewer pages than requested
> +	 */

Please follow the multi-line comment style used in the code around you.

> +	if (user_backed_iter(iter) && unlikely(ret != bytes)) {
> +		if (0 < ret) {

And never do this, it's so much worse to read than if (ret > 0)

-- 
Jens Axboe

      parent reply	other threads:[~2026-05-07  7:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260427040926.987166-3-iam@sung-woo.kim>
     [not found] ` <afM2oyQTraSWa5vO@shinmob>
2026-05-07  7:01   ` [PATCH v4] block: bio-integrity: Fix null-ptr-deref in bio_integrity_map_user() Sungwoo Kim
2026-05-07  7:51 ` Jens Axboe [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=3f01f3b5-f57e-4e04-8a70-ac0722f243be@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=cshi008@fiu.edu \
    --cc=daveti@purdue.edu \
    --cc=iam@sung-woo.kim \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=weizhu@fiu.edu \
    /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