netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: herbert@gondor.apana.org.au
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 6/7] [IPSEC]: Lock state when copying non-atomic fields to user-space
Date: Tue, 09 Oct 2007 13:33:07 -0700 (PDT)	[thread overview]
Message-ID: <20071009.133307.88477317.davem@davemloft.net> (raw)
In-Reply-To: <E1IfGCK-0005ML-00@gondolin.me.apana.org.au>

From: Herbert Xu <herbert@gondor.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@gondor.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.

  reply	other threads:[~2007-10-09 20:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-09 14:35 [0/7] IPsec: More work on async crypto on output Herbert Xu
2007-10-09 14:36 ` [PATCH 1/7] [IPSEC]: Remove bogus ref count in xfrm_secpath_reject Herbert Xu
2007-10-09 20:24   ` David Miller
2007-10-09 14:36 ` [PATCH 2/7] [IPSEC]: Store IPv6 nh pointer in mac_header on output Herbert Xu
2007-10-09 20:26   ` David Miller
2007-10-09 14:36 ` [PATCH 3/7] [IPSEC]: Remove gratuitous km wake-up events on ACQUIRE Herbert Xu
2007-10-09 20:27   ` David Miller
2007-10-09 14:36 ` [PATCH 4/7] [IPSEC]: Move common code into xfrm_alloc_spi Herbert Xu
2007-10-09 20:30   ` David Miller
2007-10-09 14:36 ` [PATCH 5/7] [XFRM] user: Move attribute copying code into copy_to_user_state_extra Herbert Xu
2007-10-09 20:31   ` David Miller
2007-10-09 14:36 ` [PATCH 6/7] [IPSEC]: Lock state when copying non-atomic fields to user-space Herbert Xu
2007-10-09 20:33   ` David Miller [this message]
2007-10-10  0:48     ` Herbert Xu
2007-11-26  3:03       ` Masahide NAKAMURA
2007-11-26  3:18         ` Herbert Xu
2007-11-26 11:07           ` Herbert Xu
2007-11-28  1:16             ` Masahide NAKAMURA
2007-10-09 14:36 ` [PATCH 7/7] [IPSEC]: Move state lock into x->type->output Herbert Xu
2007-10-09 20:33   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071009.133307.88477317.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).