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: <1E956CBE-882F-4316-B6F2-FF2B357DDC8E@oracle.com>
Date: Tue, 8 Oct 2024 17:11:34 +0000
From: Sherry Yang <sherry.yang@...cle.com>
To: Greg KH <gregkh@...uxfoundation.org>
CC: linux-stable <stable@...r.kernel.org>,
        "sashal@...nel.org"
	<sashal@...nel.org>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "roopa@...dia.com"
	<roopa@...dia.com>,
        "nikolay@...dia.com" <nikolay@...dia.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "bridge@...ts.linux-foundation.org" <bridge@...ts.linux-foundation.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH 5.15.y 1/2] net: add pskb_may_pull_reason() helper

Hi Greg,

> On Oct 8, 2024, at 3:36 AM, Greg KH <gregkh@...uxfoundation.org> wrote:
> 
> On Fri, Oct 04, 2024 at 10:03:27AM -0700, Sherry Yang wrote:
>> From: Eric Dumazet <edumazet@...gle.com>
>> 
>> [ Upstream commit 1fb2d41501f38192d8a19da585cd441cf8845697 ]
>> 
>> pskb_may_pull() can fail for two different reasons.
>> 
>> Provide pskb_may_pull_reason() helper to distinguish
>> between these reasons.
>> 
>> It returns:
>> 
>> SKB_NOT_DROPPED_YET           : Success
>> SKB_DROP_REASON_PKT_TOO_SMALL : packet too small
>> SKB_DROP_REASON_NOMEM         : skb->head could not be resized
>> 
>> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
>> Reviewed-by: David Ahern <dsahern@...nel.org>
>> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
>> Stable-dep-of: 8bd67ebb50c0 ("net: bridge: xmit: make sure we have at least eth header len bytes")
>> Signed-off-by: Sasha Levin <sashal@...nel.org>
>> [Sherry: bp to 5.15.y. Minor conflicts due to missing commit
>> d427c8999b07 ("net-next: skbuff: refactor pskb_pull") which is not
>> necessary in 5.15.y. Ignore context change.
>> Signed-off-by: Sherry Yang <sherry.yang@...cle.com>
>> ---
>> include/linux/skbuff.h | 19 +++++++++++++++----
>> 1 file changed, 15 insertions(+), 4 deletions(-)
>> 
>> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
>> index b230c422dc3b..f92e8fe4f5eb 100644
>> --- a/include/linux/skbuff.h
>> +++ b/include/linux/skbuff.h
>> @@ -2465,13 +2465,24 @@ static inline void *pskb_pull(struct sk_buff *skb, unsigned int len)
>> return unlikely(len > skb->len) ? NULL : __pskb_pull(skb, len);
>> }
>> 
>> -static inline bool pskb_may_pull(struct sk_buff *skb, unsigned int len)
>> +static inline enum skb_drop_reason
>> +pskb_may_pull_reason(struct sk_buff *skb, unsigned int len)
>> {
>> if (likely(len <= skb_headlen(skb)))
>> - return true;
>> + return SKB_NOT_DROPPED_YET;
>> +
>> if (unlikely(len > skb->len))
>> - return false;
>> - return __pskb_pull_tail(skb, len - skb_headlen(skb)) != NULL;
>> + return SKB_DROP_REASON_PKT_TOO_SMALL;
>> +
>> + if (unlikely(!__pskb_pull_tail(skb, len - skb_headlen(skb))))
>> + return SKB_DROP_REASON_NOMEM;
>> +
>> + return SKB_NOT_DROPPED_YET;
>> +}
>> +
>> +static inline bool pskb_may_pull(struct sk_buff *skb, unsigned int len)
>> +{
>> + return pskb_may_pull_reason(skb, len) == SKB_NOT_DROPPED_YET;
>> }
>> 
>> void skb_condense(struct sk_buff *skb);
>> -- 
>> 2.46.0
>> 
>> 
> 
> Any specific reason why you didn't test build this patch?
> 
> It breaks the build into thousands of tiny pieces.

Sorry about the build failure. We have a branch which was forked from 5.15.y, and I did build and some smoke tests there. The build and smoke tests passed on our branch. However, I didn’t notice our branch backported prerequisite commits which made it diverge from linux-stable 5.15.y. I will apply the patch to upstream/linux-stable and build there before I send patch to upstream/linux-stable next time.

Sorry about the inconvenience.

Sherry
> 
> greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ