From: Dan Carpenter <dan.carpenter@oracle.com>
To: richard.sharpe@primarydata.com
Cc: linux-nfs@vger.kernel.org
Subject: [bug report] NFS: Support statx_get and statx_set ioctls
Date: Tue, 11 Jan 2022 10:43:09 +0300 [thread overview]
Message-ID: <20220111074309.GA12918@kili> (raw)
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
next reply other threads:[~2022-01-11 7:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-11 7:43 Dan Carpenter [this message]
2022-01-11 8:48 ` [bug report] NFS: Support statx_get and statx_set ioctls 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220111074309.GA12918@kili \
--to=dan.carpenter@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=richard.sharpe@primarydata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox