Re: [PATCH v2] uprobes: Use flexible array for xol_area bitmap
From: Oleg Nesterov
Date: Wed Nov 11 2026 - 10:27:40 EST
On 11/10, Rosen Penev wrote:
>
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -108,7 +108,6 @@ static LIST_HEAD(delayed_uprobe_list);
> */
> struct xol_area {
> wait_queue_head_t wq; /* if all slots are busy */
> - unsigned long *bitmap; /* 0 = free slot */
>
> struct page *page;
> /*
> @@ -117,6 +116,7 @@ struct xol_area {
> * the vma go away, and we must handle that reasonably gracefully.
> */
> unsigned long vaddr; /* Page(s) of instruction slots */
> + unsigned long bitmap[]; /* 0 = free slot */
I agree with Peter, you can just use
unsigned long bitmap[BITS_TO_LONGS(UINSNS_PER_PAGE)];
Oleg.