Skip to content

netfilter: conntrack: validate parsed port values in IRC and Amanda helpers

HACKE-RC lkml netdev netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2netfilter: nf_conntrack_irc: reject DCC port values above 65535net/netfilter/nf_conntrack_irc.c+6 -10 replies
2/2netfilter: nf_conntrack_amanda: reject port values above 65535net/netfilter/nf_conntrack_amanda.c+6 -41 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/2] netfilter: conntrack: validate parsed port values in IRC and Amanda helpers

Both nf_conntrack_irc and nf_conntrack_amanda parse port numbers from application-layer protocol data using simple_strtoul(), which returns unsigned long. The results are stored in u16 variables without range checks, silently truncating values above 65535.

This series adds explicit upper-bound validation in both helpers.

Note: checkpatch warns about simple_strtoul being obsolete. Both call sites use the endptr output parameter to advance the parse position, which kstrtoul does not provide. Converting to kstrtoul would require restructuring the parsers, which is out of scope for this fix.

HACKE-RC (2):
netfilter: nf_conntrack_irc: reject DCC port values above 65535
netfilter: nf_conntrack_amanda: reject port values above 65535

 net/netfilter/nf_conntrack_amanda.c | 10 ++++++----
 net/netfilter/nf_conntrack_irc.c    |  7 ++++++-
 2 files changed, 12 insertions(+), 5 deletions(-)
Signature · 1 line
2.54.0