diff options
| author | Ruoyu Wang <ruoyuw560@gmail.com> | 2026-08-14 21:40:53 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-08-20 11:32:44 -0700 |
| commit | b74a072d8fb71d3c9ffba4a17d5943e63266fb38 (patch) | |
| tree | b09913a168cadac0703c463322acebf51fa228ef /include | |
| parent | e37b2abca80473e106176e41712a369fd2f72117 (diff) | |
| download | linux-b74a072d8fb71d3c9ffba4a17d5943e63266fb38.tar.gz linux-b74a072d8fb71d3c9ffba4a17d5943e63266fb38.zip | |
net: bridge: Reject descending VLAN tunnel ranges
A pair of descending VLAN and tunnel IDs can pass the tunnel range span
check. The VLAN subtraction produces a negative int, which is converted
to unsigned when compared with the u32 tunnel ID subtraction. It can
therefore equal the wrapped tunnel ID delta.
The range loop then performs no iterations. Since the batched
notification handling added a post-loop error check, this leaves err
uninitialized and makes the request's return value unpredictable.
Reject descending VLAN ranges before comparing the spans. Valid
ascending and single-entry ranges remain unchanged, while malformed
descending ranges consistently return -EINVAL.
This issue was found by a static analysis checker and confirmed by
manual source review.
Fixes: 94339443686b ("net: bridge: notify on vlan tunnel changes done via the old api")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/20260814134053.1387275-1-ruoyuw560@gmail.com
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
