Re: [PATCH v2] xfrm: add NULL check in xfrm_update_ae_params

From: Steffen Klassert
Date: Tue Aug 01 2023 - 06:00:03 EST


On Fri, Jul 21, 2023 at 10:51:03PM +0800, Lin Ma wrote:
> Normally, x->replay_esn and x->preplay_esn should be allocated at
> xfrm_alloc_replay_state_esn(...) in xfrm_state_construct(...), hence the
> xfrm_update_ae_params(...) is okay to update them. However, the current
> implementation of xfrm_new_ae(...) allows a malicious user to directly
> dereference a NULL pointer and crash the kernel like below.

...

> This Null-ptr-deref bug is assigned CVE-2023-3772. And this commit
> adds additional NULL check in xfrm_update_ae_params to fix the NPD.
>
> Fixes: d8647b79c3b7 ("xfrm: Add user interface for esn and big anti-replay windows")
> Signed-off-by: Lin Ma <linma@xxxxxxxxxx>

Applied, thanks a lot!