public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ramesh Adhikari <adhikari.resume@gmail.com>, gregkh@linuxfoundation.org
Cc: linux-block@vger.kernel.org, security@kernel.org
Subject: Re: [PATCH v3] block: fix infinite loop in badblocks_clear() and badblocks_check()
Date: Sun, 26 Apr 2026 11:30:12 -0600	[thread overview]
Message-ID: <b18b61b7-36d6-441b-a666-e38a5e57b37f@kernel.dk> (raw)
In-Reply-To: <20260426172641.629158-1-adhikari.resume@gmail.com>

On 4/26/26 11:26 AM, Ramesh Adhikari wrote:
> An infinite loop can occur in both _badblocks_clear() and _badblocks_check()
> when BB_OFFSET() equals the start position, resulting in len = 0. This causes
> the update_sectors loop to spin forever without making progress:
> 
>     s += 0;         // no advancement
>     sectors -= 0;   // stays positive
>     goto re_clear;  // infinite loop
> 
> The bug exists in three code paths:
> 1. _badblocks_clear() at line 1100 (start before all badblocks)
> 2. _badblocks_clear() at line 1153 (behind overlap check)
> 3. _badblocks_check() at line 1240 (behind overlap check)

1) please calm down with the repostings
2) sit back, actually take your time, and find all the spots. this
drive-by-development is not useful.

-- 
Jens Axboe


      reply	other threads:[~2026-04-26 17:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-26 14:55 [PATCH] block: fix infinite loop in badblocks_clear() Ramesh Adhikari
2026-04-26 17:11 ` [PATCH v2] " Ramesh Adhikari
2026-04-26 17:26 ` [PATCH v3] block: fix infinite loop in badblocks_clear() and badblocks_check() Ramesh Adhikari
2026-04-26 17:30   ` 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=b18b61b7-36d6-441b-a666-e38a5e57b37f@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=adhikari.resume@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-block@vger.kernel.org \
    --cc=security@kernel.org \
    /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