Linux Device Mapper development
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Xose Vazquez Perez <xose.vazquez@gmail.com>
Cc: Martin Wilck <mwilck@suse.com>,
	Christophe Varoqui <christophe.varoqui@opensvc.com>,
	DM_DEVEL-ML <dm-devel@lists.linux.dev>
Subject: Re: [BUG] multipath-tools: 0 cyl reported on large disks due to overflow
Date: Tue, 26 May 2026 15:28:06 -0400	[thread overview]
Message-ID: <ahX0RqXAVsKWUIGN@redhat.com> (raw)
In-Reply-To: <02a2bb69-c13d-43bb-bbed-2a1bd3007ba4@gmail.com>

On Fri, May 22, 2026 at 11:10:36PM +0200, Xose Vazquez Perez wrote:
> Hi,
> 
> An integer overflow occurs in libmultipath/discovery.c:get_geometry() when
> querying geometry on large disks resulting in "0 cyl" being reported:
> 
> # multipath -ll -d -v3
> ... | sdgm: 0 cyl, 64 heads, 32 sectors/track, start at 0
> 
> # fdisk -l /dev/sdgm
> Disk /dev/sdgm: 12 TiB, 13194139533312 bytes, 25769803776 sectors
> Units: sectors of 1 * 512 = 512 bytes
> 
> # dmesg | grep sdgm
> sd 5:0:3:100: [sdgm] 25769803776 512-byte logical blocks: (13.2 TB/12.0TiB)
> 
> 
> The root cause is that struct hd_geometry, from libmultipath/structs.h,
> defines cylinders as an unsigned short.
> 
> Since it is a legacy interface, it should either sanitize the log output
> or avoid relying on CHS geometry for large devices.

I'm totally fine with never reporting the geometry info or moving it to
log level 4 (since there can be value to even pointless debugging
messages. They can show you where you made it to if you happned to hang
in a function)

But I don't personally have a problem with multipath simply passing
along the geometry data it gets from the disk. Sure, it may be garbage,
but then DM's garbage matches the disk's garbage. I highly doubt that
anything actually cares what geometry a DM device reports. But I don't
see any benefit to changing what it currently does.

Thoughts?
-Ben 


  reply	other threads:[~2026-05-26 19:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22 21:10 [BUG] multipath-tools: 0 cyl reported on large disks due to overflow Xose Vazquez Perez
2026-05-26 19:28 ` Benjamin Marzinski [this message]
2026-06-05 14:17   ` Martin Wilck

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=ahX0RqXAVsKWUIGN@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=mwilck@suse.com \
    --cc=xose.vazquez@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