Skip to content
Snippets Groups Projects
Commit d86961ff authored by Eric Dumazet's avatar Eric Dumazet Committed by Frieder Schrempf
Browse files

net/sched: taprio: always validate TCA_TAPRIO_ATTR_PRIOMAP


[ Upstream commit f921a58a ]

If one TCA_TAPRIO_ATTR_PRIOMAP attribute has been provided,
taprio_parse_mqprio_opt() must validate it, or userspace
can inject arbitrary data to the kernel, the second time
taprio_change() is called.

First call (with valid attributes) sets dev->num_tc
to a non zero value.

Second call (with arbitrary mqprio attributes)
returns early from taprio_parse_mqprio_opt()
and bad things can happen.

Fixes: a3d43c0d ("taprio: Add support adding an admin schedule")
Reported-by: default avatarNoam Rathaus <noamr@ssd-disclosure.com>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20240604181511.769870-1-edumazet@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 74d0cc69
No related branches found
No related tags found
1 merge request!157🤖 Sync Bot: Update v6.1-ktn to Latest Stable Kernel (v6.1.97)
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment