TencentOS-kernel/net
Christian Eggers ba6a854e01 socket: don't clear SOCK_TSTAMP_NEW when SO_TIMESTAMPNS is disabled
commit 4e3bbb33e6f36e4b05be1b1b9b02e3dd5aaa3e69 upstream.

SOCK_TSTAMP_NEW (timespec64 instead of timespec) is also used for
hardware time stamps (configured via SO_TIMESTAMPING_NEW).

User space (ptp4l) first configures hardware time stamping via
SO_TIMESTAMPING_NEW which sets SOCK_TSTAMP_NEW. In the next step, ptp4l
disables SO_TIMESTAMPNS(_NEW) (software time stamps), but this must not
switch hardware time stamps back to "32 bit mode".

This problem happens on 32 bit platforms were the libc has already
switched to struct timespec64 (from SO_TIMExxx_OLD to SO_TIMExxx_NEW
socket options). ptp4l complains with "missing timestamp on transmitted
peer delay request" because the wrong format is received (and
discarded).

Fixes: 887feae36aee ("socket: Add SO_TIMESTAMP[NS]_NEW")
Fixes: 783da70e8396 ("net: add sock_enable_timestamps")
Signed-off-by: Christian Eggers <ceggers@arri.de>
Acked-by: Willem de Bruijn <willemb@google.com>
Acked-by: Deepa Dinamani <deepa.kernel@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-16 16:39:27 +08:00
..
6lowpan Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
9p net/9p: validate fds in p9_fd_open 2021-03-16 16:33:05 +08:00
802 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
8021q Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
appletalk appletalk: Fix atalk_proc_init() return path 2021-03-16 16:33:09 +08:00
atm atm: fix a memory leak of vcc->user_back 2021-03-16 16:37:15 +08:00
ax25 AX.25: Prevent integer overflows in connect and sendmsg 2021-03-16 16:32:42 +08:00
batman-adv batman-adv: mcast: fix duplicate mcast packets from BLA backbone to mesh 2021-03-16 16:37:35 +08:00
bluetooth Bluetooth: Only mark socket zapped after unlocking 2021-03-16 16:39:20 +08:00
bpf Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
bpfilter net/bpfilter: remove superfluous testing message 2021-03-16 16:26:23 +08:00
bridge netfilter: ebtables: Fixes dropping of small packets in bridge nat 2021-03-16 16:39:05 +08:00
caif Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
can net: j1939: j1939_session_fresh_new(): fix missing initialization of skbcnt 2021-03-16 16:38:14 +08:00
ceph libceph: don't omit recovery_deletes in target_copy() 2021-03-16 16:32:16 +08:00
core socket: don't clear SOCK_TSTAMP_NEW when SO_TIMESTAMPNS is disabled 2021-03-16 16:39:27 +08:00
dcb net: DCB: Validate DCB_ATTR_DCB_BUFFER argument 2021-03-16 16:36:26 +08:00
dccp dccp: Fix possible memleak in dccp_init and dccp_fini 2021-03-16 16:29:07 +08:00
decnet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dns_resolver KEYS: Don't write out to userspace while holding key semaphore 2021-03-16 16:26:42 +08:00
dsa dsa: Allow forwarding of redirected IGMP traffic 2021-03-16 16:36:11 +08:00
ethernet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hsr hsr: check protocol version in hsr_newlink() 2021-03-16 16:26:20 +08:00
ieee802154 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ife Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ipv4 ip_gre: set dev->hard_header_len and dev->needed_headroom properly 2021-03-16 16:39:16 +08:00
ipv6 netfilter: nf_log: missing vlan offload tag and proto 2021-03-16 16:38:46 +08:00
iucv Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
kcm Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
key af_key: pfkey_dump needs parameter validation 2021-03-16 16:36:23 +08:00
l2tp l2tp: remove skb_dst_set() from l2tp_xmit_skb() 2021-03-16 16:31:43 +08:00
l3mdev Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
lapb Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
llc net: silence data-races on sk_backlog.tail 2021-03-16 16:36:36 +08:00
mac80211 mac80211: handle lack of sband->bitrates in rates 2021-03-16 16:39:16 +08:00
mac802154 mac802154: tx: fix use-after-free 2021-03-16 16:37:33 +08:00
mpls Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ncsi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
netfilter netfilter: nftables_offload: KASAN slab-out-of-bounds Read in nft_flow_rule_create 2021-03-16 16:39:27 +08:00
netlabel netlabel: fix problems with mapping removal 2021-03-16 16:35:46 +08:00
netlink genetlink: remove genl_bind 2021-03-16 16:31:42 +08:00
netrom net: netrom: Fix potential nr_neigh refcnt leak in nr_add_node 2021-03-16 16:26:51 +08:00
nfc nfc: Ensure presence of NFC_ATTR_FIRMWARE_NAME attribute in nfc_genl_fw_download() 2021-03-16 16:38:18 +08:00
nsh Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
openvswitch openvswitch: handle DNAT tuple collision 2021-03-16 16:38:00 +08:00
packet af_packet: TPACKET_V3: fix fill status rwlock imbalance 2021-03-16 16:33:48 +08:00
phonet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
psample Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
qrtr net: qrtr: check skb_put_padto() return value 2021-03-16 16:36:30 +08:00
rds rds: Prevent kernel-infoleak in rds_notify_queue_get() 2021-03-16 16:32:48 +08:00
rfkill Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rose Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rxrpc rxrpc: Fix server keyring leak 2021-03-16 16:38:05 +08:00
sched net/sched: act_tunnel_key: fix OOB write in case of IPv6 ERSPAN tunnels 2021-03-16 16:38:17 +08:00
sctp sctp: fix sctp_auth_init_hmacs() error path 2021-03-16 16:38:00 +08:00
smc net/smc: fix valid DMBE buffer sizes 2021-03-16 16:38:13 +08:00
strparser Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sunrpc SUNRPC: fix copying of multiple pages in gss_read_proxy_verf() 2021-03-16 16:39:03 +08:00
switchdev Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tipc tipc: fix the skb_unshare() in tipc_buf_append() 2021-03-16 16:38:13 +08:00
tls net/tls: sendfile fails with ktls offload 2021-03-16 16:38:13 +08:00
toa Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
unix skbuff: fix a data race in skb_queue_len() 2021-03-16 16:36:50 +08:00
vmw_vsock net: virtio_vsock: Enhance connection semantics 2021-03-16 16:37:43 +08:00
wimax Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
wireless nl80211: fix non-split wiphy information 2021-03-16 16:38:45 +08:00
x25 net/x25: Fix null-ptr-deref in x25_disconnect 2021-03-16 16:32:48 +08:00
xdp xdp: Fix xsk_generic_xmit errno 2021-03-16 16:30:35 +08:00
xfrm xfrm: Use correct address family in xfrm_state_find 2021-03-16 16:38:02 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
compat.c net/compat: Add missing sock updates for SCM_RIGHTS 2021-03-16 16:34:05 +08:00
socket.c net: Set fput_needed iff FDPUT_FPUT is set 2021-03-16 16:33:49 +08:00
sysctl_net.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00