Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
nft core dumps with "netlink_gen_raw_data: Assertion `len > 0' failed" messages when interface name "*" is used.
Version-Release number of selected component (if applicable):
nftables-0.9.0-8
How reproducible:
Always
Steps to Reproduce:
=======================
1. Create a configuration file with below rule:
add rule ip filter input iifname "*" ct state new accept
2. # nft -f /tmp/rules.1
nft: netlink.c:354: netlink_gen_raw_data: Assertion `len > 0' failed.
Actual results:
nft fails with core dump
Expected results:
nft should not core dump
Additional info:
================
[1]
iptables can be used to add a rule with interface "*". When importing this rule to RHEL8, it fails with coredump. Steps given below:
Eg:
//iptables.rules
# Generated by iptables-save v1.4.7 on Sun Oct 20 12:51:51 2019
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i * -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
-A OUTPUT -d 192.168.122.5/32 -p icmp -j DROP
COMMIT
# iptables-restore-translate -f /tmp/iptables.rules > /tmp/iptables.nft
# nft -f /tmp/iptables.nft
nft: netlink.c:354: netlink_gen_raw_data: Assertion `len > 0' failed. <<<<
Aborted (core dumped) <<<<
[2]
If you add the rule directly, then we get a meaningful error message:
# nft add rule ip filter input iifname "*" ct state new accept
Error: datatype mismatch, expected network interface name, expression has type integer
add rule ip filter input iifname * ct state new accept
~~~~~~~ ^
Upstream commits to backport:
commit 03d45ad330a25323610648bb05f550e0fb9d65b2
Author: Phil Sutter <phil>
Date: Thu Feb 6 12:24:51 2020 +0100
doc: nft.8: Mention wildcard interface matching
Special meaning of asterisk in interface names wasn't described
anywhere.
Signed-off-by: Phil Sutter <phil>
commit 556c5a94b8067f33ef0a42836753dae0736b7524
Author: Phil Sutter <phil>
Date: Thu Feb 6 12:31:56 2020 +0100
scanner: Extend asteriskstring definition
Accept escaped asterisks also mid-string and as only character.
Especially the latter will help when translating from iptables where
asterisk has no special meaning.
Signed-off-by: Phil Sutter <phil>
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHEA-2020:1774
Description of problem: nft core dumps with "netlink_gen_raw_data: Assertion `len > 0' failed" messages when interface name "*" is used. Version-Release number of selected component (if applicable): nftables-0.9.0-8 How reproducible: Always Steps to Reproduce: ======================= 1. Create a configuration file with below rule: add rule ip filter input iifname "*" ct state new accept 2. # nft -f /tmp/rules.1 nft: netlink.c:354: netlink_gen_raw_data: Assertion `len > 0' failed. Actual results: nft fails with core dump Expected results: nft should not core dump Additional info: ================ [1] iptables can be used to add a rule with interface "*". When importing this rule to RHEL8, it fails with coredump. Steps given below: Eg: //iptables.rules # Generated by iptables-save v1.4.7 on Sun Oct 20 12:51:51 2019 *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -i * -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited -A OUTPUT -d 192.168.122.5/32 -p icmp -j DROP COMMIT # iptables-restore-translate -f /tmp/iptables.rules > /tmp/iptables.nft # nft -f /tmp/iptables.nft nft: netlink.c:354: netlink_gen_raw_data: Assertion `len > 0' failed. <<<< Aborted (core dumped) <<<< [2] If you add the rule directly, then we get a meaningful error message: # nft add rule ip filter input iifname "*" ct state new accept Error: datatype mismatch, expected network interface name, expression has type integer add rule ip filter input iifname * ct state new accept ~~~~~~~ ^