seq_file: disallow extremely large seq buffer allocations
authorEric Sandeen <sandeen@redhat.com>
Tue, 13 Jul 2021 15:49:23 +0000 (17:49 +0200)
committerPDO SCM Team <hudsoncm@motorola.com>
Mon, 6 Dec 2021 08:55:36 +0000 (03:55 -0500)
commit7db62d364b6709932073633cef5ea1e85806614b
treef595a5b4c159b4cb8ae9ee8fd83184539d93d8a7
parent59f48edc8ae1bb13243b516c0afbe6391dd25ad2
seq_file: disallow extremely large seq buffer allocations

commit 8cae8cd89f05f6de223d63e6d15e31c8ba9cf53b upstream.

There is no reasonable need for a buffer larger than this, and it avoids
int overflow pitfalls.

Mot-CRs-fixed: (CR)
CVE-Fixed: CVE-2021-33909
Bug: 195082750

Change-Id: I862f73cb7ec270b2d17ff61d405b5c5fd60d7353
Fixes: 058504edd026 ("fs/seq_file: fallback to vmalloc allocation")
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: Qualys Security Advisory <qsa@qualys.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Gajjala Chakradhar <gajjalac@motorola.com>
Reviewed-on: https://gerrit.mot.com/2123620
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
(cherry picked from commit 55b17c68973feef965d30a323651f4f340d3302b)
fs/seq_file.c