From 6df8c7ffad292562fa34b1265dbf094e84201447 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 11 Jun 2024 15:19:00 +0200 Subject: [PATCH] 6.9-stable patches added patches: sunrpc-fix-loop-termination-condition-in-gss_free_in_token_pages.patch --- queue-6.9/series | 1 + ...condition-in-gss_free_in_token_pages.patch | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 queue-6.9/sunrpc-fix-loop-termination-condition-in-gss_free_in_token_pages.patch diff --git a/queue-6.9/series b/queue-6.9/series index a04019ff085..9e2527f2e0d 100644 --- a/queue-6.9/series +++ b/queue-6.9/series @@ -276,6 +276,7 @@ cifs-set-zero_point-in-the-copy_file_range-and-remap.patch cifs-fix-missing-set-of-remote_i_size.patch tracing-probes-fix-error-check-in-parse_btf_field.patch tpm_tis_spi-account-for-spi-header-when-allocating-t.patch +sunrpc-fix-loop-termination-condition-in-gss_free_in_token_pages.patch netfilter-nfnetlink_queue-acquire-rcu_read_lock-in-i.patch netfilter-ipset-add-list-flush-to-cancel_gc.patch netfilter-nft_payload-restore-vlan-q-in-q-match-supp.patch diff --git a/queue-6.9/sunrpc-fix-loop-termination-condition-in-gss_free_in_token_pages.patch b/queue-6.9/sunrpc-fix-loop-termination-condition-in-gss_free_in_token_pages.patch new file mode 100644 index 00000000000..8d3c170be11 --- /dev/null +++ b/queue-6.9/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 +@@ -1069,7 +1069,7 @@ static int gss_read_proxy_verf(struct sv + goto out_denied_free; + + 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) + goto out_denied_free; + in_token->page_base = 0; -- 2.47.3