public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]: set state to XFRM_STATE_DEAD before calling xfrm_state_put in pfkey_msg2xfrm_state
@ 2003-05-14 15:00 Patrick McHardy
  2003-05-14 20:13 ` David S. Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick McHardy @ 2003-05-14 15:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 234 bytes --]

This patch sets x->state to XFRM_STATE_DEAD before calling
xfrm_state_put in pfkey_msg2xfrm_state to avoid triggering
the BUG_TRAP in __xfrm_state_destroy. The patch applies to both
2.5 and the 2.4 backport.

Best regards,
Patrick




[-- Attachment #2: af_key-set-xfrm-dead.diff --]
[-- Type: text/plain, Size: 844 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1113  -> 1.1114 
#	    net/key/af_key.c	1.35    -> 1.36   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/05/14	kaber@trash.net	1.1114
# [IPSEC]: set state to XFRM_STATE_DEAD before calling xfrm_state_put in pfkey_msg2xfrm_state
# --------------------------------------------
#
diff -Nru a/net/key/af_key.c b/net/key/af_key.c
--- a/net/key/af_key.c	Wed May 14 16:56:52 2003
+++ b/net/key/af_key.c	Wed May 14 16:56:52 2003
@@ -1090,6 +1090,7 @@
 	return x;
 
 out:
+	x->type = XFRM_STATE_DEAD;
 	xfrm_state_put(x);
 	return ERR_PTR(-ENOBUFS);
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH]: set state to XFRM_STATE_DEAD before calling xfrm_state_put in pfkey_msg2xfrm_state
  2003-05-14 15:00 [PATCH]: set state to XFRM_STATE_DEAD before calling xfrm_state_put in pfkey_msg2xfrm_state Patrick McHardy
@ 2003-05-14 20:13 ` David S. Miller
  2003-05-14 20:29   ` Patrick McHardy
  0 siblings, 1 reply; 3+ messages in thread
From: David S. Miller @ 2003-05-14 20:13 UTC (permalink / raw)
  To: kaber; +Cc: linux-kernel

   From: Patrick McHardy <kaber@trash.net>
   Date: Wed, 14 May 2003 17:00:13 +0200

   This patch sets x->state to XFRM_STATE_DEAD before calling
   xfrm_state_put in pfkey_msg2xfrm_state to avoid triggering
   the BUG_TRAP in __xfrm_state_destroy. The patch applies to both
   2.5 and the 2.4 backport.
   
You didn't test this change.  x->type is a pointer, not a place where
you put XFRM_STATE_DEAD, a simple compile test would have alerted
this to you.

This also means you couldn't possibly have tested if this even
makes the assertion go away, it couldn't possibly have fixed this..

The correct fix, of course, is to set x->km.state to this value.
This is what I've done in my tree.

Please be a LOT more careful with your changes.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH]: set state to XFRM_STATE_DEAD before calling xfrm_state_put in pfkey_msg2xfrm_state
  2003-05-14 20:13 ` David S. Miller
@ 2003-05-14 20:29   ` Patrick McHardy
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick McHardy @ 2003-05-14 20:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel



David S. Miller wrote:

>You didn't test this change.  x->type is a pointer, not a place where
>you put XFRM_STATE_DEAD, a simple compile test would have alerted
>this to you.
>  
>

Sorry about that, i recreated the fix in a different tree and broke it.

>This also means you couldn't possibly have tested if this even
>makes the assertion go away, it couldn't possibly have fixed this..
>
>The correct fix, of course, is to set x->km.state to this value.
>This is what I've done in my tree.
>
>Please be a LOT more careful with your changes.
>

Promised.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-14 20:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-14 15:00 [PATCH]: set state to XFRM_STATE_DEAD before calling xfrm_state_put in pfkey_msg2xfrm_state Patrick McHardy
2003-05-14 20:13 ` David S. Miller
2003-05-14 20:29   ` Patrick McHardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox