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]
Date: Fri, 15 Mar 2024 08:55:01 -0600
From: David Ahern <dsahern@...nel.org>
To: Tobias Brunner <tobias@...ongswan.org>, nicolas.dichtel@...nd.com,
 "David S. Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org, Steffen Klassert <steffen.klassert@...unet.com>,
 Herbert Xu <herbert@...dor.apana.org.au>
Subject: Re: [PATCH net] ipv4: raw: Fix sending packets from raw sockets via
 IPsec tunnels

On 3/15/24 8:31 AM, Tobias Brunner wrote:
>>> diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
>>> index 42ac434cfcfa..322e389021c3 100644
>>> --- a/net/ipv4/raw.c
>>> +++ b/net/ipv4/raw.c
>>> @@ -357,6 +357,7 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4,
>>>  		goto error;
>>>  	skb_reserve(skb, hlen);
>>>  
>>> +	skb->protocol = htons(ETH_P_IP);
>>>  	skb->priority = READ_ONCE(sk->sk_priority);
>>>  	skb->mark = sockc->mark;
>>>  	skb->tstamp = sockc->transmit_time;
>> For !ipsec packet, dst_output()/ ip_output() is called. This last function set
>> skb->protocol to htons(ETH_P_IP).
>> What about doing the same in xfrm4_output() to avoid missing another path?
> 
> I took this approach because it worked and it aligns the code with the
> IPv6 version.

I agree with that; setting it in raw_send_hdrinc makes it consistent
across protocols.


Reviewed-by: David Ahern <dsahern@...nel.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ