lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 17 Jan 2020 15:48:22 +0000
From:   David Howells <dhowells@...hat.com>
To:     Krzysztof Kozlowski <krzk@...nel.org>
Cc:     dhowells@...hat.com,
        Trond Myklebust <trond.myklebust@...merspace.com>,
        Anna Schumaker <anna.schumaker@...app.com>,
        linux-nfs@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        Scott Mayhew <smayhew@...hat.com>,
        Arnd Bergmann <arnd@...db.de>
Subject: [PATCH] nfs: Return EINVAL rather than ERANGE for mount parse errors

Hi Krzysztof,

Does this patch fix the problem?

David
---
commit 3021f58ee1e2c9659e629d0ccf06d3e0876e805a
Author: David Howells <dhowells@...hat.com>
Date:   Fri Jan 17 15:37:46 2020 +0000

    nfs: Return EINVAL rather than ERANGE for mount parse errors
    
    Return EINVAL rather than ERANGE for mount parse errors as the userspace
    mount command doesn't necessarily understand what to do with anything other
    than EINVAL.
    
    The old code returned -ERANGE as an intermediate error that then get
    converted to -EINVAL, whereas the new code returns -ERANGE.
    
    This was induced by passing minorversion=1 to a v4 mount where
    CONFIG_NFS_V4_1 was disabled in the kernel build.
    
    Fixes: 68f65ef40e1e ("NFS: Convert mount option parsing to use functionality from fs_parser.h")
    Reported-by: Krzysztof Kozlowski <krzk@...nel.org>
    Signed-off-by: David Howells <dhowells@...hat.com>

diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c
index 429315c011ae..07cbd655dafb 100644
--- a/fs/nfs/fs_context.c
+++ b/fs/nfs/fs_context.c
@@ -770,7 +770,7 @@ static int nfs_fs_context_parse_param(struct fs_context *fc,
 	return nfs_invalf(fc, "NFS: Bad IP address specified");
 out_of_bounds:
 	nfs_invalf(fc, "NFS: Value for '%s' out of range", param->key);
-	return -ERANGE;
+	return -EINVAL;
 }
 
 /*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ