From: Greg Kroah-Hartman Date: Tue, 11 Jun 2024 13:47:18 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v6.1.93~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c60b2611afa8df93386e0e397a793b37451e7243;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: sunrpc-fix-loop-termination-condition-in-gss_free_in_token_pages.patch --- diff --git a/queue-5.15/series b/queue-5.15/series index 3321bc207bb..1e178cb7e3a 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -336,3 +336,4 @@ kvm-x86-don-t-advertise-guest.maxphyaddr-as-host.maxphyaddr-in-cpuid.patch genirq-cpuhotplug-x86-vector-prevent-vector-leak-during-cpu-offline.patch net-ena-fix-dma-syncing-in-xdp-path-when-swiotlb-is-on.patch media-cec-core-add-adap_nb_transmit_canceled-callback.patch +sunrpc-fix-loop-termination-condition-in-gss_free_in_token_pages.patch diff --git a/queue-5.15/sunrpc-fix-loop-termination-condition-in-gss_free_in_token_pages.patch b/queue-5.15/sunrpc-fix-loop-termination-condition-in-gss_free_in_token_pages.patch new file mode 100644 index 00000000000..e80c0784e15 --- /dev/null +++ b/queue-5.15/sunrpc-fix-loop-termination-condition-in-gss_free_in_token_pages.patch @@ -0,0 +1,33 @@ +From 4a77c3dead97339478c7422eb07bf4bf63577008 Mon Sep 17 00:00:00 2001 +From: Chuck Lever +Date: Sun, 2 Jun 2024 18:15:25 -0400 +Subject: SUNRPC: Fix loop termination condition in gss_free_in_token_pages() + +From: Chuck Lever + +commit 4a77c3dead97339478c7422eb07bf4bf63577008 upstream. + +The in_token->pages[] array is not NULL terminated. This results in +the following KASAN splat: + + KASAN: maybe wild-memory-access in range [0x04a2013400000008-0x04a201340000000f] + +Fixes: bafa6b4d95d9 ("SUNRPC: Fix gss_free_in_token_pages()") +Reviewed-by: Benjamin Coddington +Signed-off-by: Chuck Lever +Signed-off-by: Greg Kroah-Hartman +--- + net/sunrpc/auth_gss/svcauth_gss.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/sunrpc/auth_gss/svcauth_gss.c ++++ b/net/sunrpc/auth_gss/svcauth_gss.c +@@ -1162,7 +1162,7 @@ static int gss_read_proxy_verf(struct sv + } + + pages = DIV_ROUND_UP(inlen, PAGE_SIZE); +- in_token->pages = kcalloc(pages, sizeof(struct page *), GFP_KERNEL); ++ in_token->pages = kcalloc(pages + 1, sizeof(struct page *), GFP_KERNEL); + if (!in_token->pages) { + kfree(in_handle->data); + return SVC_DENIED;