]> git.baikalelectronics.ru Git - kernel.git/commit
net/sched: taprio: Check if socket flags are valid
authorBenedikt Spranger <b.spranger@linutronix.de>
Fri, 8 Apr 2022 09:47:45 +0000 (11:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:34:10 +0000 (09:34 +0200)
commit06c92abb073acff23efdda87bfc11f7642a77c92
treee68cc0ed29ecbe6489f7b59edae39ec40adf1b60
parentadc324e2f2fac07239da27100243ee6e80383533
net/sched: taprio: Check if socket flags are valid

[ Upstream commit 165ac455b1616f853104f7409a65c95c67638998 ]

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: 9a4c7b86ac5d ("taprio: Add support for txtime-assist mode")
Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sched/sch_taprio.c