Segfault when using simple set in named map

Bug #1981965 reported by Tobias Bossert
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nftables (Ubuntu)
New
Undecided
Unassigned

Bug Description

Considering this minimal example:

```
#!/usr/sbin/nft -f

define l = {
    192.168.22.24,
    192.168.22.25
}

table t1 {

    # the definition of this map causes a segementation fault
    map snat_table {
        type ipv4_addr : ipv4_addr
        flags interval
        counter
        elements = {
                192.168.22.23 : 86.12.22.23,
                $l : 86.12.22.24
        }
    }

    chain c2 {
            type nat hook postrouting priority srcnat;

            oif wan1 snat to ip saddr map @snat_table

            # while using an anonymous map seems to work fine
            oif wan1 snat to ip saddr map {
                192.168.22.23 : 86.12.22.22,
                $l : 86.12.22.24
            }
    }

}

```

Expected outcome: Either an error that this is syntactically incorrect or that it works in named and anonymous maps

Actual outcome: Segmentation fault

Package name version: 1.0.2-1ubuntu2
OS release: Ubuntu 22.04 LTS
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
CasperMD5CheckResult: pass
DistroRelease: Ubuntu 22.04
InstallationDate: Installed on 2022-06-27 (20 days ago)
InstallationMedia: Ubuntu-Server 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220421)
Package: nftables 1.0.2-1ubuntu2
PackageArchitecture: amd64
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 5.15.0-40.43-generic 5.15.35
RebootRequiredPkgs: Error: path contained symlinks.
Tags: jammy uec-images
Uname: Linux 5.15.0-40-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: N/A
_MarkForUpload: True
modified.conffile..etc.nftables.conf: [modified]
mtime.conffile..etc.nftables.conf: 2022-07-14T09:50:47.005709

Revision history for this message
Aaron Rainbolt (arraybolt3) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command only once, as it will automatically gather debugging information, in a terminal:
apport-collect 1981965

When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

Revision history for this message
Tobias Bossert (tobib) wrote : Dependencies.txt

apport information

tags: added: apport-collected jammy uec-images
description: updated
Revision history for this message
Tobias Bossert (tobib) wrote : ProcCpuinfoMinimal.txt

apport information

Tobias Bossert (tobib)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.