<html>
    <head>
      <base href="https://bugzilla.netfilter.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - nft check config causes segmentation fault when using variables for devices in the chain"
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1676">1676</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>nft check config causes segmentation fault when using variables for devices in the chain
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>nftables
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>1.0.x
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86_64
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Debian GNU/Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P5
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>nft
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>pablo@netfilter.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jinesh@onelittlehope.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Setup details:

  libnftables1:amd64           1.0.6-2
  libnftnl11:amd64             1.2.4-2
  nftables                     1.0.6-2

  Linux debianvm 6.1.0-7-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.20-2
(2023-04-08) x86_64 GNU/Linux

Reproduction steps:

1. Create a test.conf file containing:

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

define lan_interfaces = {eth0}
flush ruleset
table netdev filter {
  chain ingress {
    type filter hook ingress devices = $lan_interfaces priority -500; policy
accept;
  }
}
---snip---

2. Run nft -c -f test.conf

Expect no output as syntax is valid. Instead get a Segmentation fault.

Notes:

- I think the issue is that the lan_interfaces variable cannot have a single
element. It needs to have more than one element. e.g. define lan_interfaces =
{eth0,lo} works fine and no seg fault.

- I also found that define lan_interfaces = {{eth0}} doesn't generate a seg
fault.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>