net: atm: reject out-of-range traffic classes in QoS validation
Subsystems (3)
PATCH 1/1 net: atm: reject out-of-range traffic classes in QoS validation
In reply to a message not in the archiveFrom: Zhengchuan Liang <[email protected]>
Reject ATM traffic classes above ATM_ANYCLASS in check_tp(). SO_ATMQOS stores the supplied QoS after check_qos() succeeds, so accepting larger values leaves invalid traffic_class values in vcc->qos.
That bad state later reaches pvc_info(), which indexes class_name[] with vcc->qos.{rx,tp}.traffic_class. Values above ATM_ANYCLASS cause an out-of-bounds read when /proc/net/atm/pvc is read.
Tighten the existing QoS validation so invalid traffic_class values are rejected at the point where user supplied QoS is accepted.
--- net/atm/common.c | 2 ++ 1 file changed, 2 insertions(+)
net/atm/common.c +2 -0
@@ -720,6 +720,8 @@ static int atm_change_qos(struct atm_vcc *vcc, struct atm_qos *qos)static int check_tp (const struct atm_trafprm *tp) {/* @@@ Should be merged with adjust_tp */ +if (tp->traffic_class >ATM_ANYCLASS ) +return -EINVAL ;if (!tp->traffic_class || tp->traffic_class ==ATM_ANYCLASS )return 0 ; if (tp->traffic_class != ATM_UBR && !tp->min_pcr && !tp->pcr &&
Signature · 1 line
2.47.3
Quoted 14 lines · Ren Wei
From: Zhengchuan Liang <[email protected]>
Reject ATM traffic classes above
ATM_ANYCLASSincheck_tp().SO_ATMQOSstores the supplied QoS aftercheck_qos()succeeds, so accepting larger values leaves invalidtraffic_classvalues invcc->qos.That bad state later reaches
pvc_info(), which indexes class_name[] with vcc->qos.{rx,tp}.traffic_class. Values aboveATM_ANYCLASScause an out-of-bounds read when/proc/net/atm/pvcis read.Tighten the existing QoS validation so invalid
traffic_classvalues are rejected at the point where user supplied QoS is accepted.
Quoted 7 lines
Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")Reported-by Yuan Tan <[email protected]>Reported-by Xin Liu <[email protected]>Assisted-by Codex:GPT-5.4Signed-off-by Zhengchuan Liang <[email protected]>Signed-off-by Ren Wei <[email protected]>
I believe the issue flagged by AI-generated review on
https://netdev-ai.bots.linux.dev/sashiko/ is a false positive.
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Tue, 9 Jun 2026 16:34:37 +0800 you wrote:
From: Zhengchuan Liang <[email protected]>
Reject ATM traffic classes above
ATM_ANYCLASSincheck_tp().SO_ATMQOSstores the supplied QoS aftercheck_qos()succeeds, so accepting larger values leaves invalidtraffic_classvalues invcc->qos.[...]
Here is the summary with links:
- [net,1/1] net: atm: reject out-of-range traffic classes in QoS validation
https://git.kernel.org/netdev/net/c/cdf19f380e46
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html