From bc5884deec36707c96e3ec53316aff906c784997 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 20 Jul 2021 15:56:40 +0200 Subject: [PATCH] fix up 4.9 commit --- ...tremely-large-seq-buffer-allocations.patch | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/queue-4.9/seq_file-disallow-extremely-large-seq-buffer-allocations.patch b/queue-4.9/seq_file-disallow-extremely-large-seq-buffer-allocations.patch index ef8b5389331..70a8202aaf7 100644 --- a/queue-4.9/seq_file-disallow-extremely-large-seq-buffer-allocations.patch +++ b/queue-4.9/seq_file-disallow-extremely-large-seq-buffer-allocations.patch @@ -18,23 +18,18 @@ Cc: stable@kernel.org Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- - fs/seq_file.c | 3 +++ + fs/seq_file.c | 3 +++ 1 file changed, 3 insertions(+) -diff --git a/fs/seq_file.c b/fs/seq_file.c -index b117b212ef28..4a2cda04d3e2 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c -@@ -32,6 +32,9 @@ static void seq_set_overflow(struct seq_file *m) +@@ -28,6 +28,9 @@ static void *seq_buf_alloc(unsigned long + void *buf; + gfp_t gfp = GFP_KERNEL; - static void *seq_buf_alloc(unsigned long size) - { + if (unlikely(size > MAX_RW_COUNT)) + return NULL; + - return kvmalloc(size, GFP_KERNEL_ACCOUNT); - } - --- -2.32.0 - + /* + * For high order allocations, use __GFP_NORETRY to avoid oom-killing - + * it's better to fall back to vmalloc() than to kill things. For small -- 2.47.3