From 3d8757e4703f0025ea70f97e39e3b992f0cc3733 Mon Sep 17 00:00:00 2001 From: Steffen Klassert Date: Fri, 5 May 2017 07:40:42 +0200 Subject: [PATCH] af_key: Fix slab-out-of-bounds in pfkey_compile_policy. commit d90c902449a7561f1b1d58ba5a0d11728ce8b0b2 upstream. 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: df71837d502 ("[LSM-IPSec]: Security association restriction.") Reported-by: Andrey Konovalov Tested-by: Andrey Konovalov Signed-off-by: Steffen Klassert Signed-off-by: Ben Hutchings --- Reading git-format-patch failed