Re: [PATCH] btrfs-progs: inspect: make sure LOGICAL_INO_V2 args are zero-initialized

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

 



On Thu, Jan 30, 2020 at 09:08:23PM -0500, Zygo Blaxell wrote:
> LOGICAL_INO v1 ignored the reserved fields, so they could be filled
> with random stack garbage and have no effect.  LOGICAL_INO_V2 requires
> all unused reserved bits to be set to zero, and returns EINVAL if they
> are not, to guard against future kernel versions which may interpret
> non-zero bit values.
> 
> Sometimes when 'btrfs ins log' runs, the stack garbage is zeros, so the
> -o (ignore offsets) option for logical-resolve works.  Sometimes the
> stack garbage is something else, and 'btrfs ins log -o' fails with
> invalid argument.  This depends mostly on compiler version and build
> environment details, so a binary typically either always works or never
> works.
> 
> Fix by initializing logical-resolve's argument structure with a C99
> compound literal zero.
> 
> Signed-off-by: Zygo Blaxell <ce3g8jdj@xxxxxxxxxxxxxxxxxxxxx>

Added to devel, thanks.



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux