[pkg-cryptsetup-devel] Bug#994056: cryptsetup: blkid check fails to take offset option into account
Guilhem Moulin
guilhem at debian.org
Fri Oct 8 17:05:35 BST 2021
On Fri, 08 Oct 2021 at 15:12:58 +0000, Thorsten Glaser wrote:
>>, so I completed your patch with 2373709bb461a71a7af46e7e9c59355fce63e52e.
>
> -blkid="$(/sbin/blkid -o value -s TYPE -p ${offset:+-O "$offset"} -- "$dev")"
> +blkid="$(/sbin/blkid -o value -s TYPE -p ${offset:+-O "$((offset*512))"} -- "$dev")"
>
> That’s only good for offset ≤ 4194303 though and invokes C “Undefined
> Behaviour” on larger values. (More on LP64 of course.)
Ah right, thanks. Given #-1 is a 12 years old bug and AFAICT you're the
first to report it I suppose nobody uses large offset= values. Don't
think adding ‘Depends: bc’ is justified here :-P.
Also in practice I was able to use offset=2⁵⁹ with bash, dash, klibc's
sh and busybox's sh on a stock 32 bytes platform, so I'll just ignore
the potential overflow. I'll just make the script choke when the
arithmetic operation fails.
--
Guilhem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-cryptsetup-devel/attachments/20211008/c36ff154/attachment.sig>
More information about the pkg-cryptsetup-devel
mailing list