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]
Date: Tue, 23 May 2023 09:21:41 -0600
From: David Ahern <dsahern@...nel.org>
To: Gavrilov Ilia <Ilia.Gavrilov@...otecs.ru>,
 "David S. Miller" <davem@...emloft.net>
Cc: Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, Vlad Yasevich <vyasevic@...hat.com>,
 "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
 "lvc-project@...uxtesting.org" <lvc-project@...uxtesting.org>
Subject: Re: [PATCH net] ipv6: Fix out-of-bounds access in ipv6_find_tlv()

On 5/23/23 2:29 AM, Gavrilov Ilia wrote:
> optlen is fetched without checking whether there is more than one byte to parse.
> It can lead to out-of-bounds access.
> 
> Found by InfoTeCS on behalf of Linux Verification Center
> (linuxtesting.org) with SVACE.
> 
> Fixes: 3c73a0368e99 ("ipv6: Update ipv6 static library with newly needed functions")

That is not the right Fixes tag; that commit only moved the code.

Fixes: c61a40432509 ("[IPV6]: Find option offset by type.")

> Signed-off-by: Gavrilov Ilia <Ilia.Gavrilov@...otecs.ru>
> ---
>  net/ipv6/exthdrs_core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c
> index da46c4284676..49e31e4ae7b7 100644
> --- a/net/ipv6/exthdrs_core.c
> +++ b/net/ipv6/exthdrs_core.c
> @@ -143,6 +143,8 @@ int ipv6_find_tlv(const struct sk_buff *skb, int offset, int type)
>  			optlen = 1;
>  			break;
>  		default:
> +			if (len < 2)
> +				goto bad;
>  			optlen = nh[offset + 1] + 2;
>  			if (optlen > len)
>  				goto bad;

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ