Re: [PATCH] tee: optee: allocate a bitmap for all valid notification keys
From: Jens Wiklander
Date: Thu Nov 05 2026 - 05:52:16 EST
Hi,
On Mon, Oct 19, 2026 at 1:48 PM Sumit Garg <sumit.garg@xxxxxxxxxx> wrote:
>
> On Fri, 09 Oct 2026 at 20:19:48 -0700, Amirreza Zarrabi wrote:
> >Notification keys are checked against an inclusive maximum, but
> >optee_notif_init() passes that maximum to bitmap_zalloc() as the number of
> >bits. The bitmap is therefore one bit short. When the maximum key is a
> >multiple of BITS_PER_LONG, accessing that key reads or writes beyond the
> >allocated bitmap. Word rounding masks the problem.
> >
> >Allocate max_key + 1 bits so that the highest valid key has storage.
> >
> >Fixes: 787c80cc7b22 ("optee: separate notification functions")
> >Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@xxxxxxxxxxxxxxxx>
> >---
> > drivers/tee/optee/notif.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Sumit Garg <sumit.garg@xxxxxxxxxxxxxxxx>
I'm picking this up.
Cheers,
Jens