History

netfilter: ctnetlink: Fix regression in CTA_STATUS processing

The libnetfilter_conntrack userland library always sets IPS_CONFIRMED when building a CTA_STATUS attribute. If this toggles the bit from 0->1, the parser will return an error. On Linux 4.4+ this will cause any NFQA_EXP attribute in the packet to be ignored. This breaks conntrackd's userland helpers because they operate on unconfirmed connections. Instead of returning -EBUSY if the user program asks to modify an unchangeable bit, simply ignore the change. Also, fix the logic so that user programs are allowed to clear the bits that they are allowed to change.

Kevin Cernekee committed 9 years ago

Commit a963d711 parent dfe75ff2 files · +29 −1Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/netfilter/nf_conntrack_common.h+4−0
@@ -82,6 +82,10 @@ enum ip_conntrack_status { · 81 unmodified lines
82 IPS_DYING_BIT = 9,82 IPS_DYING_BIT = 9,
83 IPS_DYING = (1 << IPS_DYING_BIT),83 IPS_DYING = (1 << IPS_DYING_BIT),
84 84
85 /* Bits that cannot be altered from userland. */
86 IPS_UNCHANGEABLE_MASK = (IPS_NAT_DONE_MASK | IPS_NAT_MASK |
87 IPS_EXPECTED | IPS_CONFIRMED | IPS_DYING),
88
85 /* Connection has fixed timeout. */89 /* Connection has fixed timeout. */
86 IPS_FIXED_TIMEOUT_BIT = 10,90 IPS_FIXED_TIMEOUT_BIT = 10,
87 IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),91 IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),