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 1653562 - [RHEL8] iptables v1.8.1 (nf_tables): realm: could not map name to integer
Summary: [RHEL8] iptables v1.8.1 (nf_tables): realm: could not map name to integer
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: iptables
Version: 8.0
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: 8.1
Assignee: Phil Sutter
QA Contact: Jiri Peska
URL:
Whiteboard:
Depends On: 1682316
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-27 06:37 UTC by yiche
Modified: 2020-11-14 10:03 UTC (History)
5 users (show)

Fixed In Version: iptables-1.8.2-10.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-05 22:17:43 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2019:3573 0 None None None 2019-11-05 22:17:52 UTC

Description yiche 2018-11-27 06:37:21 UTC
Description of problem:
iptables v1.8.1 (nf_tables): realm: could not map name -0x1/0xffff to an integer value for option "--realm".

Version-Release number of selected component (if applicable):
iptables-1.8.1-2.el8.x86_64
kernel-4.18.0-40.el8.x86_64


How reproducible:
always

Steps to Reproduce:
#iptables -A INPUT -i lo -p tcp -m realm  --realm -0x1/0xffff -j DROP
iptables v1.8.1 (nf_tables): realm: could not map name -0x1/0xffff to an integer value for option "--realm".

Actual results:


Expected results:
The rule should add success.

Additional info:

Comment 1 Phil Sutter 2018-11-29 14:48:29 UTC
Hi Yiche,

(In reply to yiche from comment #0)
> Description of problem:
> iptables v1.8.1 (nf_tables): realm: could not map name -0x1/0xffff to an
> integer value for option "--realm".
> 
> Version-Release number of selected component (if applicable):
> iptables-1.8.1-2.el8.x86_64
> kernel-4.18.0-40.el8.x86_64
> 
> 
> How reproducible:
> always
> 
> Steps to Reproduce:
> #iptables -A INPUT -i lo -p tcp -m realm  --realm -0x1/0xffff -j DROP
> iptables v1.8.1 (nf_tables): realm: could not map name -0x1/0xffff to an
> integer value for option "--realm".

Is this a typo or do you really try to match on a negative realm value? Looking at the code, this seems not to be supported.

Cheers, Phil

Comment 2 yiche 2018-11-30 02:10:29 UTC
But this behavior is different from RHEL7:
iptables -A INPUT -i lo -p tcp -m realm  --realm -0x1/0xffff -j DROP
iptables -A INPUT -i lo -p tcp -m realm  --realm 0x1/0xffff -j DROP
# iptables -nvL
Chain INPUT (policy ACCEPT 28 packets, 1960 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       tcp  --  lo     *       0.0.0.0/0            0.0.0.0/0            realm 0xffffffff/0xffff
    0     0 DROP       tcp  --  lo     *       0.0.0.0/0            0.0.0.0/0            realm 0x1/0xffff
I think we should follow the behavior.Or give a explain in document.

Comment 3 Phil Sutter 2018-12-03 13:56:53 UTC
Hi Yiche,

(In reply to yiche from comment #2)
> But this behavior is different from RHEL7:
> iptables -A INPUT -i lo -p tcp -m realm  --realm -0x1/0xffff -j DROP
> iptables -A INPUT -i lo -p tcp -m realm  --realm 0x1/0xffff -j DROP
> # iptables -nvL
> Chain INPUT (policy ACCEPT 28 packets, 1960 bytes)
>  pkts bytes target     prot opt in     out     source              
> destination         
>     0     0 DROP       tcp  --  lo     *       0.0.0.0/0           
> 0.0.0.0/0            realm 0xffffffff/0xffff
>     0     0 DROP       tcp  --  lo     *       0.0.0.0/0           
> 0.0.0.0/0            realm 0x1/0xffff
> I think we should follow the behavior.Or give a explain in document.

It is actually a bug in older iptables shipped with RHEL7, the value should not be accepted. Recent iptables rejects the negative value both in legacy and nft variant, so this is intended behaviour.

I sent an enhancement to realm match documentation upstream:

https://marc.info/?l=netfilter-devel&m=154384516505389&w=2

Comment 4 Phil Sutter 2018-12-06 17:21:39 UTC
Upstream commit to backport:

commit 290d76b443bf24999d9caacb3fdd027d6e7112a1
Author: Phil Sutter <phil>
Date:   Mon Dec 3 14:52:28 2018 +0100

    extensions: libipt_realm: Document allowed realm values
    
    Older versions of iptables allowed for negative realm values by accident
    (they would be cast to unsigned). While this was clearly a bug, document
    the fixed behaviour.
    
    Signed-off-by: Phil Sutter <phil>
    Signed-off-by: Pablo Neira Ayuso <pablo>

Comment 5 yiche 2018-12-07 03:01:23 UTC
I file a new bug for RHEL7: Bug 1657075

Comment 6 Phil Sutter 2018-12-12 12:33:58 UTC
Hi Yiche,

(In reply to yiche from comment #5)
> I file a new bug for RHEL7: Bug 1657075

Thanks for that!

Comment 8 Phil Sutter 2019-01-24 10:53:27 UTC
Merely a documentation issue, therefore moving to 8.1.

Comment 12 errata-xmlrpc 2019-11-05 22:17:43 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, 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-2019:3573


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