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: <D552F5D9-26A0-4584-8CEA-6E6E321D63E6@vmware.com>
Date:   Mon, 1 Jul 2019 17:49:35 +0000
From:   Nadav Amit <namit@...are.com>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "x86@...nel.org" <x86@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Andy Lutomirski <luto@...nel.org>
Subject: Re: [PATCH] x86/ldt: Initialize the context lock for init_mm

> On Jul 1, 2019, at 10:33 AM, Sebastian Andrzej Siewior <bigeasy@...utronix.de> wrote:
> 
> The mutex mm->context->lock for init_mm is not initialized for init_mm.
> This wasn't a problem because it remained unused. This changed however
> since commit
> 	4fc19708b165c ("x86/alternatives: Initialize temporary mm for patching")
> 
> Initialize the mutex for init_mm.
> 
> Fixes: 4fc19708b165c ("x86/alternatives: Initialize temporary mm for patching")
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> ---
> 
> The rwsem `ldt_usr_sem' is also not initialized for init_mm. No idea if
> we want this.

I cannot see why not (but it would need to depend on CONFIG_MODIFY_LDT_SYSCALL)

> 
> arch/x86/include/asm/mmu.h | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h
> index 5ff3e8af2c205..e78c7db878018 100644
> --- a/arch/x86/include/asm/mmu.h
> +++ b/arch/x86/include/asm/mmu.h
> @@ -59,6 +59,7 @@ typedef struct {
> #define INIT_MM_CONTEXT(mm)						\
> 	.context = {							\
> 		.ctx_id = 1,						\
> +		.lock = __MUTEX_INITIALIZER(mm.context.lock),		\

Sorry for my mistake. Thanks for fixing it up. I find it useful to know how
the problem was found or what the impact was - helps me sometimes to avoid
causing similar bugs in the future.

Reviewed-by: Nadav Amit <namit@...are.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ