[bug report] SUNRPC: simplify auth_unix.

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

 



Hello NeilBrown,

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

The patch 394f319df78e: "SUNRPC: simplify auth_unix." from Dec 3, 
2018, leads to the following Smatch complaint:

    net/sunrpc/auth_unix.c:90 unx_match()
    warn: variable dereferenced before check 'acred->cred' (see line 87)

net/sunrpc/auth_unix.c
    86	
    87		if (!uid_eq(cred->cr_cred->fsuid, acred->cred->fsuid) || !gid_eq(cred->cr_cred->fsgid, acred->cred->fsgid))
                                                  ^^^^^^^^^^^
New dereference

    88			return 0;
    89	
    90		if (acred->cred && acred->cred->group_info != NULL)
                    ^^^^^^^^^^^
But the old code checked for NULL

    91			groups = acred->cred->group_info->ngroups;
    92		if (groups > UNX_NGROUPS)

regards,
dan carpenter



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux