Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [bug report] cifs: implement set acl method
@ 2022-10-28 10:38 Dan Carpenter
  2022-10-28 10:49 ` Christian Brauner
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2022-10-28 10:38 UTC (permalink / raw)
  To: brauner; +Cc: linux-cifs

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-28 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-28 10:38 [bug report] cifs: implement set acl method Dan Carpenter
2022-10-28 10:49 ` Christian Brauner
2022-10-28 10:52   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox