re: locks: new locks_mandatory_area calling convention

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

 



Hello Christoph Hellwig,

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

The patch 9e48b0c90a29: "locks: new locks_mandatory_area calling 
convention" from Dec 3, 2015, leads to the following Smatch complaint:

fs/locks.c:1250 locks_mandatory_area()
	 warn: variable dereferenced before check 'filp' (see line 1241)

fs/locks.c
  1240	{
  1241		struct inode *inode = file_inode(filp);
                                      ^^^^^^^^^^^^^^^^
Patch adds new dereference inside the function call.

  1242		struct file_lock fl;
  1243		int error;
  1244		bool sleep = false;
  1245	
  1246		locks_init_lock(&fl);
  1247		fl.fl_pid = current->tgid;
  1248		fl.fl_file = filp;
  1249		fl.fl_flags = FL_POSIX | FL_ACCESS;
  1250		if (filp && !(filp->f_flags & O_NONBLOCK))
                    ^^^^
Existing check is too late.

  1251			sleep = true;
  1252		fl.fl_type = type;

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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