Re: [PATCH] block: set bi_vcnt when cloning bio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 15, 2025 at 11:58:15AM +0100, Andreas Hindborg wrote:
> When cloning a bio, the `bio.bi_vcnt` field is not cloned. This is a
> problem if users want to perform bounds checks on the `bio.bi_io_vec`
> field.

Right now bi_vcnt is supposed to be an implementation detail for
bio_add_*, which obviously can't be called on cloned bio. Except for the
usual abuse in bcache/bcachefs that has mostly kept up except for a few
read-only checks in the completion routines which also can't be called
on cloned bios.

It would be nice to use it as a __counted_by bound for bi_io_vec, but
until that is supported on pointers in addition to the flexible arrays
we can't actually do that.  So as-is I don't really see a point in
just assigning the value if we don't actually use it.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux