Re: [PATCH] btrfs: fix int32 overflow in shrink_delalloc().

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

 



On Sun, May 08, 2016 at 03:08:00PM +0200, Adam Borowski wrote:
> UBSAN: Undefined behaviour in fs/btrfs/extent-tree.c:4623:21
> signed integer overflow:
> 10808 * 262144 cannot be represented in type 'int [8]'
> 
> If 8192<=items<16384, we request a writeback of an insane number of pages
> which is benign (everything will be written).  But if items>=16384, the
> space reservation won't be enough.
> 
> Signed-off-by: Adam Borowski <kilobyte@xxxxxxxxxx>

Reviewed-by: David Sterba <dsterba@xxxxxxxx>

I think this is the best fix, although I usually do not like to see
random type casts. In this case, we'd have to change items to something
else and propagate the change trhough several functions for no apparent
gain.  Just to satisfy one multiplication.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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