[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220118160451.425876269@linuxfoundation.org>
Date: Tue, 18 Jan 2022 17:05:45 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Jamie Hill-Daniel <jamie@...l-daniel.co.uk>,
William Liu <willsroot@...tonmail.com>,
Salvatore Bonaccorso <carnil@...ian.org>,
Thadeu Lima de Souza Cascardo <cascardo@...onical.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Al Viro <viro@...iv.linux.org.uk>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: [PATCH 5.10 05/23] vfs: fs_context: fix up param length parsing in legacy_parse_param
From: Jamie Hill-Daniel <jamie@...l-daniel.co.uk>
commit 722d94847de29310e8aa03fcbdb41fc92c521756 upstream.
The "PAGE_SIZE - 2 - size" calculation in legacy_parse_param() is an
unsigned type so a large value of "size" results in a high positive
value instead of a negative value as expected. Fix this by getting rid
of the subtraction.
Signed-off-by: Jamie Hill-Daniel <jamie@...l-daniel.co.uk>
Signed-off-by: William Liu <willsroot@...tonmail.com>
Tested-by: Salvatore Bonaccorso <carnil@...ian.org>
Tested-by: Thadeu Lima de Souza Cascardo <cascardo@...onical.com>
Acked-by: Dan Carpenter <dan.carpenter@...cle.com>
Acked-by: Al Viro <viro@...iv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/fs_context.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/fs_context.c
+++ b/fs/fs_context.c
@@ -530,7 +530,7 @@ static int legacy_parse_param(struct fs_
param->key);
}
- if (len > PAGE_SIZE - 2 - size)
+ if (size + len + 2 > PAGE_SIZE)
return invalf(fc, "VFS: Legacy: Cumulative options too large");
if (strchr(param->key, ',') ||
(param->type == fs_value_is_string &&
Powered by blists - more mailing lists