Linux block layer
 help / color / mirror / Atom feed
* [bug report] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git
@ 2026-09-21 19:18 Dan Carpenter
  2026-09-22  3:16 ` Damien Le Moal
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2026-09-21 19:18 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-block, ZHOU Jiaxiang, Damien Le Moal

Hello Mark Brown,

Commit a9ce2250a714 ("Merge branch 'for-next' of
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git")
from Sep 18, 2026 (linux-next), leads to the following Smatch static
checker warning:

	block/blk-zoned.c:2200 disk_init_revalidate_args()
	warn: impossible condition '(args->nr_zones > (~0)) => (0-u32max > u32max)'

block/blk-zoned.c
    2195 static int disk_init_revalidate_args(struct gendisk *disk,
    2196                                      struct blk_revalidate_zone_args *args)
    2197 {
    2198         args->disk = disk;
    2199         args->nr_zones = disk_get_nr_zones(disk, args->capacity);
--> 2200         if (args->nr_zones > UINT_MAX)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^

The linux-next merge for linux-block went a bit sideways and
commit 7c431d61b69a ("scsi: block: Fix zones_cond out-of-bounds write on
zone report") needs to be re-done.

    2201                 return -EINVAL;
    2202 
    2203         /* Cached zone conditions: 1 byte per zone */
    2204         args->zones_state = kzalloc(args->nr_zones, GFP_NOIO);
    2205         if (!args->zones_state)
    2206                 return -ENOMEM;
    2207 
    2208         return 0;
    2209 }

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git
  2026-09-21 19:18 [bug report] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git Dan Carpenter
@ 2026-09-22  3:16 ` Damien Le Moal
  0 siblings, 0 replies; 2+ messages in thread
From: Damien Le Moal @ 2026-09-22  3:16 UTC (permalink / raw)
  To: Dan Carpenter, Mark Brown; +Cc: linux-block, ZHOU Jiaxiang

On 9/22/26 04:18, Dan Carpenter wrote:
> Hello Mark Brown,
> 
> Commit a9ce2250a714 ("Merge branch 'for-next' of
> https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git")
> from Sep 18, 2026 (linux-next), leads to the following Smatch static
> checker warning:
> 
> 	block/blk-zoned.c:2200 disk_init_revalidate_args()
> 	warn: impossible condition '(args->nr_zones > (~0)) => (0-u32max > u32max)'
> 
> block/blk-zoned.c
>     2195 static int disk_init_revalidate_args(struct gendisk *disk,
>     2196                                      struct blk_revalidate_zone_args *args)
>     2197 {
>     2198         args->disk = disk;
>     2199         args->nr_zones = disk_get_nr_zones(disk, args->capacity);
> --> 2200         if (args->nr_zones > UINT_MAX)
>                      ^^^^^^^^^^^^^^^^^^^^^^^^^

This was fixed with an improved conflict resolution yesterday. Today's
linux-next does not have this anymore, so this should now be all good.

-- 
Damien Le Moal
Western Digital Research

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-22  3:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-21 19:18 [bug report] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git Dan Carpenter
2026-09-22  3:16 ` Damien Le Moal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox