Thread (4 messages) flat view 4 messages, 2 authors, 2021-08-18

Re: [PATCH] net: xfrm: assign the per_cpu_ptr pointer before return

From: Dongliang Mu <hidden>
Date: 2021-08-18 10:40:06
Also in: lkml, stable

On Wed, Aug 18, 2021 at 11:32 AM Herbert Xu [off-list ref] wrote:
On Wed, Aug 18, 2021 at 11:25:53AM +0800, Dongliang Mu wrote:
quoted
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c
index cb40ff0ff28d..01dbec70dfba 100644
--- a/net/xfrm/xfrm_ipcomp.c
+++ b/net/xfrm/xfrm_ipcomp.c
@@ -223,9 +223,9 @@ static void * __percpu *ipcomp_alloc_scratches(void)
              void *scratch;

              scratch = vmalloc_node(IPCOMP_SCRATCH_SIZE, cpu_to_node(i));
+             *per_cpu_ptr(scratches, i) = scratch;
              if (!scratch)
                      return NULL;
-             *per_cpu_ptr(scratches, i) = scratch;
scratches comes from alloc_percpu so it should already be zeroed.
Correct.

:\ Then I have no idea how this crash occurs. This crash report does
not have any reproducer. It seems like a random crash, but I am not
sure.

If you have any patch for this crash, please let me know.
Cheers,
--
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help