]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
NFS: remove unneeded check in decode_devicenotify_args()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Tue, 15 Feb 2022 10:17:04 +0000 (13:17 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:58:09 +0000 (11:58 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit cb8fac6d2727f79f211e745b16c9abbf4d8be652 ]

[You don't often get email from khoroshilov@ispras.ru. Learn why this is important at http://aka.ms/LearnAboutSenderIdentification.]

Overflow check in not needed anymore after we switch to kmalloc_array().

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: a4f743a6bb20 ("NFSv4.1: Convert open-coded array allocation calls to kmalloc_array()")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 75ee75cc360a8ce0ba3a3e796658152f9b3c4694)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/nfs/callback_xdr.c

index ce3d1d5b1291fb96d294157b08d6eb8bde7f7a08..ea17085ef884bb8cff095b4bccd0f71782ce3337 100644 (file)
@@ -271,10 +271,6 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
        n = ntohl(*p++);
        if (n == 0)
                goto out;
-       if (n > ULONG_MAX / sizeof(*args->devs)) {
-               status = htonl(NFS4ERR_BADXDR);
-               goto out;
-       }
 
        args->devs = kmalloc_array(n, sizeof(*args->devs), GFP_KERNEL);
        if (!args->devs) {