path: root/src/conntrack/copy.c
diff options
authorMarcos Paulo de Souza <>2017-07-24 21:55:08 -0300
committerFlorian Westphal <>2017-07-25 03:06:29 +0200
commite870432649955d377a73ee5a72cb23f0f6b5e4c5 (patch)
treed5782abbd48d8a4cc464ab1bf71d255e808b7a79 /src/conntrack/copy.c
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 <> Signed-off-by: Florian Westphal <>
Diffstat (limited to 'src/conntrack/copy.c')
0 files changed, 0 insertions, 0 deletions