Re: [PATCH v3 08/15] e2fsck: add fast commit setup code

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

 



On Wed, Jan 20, 2021 at 01:26:34PM -0800, Harshad Shirwadkar wrote:
> diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h
> index fdcb28f6..eb2e6549 100644
> --- a/lib/ext2fs/ext2fs.h
> +++ b/lib/ext2fs/ext2fs.h
> @@ -2148,4 +2148,7 @@ static inline unsigned int ext2_dir_htree_level(ext2_filsys fs)
>  }
>  #endif
>  
> +/* Commonly used helpers */
> +#define max(a, b) ((a) > (b) ? (a) : (b))
> +
>  #endif /* _EXT2FS_EXT2FS_H */

It's better not to add this to a publically exported file, such as
lib/ext2fs/ext2fs.h, since it may conflict with other userspace
application which may define their own max file.

Something which we might want to do is to add something like
linux/minmax.h from the kernel sources to libsupport.  This defines a
max() macro which does paranoid typechecking to make sure we don't
accidentally compare an unsigned int to an signed int, which can
potential security problems with maliciously fuzzed file system
images.  :-)

						- Ted



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux