]> git.ipfire.org Git - thirdparty/nftables.git/commit
expr: fix crash when listing non-verdict mappings
authorPatrick McHardy <kaber@trash.net>
Mon, 12 Jan 2015 09:48:39 +0000 (09:48 +0000)
committerPatrick McHardy <kaber@trash.net>
Mon, 12 Jan 2015 09:51:25 +0000 (09:51 +0000)
commit1f1ff357b76f2d50fe093b673478070f340fa5d4
tree48a47f3be8345c532f65ef1ed53e3149c18c7389
parent67e392beb977b1929b4db5a406a3051389ea3158
expr: fix crash when listing non-verdict mappings

Fix regression introduced by commit 87c2a2205:

  netlink_delinearize: clone on netlink_get_register(), release previous on _set()

When using a non-verdict mapping, the set ref expression is assigned to the
destination register. The next get_register() will attempt to clone it and
crash because of the missing ->clone() callback.

# nft filter input meta mark set ip daddr map { 192.168.0.1 : 123 }
# nft list table filter
Segmentation fault (core dumped)

Signed-off-by: Patrick McHardy <kaber@trash.net>
src/expression.c