[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20071009.133307.88477317.davem@davemloft.net>
Date: Tue, 09 Oct 2007 13:33:07 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: herbert@...dor.apana.org.au
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 6/7] [IPSEC]: Lock state when copying non-atomic fields
to user-space
From: Herbert Xu <herbert@...dor.apana.org.au>
Date: Tue, 09 Oct 2007 22:36:36 +0800
> [IPSEC]: Lock state when copying non-atomic fields to user-space
>
> This patch adds locking so that when we're copying non-atomic fields such as
> life-time or coaddr to user-space we don't get a partial result.
>
> For af_key I've changed every instance of pfkey_xfrm_state2msg apart from
> expiration notification to include the keys and life-times. This is in-line
> with XFRM behaviour.
>
> The actual cases affected are:
>
> * pfkey_getspi: No change as we don't have any keys to copy.
> * key_notify_sa:
> + ADD/UPD: This wouldn't work otherwise.
> + DEL: It can't hurt.
>
> Signed-off-by: Herbert Xu <herbert@...dor.apana.org.au>
Applied.
I would be more careful with the changelog description for
something like this in the future. It sounds like this
patch will cause us to touch userspace with locks held,
which obviously only works in very limited scenerios
and is usually a BUG.
But you're actually just constructing SKB response netlink
bits, which later will be copied into userspace but long
after we've released these locks.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists