Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <B48C6E93-AD57-4FF8-BBE8-887A5E965793@vmware.com>
Date: Thu, 17 Jan 2019 18:07:03 +0000
From: Nadav Amit <namit@...are.com>
To: Masami Hiramatsu <mhiramat@...nel.org>
CC: Rick Edgecombe <rick.p.edgecombe@...el.com>, Andy Lutomirski
	<luto@...nel.org>, Ingo Molnar <mingo@...hat.com>, Linux List Kernel Mailing
	<linux-kernel@...r.kernel.org>, the arch/x86 maintainers <x86@...nel.org>,
	"H. Peter Anvin" <hpa@...or.com>, Thomas Gleixner <tglx@...utronix.de>,
	Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
	Peter Zijlstra <peterz@...radead.org>, Damian Tometzki
	<linux_dti@...oud.com>, linux-integrity <linux-integrity@...r.kernel.org>,
	LSM List <linux-security-module@...r.kernel.org>, Andrew Morton
	<akpm@...ux-foundation.org>, Kernel Hardening
	<kernel-hardening@...ts.openwall.com>, Linux-MM <linux-mm@...ck.org>, Will
 Deacon <will.deacon@....com>, Ard Biesheuvel <ard.biesheuvel@...aro.org>,
	"kristen@...ux.intel.com" <kristen@...ux.intel.com>,
	"deneen.t.dock@...el.com" <deneen.t.dock@...el.com>
Subject: Re: [PATCH 17/17] module: Prevent module removal racing with
 text_poke()

> On Jan 16, 2019, at 11:54 PM, Masami Hiramatsu <mhiramat@...nel.org> wrote:
> 
> On Wed, 16 Jan 2019 16:32:59 -0800
> Rick Edgecombe <rick.p.edgecombe@...el.com> wrote:
> 
>> From: Nadav Amit <namit@...are.com>
>> 
>> It seems dangerous to allow code modifications to take place
>> concurrently with module unloading. So take the text_mutex while the
>> memory of the module is freed.
> 
> At that point, since the module itself is removed from module list,
> it seems no actual harm. Or would you have any concern?

So it appears that you are right and all the users of text_poke() and
text_poke_bp() do install module notifiers, and remove the module from their
internal data structure when they are done (*). As long as they prevent
text_poke*() to be called concurrently (e.g., using jump_label_lock()),
everything is fine.

Having said that, the question is whether you “trust” text_poke*() users to
do so. text_poke() description does not day explicitly that you need to
prevent modules from being removed.

What do you say?


(*) I am not sure about kgdb, but it probably does not matter much

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.