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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250813175740.4c24e747@kernel.org>
Date: Wed, 13 Aug 2025 17:57:40 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Stanislav Fomichev <sdf@...ichev.me>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
 pabeni@...hat.com, ayush.sawal@...lsio.com, andrew+netdev@...n.ch,
 gregkh@...uxfoundation.org, horms@...nel.org, dsahern@...nel.org,
 pablo@...filter.org, kadlec@...filter.org, steffen.klassert@...unet.com,
 mhal@...x.co, abhishektamboli9@...il.com, linux-kernel@...r.kernel.org,
 linux-staging@...ts.linux.dev, netfilter-devel@...r.kernel.org,
 coreteam@...filter.org, herbert@...dor.apana.org.au
Subject: Re: [PATCH net-next 1/7] net: Add skb_dst_reset and skb_dst_restore

On Tue, 12 Aug 2025 08:52:39 -0700 Stanislav Fomichev wrote:
> +/**
> + * skb_dst_reset() - return current dst_entry value and clear it
> + * @skb: buffer
> + *
> + * Resets skb dst_entry without adjusting its reference count. Useful in
> + * cases where dst_entry needs to be temporarily reset and restored.
> + * Note that the returned value cannot be used directly because it
> + * might contain SKB_DST_NOREF bit.
> + *
> + * When in doubt, prefer skb_dst_drop() over skb_dst_reset() to correctly
> + * handle dst_entry reference counting.

thoughts on prefixing these two new helpers with __ to hint that
they are low level and best avoided?

> + *
> + * Returns: original skb dst_entry.
> + */
> +static inline unsigned long skb_dst_reset(struct sk_buff *skb)
> +{
> +	unsigned long refdst = skb->_skb_refdst;
> +
> +	skb->_skb_refdst = 0;
> +	return refdst;
> +}
> +
> +/**
> + * skb_dst_restore() - restore skb dst_entry saved via skb_dst_reset

saved -> removed ?
Also I think for better kdoc linking it's good to add () after function
names

> + * @skb: buffer

kdoc missing for refdst

> + */
> +static inline void skb_dst_restore(struct sk_buff *skb, unsigned long refdst)
> +{
> +	skb->_skb_refdst = refdst;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ