Commit abdf4ae
setsockopt08: Handle EPERM from disabled compat xtables in userns
Since kernel commit ec1806a730a1 ("netfilter: x_tables: disable
32bit compat interface in user namespaces"), the compat xtables ABI
returns EPERM when called from inside a non-init user namespace,
regardless of privileges held there. Since the test isolates itself
with tst_setup_netns(), it always hits this path on 32-bit/compat
runs and can no longer reach the CVE-2021-22555 code path
setsockopt08.c:139: TFAIL: setsockopt(3, IPPROTO_IP, IPT_SO_SET_REPLACE, 0xf7f0c800, 1): EPERM (1)
So treat EPERM as TCONF instead of TFAIL.
Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
Link: https://lore.kernel.org/20260828095724.194900-1-avinesh.kumar@suse.com1 parent 8d81c77 commit abdf4ae
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
| |||
135 | 142 | | |
136 | 143 | | |
137 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
138 | 150 | | |
139 | 151 | | |
140 | 152 | | |
| |||
163 | 175 | | |
164 | 176 | | |
165 | 177 | | |
| 178 | + | |
166 | 179 | | |
167 | 180 | | |
168 | 181 | | |
| |||
0 commit comments