Re: [bug report] fs/ntfs3: integer overflow in ni_fiemap()

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

 



On Wed, Aug 25, 2021 at 11:33:40AM +0300, Kari Argillander wrote:
> On Wed, Aug 25, 2021 at 11:04:40AM +0300, Dan Carpenter wrote:
> > Hello Konstantin Komarov,
> > 
> > The patch 4342306f0f0d: "fs/ntfs3: Add file operations and
> > implementation" from Aug 13, 2021, leads to the following
> > Smatch static checker warning:
> > 
> > 	fs/ntfs3/frecord.c:1894 ni_fiemap()
> > 	warn: potential integer overflow from user 'vbo + len'
> > 
> > fs/ntfs3/frecord.c
> >     1843 int ni_fiemap(struct ntfs_inode *ni, struct fiemap_extent_info *fieinfo,
> >     1844 	      __u64 vbo, __u64 len)
> > 
> > "vbo" and "len" are u64 values which are controlled by the user from
> > ioctl_fiemap().
> > 
> > I looked at how BTRFS does it and it uses the fiemap_prep() function.
> 
> And we should too. This was already in my todo list. Just didn't
> notice real problem yet. I just though we should follow api as api
> stated
> 	
> 	Flag checking should be done at the beginning of the ->fiemap
> 	callback via the fiemap_prep() helper.
> 
> Do you want to send a patch or do I? If I do it can I put reported-by
> from you?

Yes please, I'd appreciate the Reported-by tag.

regards,
dan carpenter





[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux