Re: [PATCH] exec: remove comparision of variable i_size of type loff_t against SIZE_MAX

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

 





On 2020-02-27 3:40 p.m., Al Viro wrote:
On Thu, Feb 27, 2020 at 03:31:33PM -0800, Scott Branden wrote:
Remove comparision of (i_size > SIZE_MAX).
i_size is of type loff_t and can not be great than SIZE_MAX (~(size_t)0).
include/linux/types.h:46:typedef __kernel_loff_t                loff_t;
include/uapi/asm-generic/posix_types.h:88:typedef long long     __kernel_loff_t;

And boxen with size_t smaller than long long do exist.  Anything
32bit will qualify.  Pick any such and check that yourself...
Thanks for the immediate responses.  I'm glad I sent this patch out to understand the check is as such. Is there some attribute we can add so such issues are not reported against static analysis tools such as coverity?



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux