From: Máté Eckl Date: Thu, 12 Jul 2018 15:18:46 +0000 (+0200) Subject: netfilter: nft_socket: Break evaluation if no socket found X-Git-Tag: v4.19~410^2~309^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=365b5a36f352e9884e85c47aa33026fd4df18633;p=platform%2Fkernel%2Flinux-rpi.git netfilter: nft_socket: Break evaluation if no socket found Actual implementation stores 0 in the destination register if no socket is found by the lookup, but that is not intentional as it is not really a value of any socket metadata. This patch fixes this and breaks rule evaluation in this case. Fixes: 554ced0a6e29 ("netfilter: nf_tables: add support for native socket matching") Signed-off-by: Máté Eckl Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/nft_socket.c b/net/netfilter/nft_socket.c index e43c193..622ac20 100644 --- a/net/netfilter/nft_socket.c +++ b/net/netfilter/nft_socket.c @@ -43,7 +43,7 @@ static void nft_socket_eval(const struct nft_expr *expr, } if (!sk) { - nft_reg_store8(dest, 0); + regs->verdict.code = NFT_BREAK; return; }