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]
Message-ID: <20240903124607.GB17936@redhat.com>
Date: Tue, 3 Sep 2024 14:46:07 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Sven Schnelle <svens@...ux.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Mark Rutland <mark.rutland@....com>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	"Liang, Kan" <kan.liang@...ux.intel.com>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH] uprobes: use kzalloc to allocate xol area

On 09/03, Sven Schnelle wrote:
>
> To prevent unitialized members, use kzalloc to allocate
> the xol area.
>
> Signed-off-by: Sven Schnelle <svens@...ux.ibm.com>

Acked-by: Oleg Nesterov <oleg@...hat.com>

and since this looks easily exploitable, I'd sugest

Cc: stable@...r.kernel.org
Fixes: b059a453b1cf1 ("x86/vdso: Add mremap hook to vm_special_mapping")

> ---
>  kernel/events/uprobes.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> index 73cc47708679..50d7949be2b1 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -1489,7 +1489,7 @@ static struct xol_area *__create_xol_area(unsigned long vaddr)
>  	struct xol_area *area;
>  	void *insns;
>  
> -	area = kmalloc(sizeof(*area), GFP_KERNEL);
> +	area = kzalloc(sizeof(*area), GFP_KERNEL);
>  	if (unlikely(!area))
>  		goto out;
>  
> @@ -1499,7 +1499,6 @@ static struct xol_area *__create_xol_area(unsigned long vaddr)
>  		goto free_area;
>  
>  	area->xol_mapping.name = "[uprobes]";
> -	area->xol_mapping.fault = NULL;
>  	area->xol_mapping.pages = area->pages;
>  	area->pages[0] = alloc_page(GFP_HIGHUSER);
>  	if (!area->pages[0])
> -- 
> 2.43.0
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ