** Merge proposal linked: https://code.launchpad.net/~whershberger/ubuntu/+source/nftables/+git/nftables/+merge/515671 -- You received this bug notification because you are subscribed to linux in Ubuntu. Matching subscriptions: Bgg, Bmail, Nb https://bugs.launchpad.net/bugs/2175626 Title: [noble] 6.8.0-151-generic can't load certain nftable rulesets with intercal sets Status in linux package in Ubuntu: Invalid Status in nftables package in Ubuntu: Fix Released Status in linux source package in Noble: Invalid Status in nftables source package in Noble: In Progress Bug description: [ Impact ] On Ubuntu 24.04 (Noble) with kernel 6.8.0-151, 7.0.0-44, or later, nftables fails to load any rule that looks up a concatenated key containing a 1-byte selector in an interval set: Error: Could not process rule: Operation not supported Noble ships nftables 1.0.9, which emits a byteorder expression with len=2 and size=1 for 1-byte selectors in interval concatenations. Upstream kernel commit bb061d3de417 ("netfilter: nft_byteorder: remove multi-register support") added a check that rejects expressions where len != size with -EOPNOTSUPP. This upload backports upstream nftables commit 9fe58952c45a ("evaluate: skip byteorder conversion for selector smaller than 2 bytes"), which stops nftables from emitting that expression for selectors smaller than 2 bytes. [ Test Plan ] On a Noble machine running kernel 6.8.0-151, 7.0.0-44, or later: 1. With nftables 1.0.9-1ubuntu0.1 installed, run: nft add table inet t nft add chain inet t c nft add set inet t s '{ type inet_proto . inet_service; flags interval; }' nft add rule inet t c meta l4proto . th dport @s accept Confirm that the last command fails with "Operation not supported". 2. Install the nftables package with the patch and run the same four commands again. Confirm that the rule loads without error and appears in `nft list ruleset`. [ Where problems could occur ] This change modifies `byteorder_conversion()` in `src/evaluate.c`, which decides when to wrap selectors in a byteorder conversion for interval concatenations. On kernels older than 6.8.0-151 or 7.0.0-44 (without commit bb061d3de417), the patched package continues to work and matches packets the same way. On those kernels, the old `size=2, len=1` expression ran zero loop iterations (`1 / 2 == 0`) in `nft_byteorder_eval()` and did nothing, so omitting it does not change runtime behaviour. Tools or tests that inspect raw netlink bytecode from `nft --debug=netlink` will see one fewer `byteorder` expression for rules with 1-byte selectors in interval concatenations. [ Other Info ] Upstream nftables commit (included in nftables 1.1.0 and later): https://git.netfilter.org/nftables/commit/?id=9fe58952c45a1643dc7df1a0b1f5d88e8ae1a978 The upstream kernel commit bb061d3de417 explicitly warns that nftables versions before 1.1.0 will fail to load affected rulesets and references 9fe58952c45a as the fix. The kernel commit reached Noble in both linux 6.8.0-151 (LP: #2172890) and linux-hwe-7.0 7.0.0-44. Newer Ubuntu releases are not affected because they ship nftables 1.1.0 or later (Plucky 1.1.1, Questing 1.1.5, Resolute 1.1.6). Fixing nftables in Noble resolves the issue for all affected Noble kernels without carrying a kernel revert. [ Original Description ] cat /proc/version_signature Ubuntu 6.8.0-151.151-generic 6.8.12 lsb_release -rd No LSB modules are available. Description: Ubuntu 24.04.5 LTS Release: 24.04 The below nftables ruleset can't be loaded on noble with a kernel 6.8.0-151-generic. When booted into 6.8.0-149-generic it is possible. It seems that interval sets combined with meta fields are the trigger for this issue. root@nft-test:~# cat test.nft table inet testnew { set problem_set { typeof ip saddr . th dport . meta l4proto flags interval elements = { 10.0.0.0/8 . 22 . tcp } } chain in { type filter hook input priority filter + 10; ip saddr . th dport . meta l4proto @problem_set counter accept } } root@nft-test:~# nft -f test.nft test.nft:10:23-36: Error: Could not process rule: Operation not supported ip saddr . th dport . meta l4proto @problem_set counter accept ^^^^^^^^^^^^^^ I suspect "netfilter: nft_byteorder: remove multi-register support" from https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2172890 to have introduced this bug. The commit message of this patch says it will affect scenarios with interval set and follows with: Pablo Neira Ayuso points out that nftables before 1.1.0 can generate incorrect byteorder conversions, see 9fe58952c45a, "evaluate: skip byteorder conversion for selector smaller than 2 bytes" in nftables.git). Affected rulesets fail to load with this change and old userspace due to 'len != size' check. And as a matter of fact on noble we have nftables v1.0.9 On newer ubuntu versions with newer kernels and nftables > 1.1.0 i was NOT able to reproduce the problem. Happy to provide more information if needed. --- ProblemType: Bug AlsaDevices: total 0 crw-rw---- 1 root audio 116, 1 Nov 30 14:46 seq crw-rw---- 1 root audio 116, 33 Nov 30 14:46 timer AplayDevices: Error: [Errno 2] No such file or directory: 'aplay' ApportVersion: 2.28.3-0ubuntu0.1 Architecture: amd64 ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord' AudioDevicesInUse: Error: [Errno 2] No such file or directory: 'fuser' CRDA: N/A CasperMD5CheckResult: unknown CloudBuildName: minimal CloudSerial: 20240731 DistroRelease: Ubuntu 24.04 IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig' Lspci: Error: [Errno 2] No such file or directory: 'lspci' Lspci-vt: Error: [Errno 2] No such file or directory: 'lspci' Lsusb: Error: [Errno 2] No such file or directory: 'lsusb' Lsusb-t: Error: [Errno 2] No such file or directory: 'lsusb' Lsusb-v: Error: [Errno 2] No such file or directory: 'lsusb' MachineType: QEMU Standard PC (Q35 + ICH9, 2009) Package: linux (not installed) PciMultimedia: ProcEnviron: LANG=C.UTF-8 PATH=(custom, no user) SHELL=/bin/bash TERM=xterm-256color ProcFB: ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-6.8.0-151-generic root=PARTUUID=1c90e336-df09-49a1-9aab-dc17e4750c69 ro console=tty1 console=ttyS0 panic=-1 ProcVersionSignature: Ubuntu 6.8.0-151.151-generic 6.8.12 RelatedPackageVersions: linux-restricted-modules-6.8.0-151-generic N/A linux-backports-modules-6.8.0-151-generic N/A linux-firmware 20240318.git3b128b60.0ubuntu3.1 RfKill: Error: [Errno 2] No such file or directory: 'rfkill' Tags: cloud-image noble Uname: Linux 6.8.0-151-generic x86_64 UpgradeStatus: No upgrade log present (probably fresh install) UserGroups: N/A _MarkForUpload: True dmi.bios.date: 04/01/2014 dmi.bios.release: 0.0 dmi.bios.vendor: SeaBIOS dmi.bios.version: 1.16.3-debian-1.16.3-2 dmi.chassis.type: 1 dmi.chassis.vendor: QEMU dmi.chassis.version: pc-q35-4.2 dmi.modalias: dmi:bvnSeaBIOS:bvr1.16.3-debian-1.16.3-2:bd04/01/2014:br0.0:svnQEMU:pnStandardPC(Q35+ICH9,2009):pvrpc-q35-4.2:cvnQEMU:ct1:cvrpc-q35-4.2:sku: dmi.product.name: Standard PC (Q35 + ICH9, 2009) dmi.product.version: pc-q35-4.2 dmi.sys.vendor: QEMU To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2175626/+subscriptions
Комментариев нет:
Отправить комментарий