Commit 1421e20f authored by Benedikt Spranger's avatar Benedikt Spranger Committed by Zheng Zengkai
Browse files

net/sched: taprio: Check if socket flags are valid

stable inclusion
from stable-v5.10.112
commit a44938950e5e12dd676ec2b38701b6d3c4e1a281
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5HL0X

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a44938950e5e12dd676ec2b38701b6d3c4e1a281



--------------------------------

[ Upstream commit e8a64bba ]

A user may set the SO_TXTIME socket option to ensure a packet is send
at a given time. The taprio scheduler has to confirm, that it is allowed
to send a packet at that given time, by a check against the packet time
schedule. The scheduler drop the packet, if the gates are closed at the
given send time.

The check, if SO_TXTIME is set, may fail since sk_flags are part of an
union and the union is used otherwise. This happen, if a socket is not
a full socket, like a request socket for example.

Add a check to verify, if the union is used for sk_flags.

Fixes: 4cfd5779 ("taprio: Add support for txtime-assist mode")
Signed-off-by: default avatarBenedikt Spranger <b.spranger@linutronix.de>
Reviewed-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
Acked-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent 29da03f5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment