]> git.baikalelectronics.ru Git - kernel.git/commit
af_key: Add lock to key dump
authorYuejie Shi <syjcnss@gmail.com>
Fri, 31 Mar 2017 07:10:20 +0000 (15:10 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 3 Apr 2017 06:05:17 +0000 (08:05 +0200)
commite4c747e93bcc0593a6253c62949416c6ca6e5493
tree95c3425ed24cca1ce0b806197c690ca42c1be36b
parentba4e657e86654a5d99b72d61d1ff0877ae544d71
af_key: Add lock to key dump

A dump may come in the middle of another dump, modifying its dump
structure members. This race condition will result in NULL pointer
dereference in kernel. So add a lock to prevent that race.

Fixes: 11cd7ef536a4 ("[AF_KEY]: Dump SA/SP entries non-atomically")
Signed-off-by: Yuejie Shi <syjcnss@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/key/af_key.c