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.
Bug 1658716 - nftables fails to accept some names for tables and chains
Summary: nftables fails to accept some names for tables and chains
Keywords:
Status: CLOSED ERRATA
Alias: None
Deadline: 2022-06-13
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: nftables
Version: 9.1
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: rc
: 9.1
Assignee: Phil Sutter
QA Contact: Jiri Peska
URL:
Whiteboard:
: 1816300 2077521 (view as bug list)
Depends On: 1682337
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-12 17:52 UTC by Akhil John
Modified: 2022-11-15 13:19 UTC (History)
6 users (show)

Fixed In Version: nftables-1.0.4-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2108674 (view as bug list)
Environment:
Last Closed: 2022-11-15 11:22:16 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2022:8381 0 None None None 2022-11-15 11:22:20 UTC

Description Akhil John 2018-12-12 17:52:50 UTC
Description of problem:
nftables is not accepting the names like 'second' 'hour', 'day' or 'minute' for table or chains

Version-Release number of selected component (if applicable):
all versions. (nftables v0.8 and nftables v 0.9)

How reproducible:
Always

Steps to Reproduce:
# nft list ruleset
table ip ABC {
}


# nft add table minute
Error: syntax error, unexpected minute, expecting string
add table minute
          ^^^^^^
# nft add table hour
Error: syntax error, unexpected hour, expecting string
add table hour
          ^^^^
# nft add table day
Error: syntax error, unexpected day, expecting string
add table day
          ^^^
# nft add table second
Error: syntax error, unexpected second, expecting string
add table second
          ^^^^^^


# nft add chain ABC second
Error: syntax error, unexpected second, expecting string
add chain ABC second
              ^^^^^^
# nft add chain ABC minute
Error: syntax error, unexpected minute, expecting string
add chain ABC minute
              ^^^^^^
# nft add chain ABC hour
Error: syntax error, unexpected hour, expecting string
add chain ABC hour
              ^^^^
# nft add chain ABC day
Error: syntax error, unexpected day, expecting string
add chain ABC day
              ^^^

Comment 1 Tomas Dolezal 2018-12-12 17:57:12 UTC
addidtionally, quoted strings are also refused:

# nft add table '"day"'
Error: syntax error, unexpected quoted string, expecting string
add table "day"
          ^^^^^

and for the record:
# nft add table "'day'"
Error: syntax error, unexpected junk, expecting string
add table 'day'
          ^

Comment 2 Phil Sutter 2019-01-16 17:27:11 UTC
Yes, quotes are the suggested method of ensuring a name doesn't clash with a keyword. Sadly, this seems broken here.

Comment 3 Phil Sutter 2019-01-16 19:09:25 UTC
Fix sent upstream: https://marc.info/?l=netfilter-devel&m=154766438526122&w=2

Comment 5 Phil Sutter 2019-08-26 17:24:18 UTC
Upstream rejected my initial solution. Problem was discussed at Netfilter Workshop, a potential workaround identified there needs further investigation.

Comment 10 Phil Sutter 2020-03-26 20:10:04 UTC
*** Bug 1816300 has been marked as a duplicate of this bug. ***

Comment 11 Phil Sutter 2020-03-26 20:12:05 UTC
As described in bug 1816300, the problem tends to become worse as new keywords are introduced, potentially breaking existing setups if they use them as names by accident.

Comment 15 Phil Sutter 2020-08-03 11:05:37 UTC
Still no progress upstream, moving to 8.4.

Comment 16 sushil kulkarni 2020-08-03 12:53:12 UTC
Taking this off of the 8.3 RPL.

Thanks!
Sushil

Comment 20 RHEL Program Management 2021-02-01 07:31:09 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 21 Phil Sutter 2021-02-01 13:59:46 UTC
Still relevant.

Comment 24 Tomas Dolezal 2021-03-24 23:28:29 UTC
keyword 'in' also causes problems:
:: [ 19:21:49 ] :: [  BEGIN   ] :: create nft table :: actually running 'nft -f - <<EOF
table ip filter {
        map foo {
                type inet_service : ifname
        }
        chain in {
        }
}
EOF'
/dev/stdin:5:8-9: Error: syntax error, unexpected in, expecting string
        chain in {
              ^^
/dev/stdin:7:1-1: Error: syntax error, unexpected '}'
}
^
:: [ 19:21:49 ] :: [   FAIL   ] :: create nft table (Expected 0, got 1)

Comment 26 RHEL Program Management 2021-08-01 07:26:53 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 27 Phil Sutter 2021-08-30 13:49:39 UTC
Still relevant.

Comment 32 RHEL Program Management 2022-03-02 07:27:20 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 33 Phil Sutter 2022-03-02 17:13:41 UTC
The problem is still relevant, but given that it is also still WiP upstream we'll schedule this for RHEL9.

Comment 36 Phil Sutter 2022-04-26 11:58:07 UTC
*** Bug 2077521 has been marked as a duplicate of this bug. ***

Comment 39 Phil Sutter 2022-06-09 16:24:43 UTC
Likely fixed implicitly by package rebase (bug 1917398), mark as TestOnly?

Comment 42 Phil Sutter 2022-06-17 12:56:53 UTC
The problem is still somewhat work in progress upstream as the accepted
solution is incomplete, may require attention as new keywords are added and
becomes increasingly complicated to maintain the more keywords are protected
from misinterpretation.

I'll still assume this is "good enough" in v1.0.4 so setting Fixed In Version
field accordingly and setting up for QE to decide whether it fails QA or not.

Comment 52 errata-xmlrpc 2022-11-15 11:22:16 UTC
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 (nftables bug fix and enhancement update), 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/RHBA-2022:8381


Note You need to log in before you can comment on or make changes to this bug.