[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZwY/3SegtYrbcSLd@gauss3.secunet.de>
Date: Wed, 9 Oct 2024 10:33:33 +0200
From: Steffen Klassert <steffen.klassert@...unet.com>
To: Sabrina Dubroca <sd@...asysnail.net>
CC: <netdev@...r.kernel.org>,
<syzbot+cc39f136925517aed571@...kaller.appspotmail.com>
Subject: Re: [PATCH ipsec] xfrm: validate new SA's prefixlen using SA family
when sel.family is unset
On Tue, Oct 01, 2024 at 06:48:14PM +0200, Sabrina Dubroca wrote:
> This expands the validation introduced in commit 07bf7908950a ("xfrm:
> Validate address prefix lengths in the xfrm selector.")
>
> syzbot created an SA with
> usersa.sel.family = AF_UNSPEC
> usersa.sel.prefixlen_s = 128
> usersa.family = AF_INET
>
> Because of the AF_UNSPEC selector, verify_newsa_info doesn't put
> limits on prefixlen_{s,d}. But then copy_from_user_state sets
> x->sel.family to usersa.family (AF_INET). Do the same conversion in
> verify_newsa_info before validating prefixlen_{s,d}, since that's how
> prefixlen is going to be used later on.
>
> Reported-by: syzbot+cc39f136925517aed571@...kaller.appspotmail.com
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Sabrina Dubroca <sd@...asysnail.net>
Applied, thanks a lot Sabrina!
Powered by blists - more mailing lists