summaryrefslogtreecommitdiffstats
path: root/include/libnetfilter_conntrack/linux_nfnetlink_conntrack.h
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2017-07-24 21:55:08 -0300
committerFlorian Westphal <fw@strlen.de>2017-07-25 03:06:29 +0200
commite870432649955d377a73ee5a72cb23f0f6b5e4c5 (patch)
treed5782abbd48d8a4cc464ab1bf71d255e808b7a79 /include/libnetfilter_conntrack/linux_nfnetlink_conntrack.h
parentb266523a03a282eabb76b46013ba43f7e47929c2 (diff)
labels: don't crash on NULL labelmap
When CONNLABEL_CFG isn't available (/etc/xtables/connlabel.conf), conntrack tool crashes: [marcos@Icarus ~]$ conntrack -l something nfct_labelmap_new: No such file or directory Segmentation fault (core dumped) I can see this problem in Fedora 26, because connlabel.conf does not come along the conntrack/libnetfilter packages. This problem happens because conntrack calls nfct_labelmap_new, which resides on libnetfilter_conntrack. So this lib returns NULL because CONNLABEL_CFG is not present, and then NULL is assigned to the global var called labelmap on conntrack. Later, get_label is called, passing NULL to the library, and __label_get_bit is called and deferences labelmap without check, which leads to a crash. With this patch the crash does not happen anymore, and an error message is displayed: conntrack -l something nfct_labelmap_new: No such file or directory conntrack v1.4.4 (conntrack-tools): unknown label 'something' Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include/libnetfilter_conntrack/linux_nfnetlink_conntrack.h')
0 files changed, 0 insertions, 0 deletions