From: Scott Branden <scott.branden@broadcom.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com,
Scott Branden <scott.branden@broadcom.com>
Subject: [PATCH] exec: remove comparision of variable i_size of type loff_t against SIZE_MAX
Date: Thu, 27 Feb 2020 15:31:33 -0800 [thread overview]
Message-ID: <20200227233133.10383-1-scott.branden@broadcom.com> (raw)
Remove comparision of (i_size > SIZE_MAX).
i_size is of type loff_t and can not be great than SIZE_MAX (~(size_t)0).
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
---
fs/exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/exec.c b/fs/exec.c
index db17be51b112..16c229752f74 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -919,7 +919,7 @@ int kernel_read_file(struct file *file, void **buf, loff_t *size,
ret = -EINVAL;
goto out;
}
- if (i_size > SIZE_MAX || (max_size > 0 && i_size > max_size)) {
+ if (max_size > 0 && i_size > max_size) {
ret = -EFBIG;
goto out;
}
--
2.17.1
next reply other threads:[~2020-02-27 23:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-27 23:31 Scott Branden [this message]
2020-02-27 23:39 ` [PATCH] exec: remove comparision of variable i_size of type loff_t against SIZE_MAX Eric Biggers
2020-02-27 23:40 ` Al Viro
2020-02-27 23:49 ` Scott Branden
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=20200227233133.10383-1-scott.branden@broadcom.com \
--to=scott.branden@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).