[bug report] NFS: Support statx_get and statx_set ioctls

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

 



Hello Richard Sharpe,

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

The patch bc66f6805766: "NFS: Support statx_get and statx_set ioctls" 
from Dec 27, 2021, leads to the following Smatch complaint:

    fs/nfs/nfs4proc.c:8035 _nfs4_set_nfs4_statx()
    error: we previously assumed 'statx' could be null (see line 8026)

fs/nfs/nfs4proc.c
  8025	
  8026		if (statx && (statx->fa_valid[0] & NFS_FA_VALID_SIZE)) {
                    ^^^^^
The patch adds checks for NULL

  8027			sattr.ia_valid |= ATTR_SIZE;
  8028			sattr.ia_size = statx->fa_size;
  8029		}
  8030	
  8031		nfs4_stateid_copy(&arg.stateid, &zero_stateid);
  8032	
  8033		status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1);
  8034		if (!status) {
  8035			if (statx->fa_valid[0] & statx_win) {
                            ^^^^^
and unchecked dereferences

  8036				struct nfs_inode *nfsi = NFS_I(inode);
  8037	

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