summaryrefslogtreecommitdiff
path: root/lib/once.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-12-30 03:47:53 (GMT)
committerHerbert Xu <herbert@gondor.apana.org.au>2016-01-18 10:16:09 (GMT)
commitc840ac6af3f8713a71b4d2363419145760bd6044 (patch)
treec2b3d5d10f5c7eccaec249337e6c3b8821567662 /lib/once.c
parentdd504589577d8e8e70f51f997ad487a4cb6c026f (diff)
downloadlinux-c840ac6af3f8713a71b4d2363419145760bd6044.tar.xz
crypto: af_alg - Disallow bind/setkey/... after accept(2)
Each af_alg parent socket obtained by socket(2) corresponds to a tfm object once bind(2) has succeeded. An accept(2) call on that parent socket creates a context which then uses the tfm object. Therefore as long as any child sockets created by accept(2) exist the parent socket must not be modified or freed. This patch guarantees this by using locks and a reference count on the parent socket. Any attempt to modify the parent socket will fail with EBUSY. Cc: stable@vger.kernel.org Reported-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'lib/once.c')
0 files changed, 0 insertions, 0 deletions