[bug report] ovl: make sure that real fid is 32bit aligned in memory

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

 



Hello Amir Goldstein,

This is a semi-automatic email about new static checker warnings.

The patch cbe7fba8edfc: "ovl: make sure that real fid is 32bit 
aligned in memory" from Nov 15, 2019, leads to the following Smatch 
complaint:

    fs/overlayfs/copy_up.c:338 ovl_set_origin()
     warn: variable dereferenced before check 'fh' (see line 337)

fs/overlayfs/copy_up.c
   336		 */
   337		err = ovl_check_setxattr(dentry, upper, OVL_XATTR_ORIGIN, fh->buf,
                                                                          ^^^^^^^
The patch adds an unconditional dereference

   338					 fh ? fh->fb.len : 0, 0);
                                         ^^
but "fh" can be NULL.

   339		kfree(fh);
   340	

regards,
dan carpenter



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

  Powered by Linux