lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250224142104.14f44a27@kernel.org>
Date: Mon, 24 Feb 2025 14:21:04 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
 pabeni@...hat.com, kerneljasonxing@...il.com, pav@....fi,
 gerhard@...leder-embedded.com, vinicius.gomes@...el.com,
 anthony.l.nguyen@...el.com, Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net-next] net: skb: free up one bit in tx_flags

On Thu, 20 Feb 2025 22:58:20 -0500 Willem de Bruijn wrote:
> The linked series wants to add skb tx completion timestamps.
> That needs a bit in skb_shared_info.tx_flags, but all are in use.
> 
> A per-skb bit is only needed for features that are configured on a
> per packet basis. Per socket features can be read from sk->sk_tsflags.
> 
> Per packet tsflags can be set in sendmsg using cmsg, but only those in
> SOF_TIMESTAMPING_TX_RECORD_MASK.
> 
> Per packet tsflags can also be set without cmsg by sandwiching a
> send inbetween two setsockopts:
> 
>     val |= SOF_TIMESTAMPING_$FEATURE;
>     setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING, &val, sizeof(val));
>     write(fd, buf, sz);
>     val &= ~SOF_TIMESTAMPING_$FEATURE;
>     setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING, &val, sizeof(val));
> 
> Changing a datapath test from skb_shinfo(skb)->tx_flags to
> skb->sk->sk_tsflags can change behavior in that case, as the tx_flags
> is written before the second setsockopt updates sk_tsflags.
> 
> Therefore, only bits can be reclaimed that cannot be set by cmsg and
> are also highly unlikely to be used to target individual packets
> otherwise.
> 
> Free up the bit currently used for SKBTX_HW_TSTAMP_USE_CYCLES. This
> selects between clock and free running counter source for HW TX
> timestamps. It is probable that all packets of the same socket will
> always use the same source.

This needs a respin, presumably because Jason's series reached net-next
already.
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ