All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] NFS: Support statx_get and statx_set ioctls
@ 2022-01-11  7:43 Dan Carpenter
  2022-01-11  8:48 ` Christoph Hellwig
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Carpenter @ 2022-01-11  7:43 UTC (permalink / raw)
  To: richard.sharpe; +Cc: linux-nfs

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

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

end of thread, other threads:[~2022-01-13 17:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-11  7:43 [bug report] NFS: Support statx_get and statx_set ioctls Dan Carpenter
2022-01-11  8:48 ` Christoph Hellwig
2022-01-11 10:48   ` Christian Brauner
2022-01-11 18:08   ` Trond Myklebust
2022-01-12  8:06     ` hch
2022-01-12  7:57   ` Amir Goldstein
2022-01-12 17:43     ` Darrick J. Wong
2022-01-13  3:52       ` Amir Goldstein
2022-01-13  6:30         ` Jeremy Allison
2022-01-13 14:58           ` Trond Myklebust
2022-01-13 17:50             ` Jeremy Allison
2022-01-13 15:01     ` Trond Myklebust

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.