From: Nicolas Dichtel Date: Thu, 20 Feb 2014 13:52:41 +0000 (+0100) Subject: pfkey: fix SADB_X_EXT_FILTER length check X-Git-Tag: firefly_0821_release~176^2~4167^2~287^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;ds=sidebyside;h=d2c5f6582515362328b33b2a331a17e141ef0d40;p=firefly-linux-kernel-4.4.55.git pfkey: fix SADB_X_EXT_FILTER length check This patch fixes commit d3623099d350 ("ipsec: add support of limited SA dump"). sadb_ext_min_len array should be updated with the new type (SADB_X_EXT_FILTER). Reported-by: Dan Carpenter Signed-off-by: Nicolas Dichtel Signed-off-by: Steffen Klassert --- diff --git a/net/key/af_key.c b/net/key/af_key.c index f0879c19f452..a50d979b5926 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -365,6 +365,7 @@ static const u8 sadb_ext_min_len[] = { [SADB_X_EXT_NAT_T_OA] = (u8) sizeof(struct sadb_address), [SADB_X_EXT_SEC_CTX] = (u8) sizeof(struct sadb_x_sec_ctx), [SADB_X_EXT_KMADDRESS] = (u8) sizeof(struct sadb_x_kmaddress), + [SADB_X_EXT_FILTER] = (u8) sizeof(struct sadb_x_filter), }; /* Verify sadb_address_{len,prefixlen} against sa_family. */