String matcher "algo bm" broken in OUTPUT since 5.3.x
Hi list,
Since at least kernel 5.3.x (2019) and up to current 6.2.15, iptables -m string --algo bm does not work when added to the OUTPUT chain.
Quick reproducer (algo bm, does not work properly):
Quoted 5 lines
# iptables -I OUTPUT -p tcp -m string --algo bm --string 'GET /' -j DROP $ curl -s example.com | head -n3^^^^ curl executes successfully
This works (algo kmp, works properly):
Quoted 4 lines
# iptables -I OUTPUT -p tcp -m string --algo kmp --string 'GET /' -j DROP $ curl -s example.com | head -n^^^^ curl does not execute successfully
Quoted 14 lines · ValdikSS
Since at least kernel 5.3.x (2019) and up to current 6.2.15, iptables -m string --algo bm does not work when added to the OUTPUT chain.
Quick reproducer (algo bm, does not work properly):
Quoted 4 lines
# iptables -I OUTPUT -p tcp -m string --algo bm --string 'GET /' -j DROP $ curl -s example.com | head -n3^^^^ curl executes successfully
This works (algo kmp, works properly):
Quoted 4 lines
# iptables -I OUTPUT -p tcp -m string --algo kmp --string 'GET /' -j DROP $ curl -s example.com | head -n^^^^ curl does not execute successfully
I've reproduced this. I'll have a crack at fixing it.
Quoted 2 lines
J.