]> git.baikalelectronics.ru Git - kernel.git/commit
af_key: Fix slab-out-of-bounds in pfkey_compile_policy.
authorSteffen Klassert <steffen.klassert@secunet.com>
Fri, 5 May 2017 05:40:42 +0000 (07:40 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 8 May 2017 06:03:01 +0000 (08:03 +0200)
commit7edf22e826a27994701c5bfad49fc829ba6e396c
tree5e0505f4a86aa0a1a77cb9c1b300865c51ccddb6
parent745aac8b9ca5738a69542fb5949d915eaf64f11e
af_key: Fix slab-out-of-bounds in pfkey_compile_policy.

The sadb_x_sec_len is stored in the unit 'byte divided by eight'.
So we have to multiply this value by eight before we can do
size checks. Otherwise we may get a slab-out-of-bounds when
we memcpy the user sec_ctx.

Fixes: 263946b16ef ("[LSM-IPSec]: Security association restriction.")
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/key/af_key.c