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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a88c3486dafcc9e7a8cb5eecf14b6e6b93a13c65.camel@redhat.com>
Date:   Tue, 05 Sep 2023 11:59:32 +0200
From:   Paolo Abeni <pabeni@...hat.com>
To:     Marcello Sylvester Bauer <email@...r.kernel.org>,
        Steffen Klassert <steffen.klassert@...unet.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>
Cc:     Marcello Sylvester Bauer <sylv@...v.io>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/1] xfrm: Use skb_mac_header_was_set() to check for
 MAC header presence

On Mon, 2023-09-04 at 12:32 +0200, Marcello Sylvester Bauer wrote:
> From: Marcello Sylvester Bauer <sylv@...v.io>
> 
> Add skb_mac_header_was_set() in xfrm4_remove_tunnel_encap() and
> xfrm6_remove_tunnel_encap() to detect the presence of a MAC header.
> This change prevents a kernel page fault on a non-zero mac_len when the
> mac_header is not set.
> 
> Signed-off-by: Marcello Sylvester Bauer <sylv@...v.io>

Please include a suitable fixes tag.

Please also include in the commit message the stacktrace:

https://lore.kernel.org/netdev/636d3434-d47a-4cd4-b3ba-7f7254317b64@sylv.io/

trimming the asm code and lines starting with ' ? ' 

I think the real issue could be elsewhere, we should not reach here
with mac_len > 0 && !skb_mac_header_was_set().

Could you please try the following debug patch in your setup, and see
if hints at some other relevant place? 

Thanks,

Paolo

---
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 4174c4b82d13..38ca2c7e50ca 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2793,6 +2793,7 @@ static inline void skb_reset_inner_headers(struct sk_buff *skb)
 
 static inline void skb_reset_mac_len(struct sk_buff *skb)
 {
+	WARN_ON_ONCE(!skb_mac_header_was_set(skb));
 	skb->mac_len = skb->network_header - skb->mac_header;
 }
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ