Skip to content
Commit 73451e9a authored by Abhishek Chauhan's avatar Abhishek Chauhan Committed by Jakub Kicinski
Browse files

net: validate SO_TXTIME clockid coming from userspace

Currently there are no strict checks while setting SO_TXTIME
from userspace. With the recent development in skb->tstamp_type
clockid with unsupported clocks results in warn_on_once, which causes
unnecessary aborts in some systems which enables panic on warns.

Add validation in setsockopt to support only CLOCK_REALTIME,
CLOCK_MONOTONIC and CLOCK_TAI to be set from userspace.

Link: https://lore.kernel.org/netdev/bc037db4-58bb-4861-ac31-a361a93841d3@linux.dev/
Link: https://lore.kernel.org/lkml/6bdba7b6-fd22-4ea5-a356-12268674def1@quicinc.com/


Fixes: 1693c5db ("net: Add additional bit to support clockid_t timestamp type")
Reported-by: default avatar <syzbot+d7b227731ec589e7f4f0@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=d7b227731ec589e7f4f0


Reported-by: default avatar <syzbot+30a35a2e9c5067cc43fa@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=30a35a2e9c5067cc43fa


Signed-off-by: default avatarAbhishek Chauhan <quic_abchauha@quicinc.com>
Acked-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20240529183130.1717083-1-quic_abchauha@quicinc.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent d1f9e651
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment