[bug report] cifs: implement set acl method

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

 



Hello Christian Brauner,

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

The patch dc1af4c4b472: "cifs: implement set acl method" from Sep 22,
2022, leads to the following Smatch complaint:

    fs/cifs/cifsacl.c:1781 cifs_set_acl()
    warn: variable dereferenced before check 'acl' (see line 1773)

fs/cifs/cifsacl.c
  1772			returns as xattrs */
  1773		if (posix_acl_xattr_size(acl->a_count) > CIFSMaxBufSize) {
                                         ^^^
I looked at the callers and "acl" can definitely be NULL at this point.
I feel like it would be nice to check it earlier and goto out directly,
but I don't know what a NULL acl is for...

  1774			cifs_dbg(FYI, "size of EA value too large\n");
  1775			rc = -EOPNOTSUPP;
  1776			goto out;
  1777		}
  1778	
  1779		switch (type) {
  1780		case ACL_TYPE_ACCESS:
  1781			if (!acl)
                            ^^^^
Too late.  And later on there is another check as well.

  1782				goto out;
  1783			if (sb->s_flags & SB_POSIXACL)

regards,
dan carpenter



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux