From: Ali Nasrollahi <a.nasrolahi01@gmail.com>
To: fuse-devel@lists.linux.dev
Cc: miklos@szeredi.hu, linux-kernel@vger.kernel.org,
Ali Nasrollahi <A.Nasrolahi01@gmail.com>
Subject: [PATCH v2] fuse: ioctl: remove unnecessary comparison in fuse_setup_measure_verity()
Date: Tue, 18 Aug 2026 19:44:48 +0330 [thread overview]
Message-ID: <20260818161448.51495-1-A.Nasrolahi01@gmail.com> (raw)
Clang reports a warning in fuse_setup_measure_verity() when comparing
the __u16 digest_size with SIZE_MAX minus the size of struct
fsverity_digest:
warning: result of comparison of constant 18446744073709551611 with
expression of type '__u16' (aka 'unsigned short') is always false
[-Wtautological-constant-out-of-range-compare]
This was first observed while building an x86_64 kernel with Clang and
W=1. Since -Werror was enabled in my build, the warning caused the build
to fail.
The same warning can also be reproduced with the same build options
using tinyconfig with FUSE enabled, so this is not specific to the
kernel configuration used in the original build.
The comparison is between the 16-bit digest_size and a size_t-sized
constant. Since this comparison cannot be true, remove it.
Signed-off-by: Ali Nasrollahi <A.Nasrolahi01@gmail.com>
---
Changes in v2:
- Remove the comparison instead of casting digest_size.
---
fs/fuse/ioctl.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/fs/fuse/ioctl.c b/fs/fuse/ioctl.c
index 3614ea603913..dc3a188f5d72 100644
--- a/fs/fuse/ioctl.c
+++ b/fs/fuse/ioctl.c
@@ -130,9 +130,6 @@ static int fuse_setup_measure_verity(unsigned long arg, struct iovec *iov)
if (copy_from_user(&digest_size, &uarg->digest_size, sizeof(digest_size)))
return -EFAULT;
- if (digest_size > SIZE_MAX - sizeof(struct fsverity_digest))
- return -EINVAL;
-
iov->iov_len = sizeof(struct fsverity_digest) + digest_size;
return 0;
--
2.55.0
next reply other threads:[~2026-08-18 16:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 16:14 Ali Nasrollahi [this message]
2026-08-25 12:35 ` Miklos Szeredi
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=20260818161448.51495-1-A.Nasrolahi01@gmail.com \
--to=a.nasrolahi01@gmail.com \
--cc=fuse-devel@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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
all inboxes | Powered by JetHome®