|
Message-ID: <tip-3950746d9d8ef981c1cb842384e0e86e8d1aad76@git.kernel.org> Date: Tue, 30 Apr 2019 04:29:34 -0700 From: tip-bot for Nadav Amit <tipbot@...or.com> To: linux-tip-commits@...r.kernel.org Cc: ard.biesheuvel@...aro.org, bp@...en8.de, dave.hansen@...ux.intel.com, linux_dti@...oud.com, riel@...riel.com, akpm@...ux-foundation.org, deneen.t.dock@...el.com, linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org, kristen@...ux.intel.com, hpa@...or.com, will.deacon@....com, mingo@...nel.org, mhiramat@...nel.org, tglx@...utronix.de, rick.p.edgecombe@...el.com, luto@...nel.org, kernel-hardening@...ts.openwall.com, peterz@...radead.org, namit@...are.com Subject: [tip:x86/mm] x86/alternatives: Add comment about module removal races Commit-ID: 3950746d9d8ef981c1cb842384e0e86e8d1aad76 Gitweb: https://git.kernel.org/tip/3950746d9d8ef981c1cb842384e0e86e8d1aad76 Author: Nadav Amit <namit@...are.com> AuthorDate: Thu, 25 Apr 2019 17:11:41 -0700 Committer: Ingo Molnar <mingo@...nel.org> CommitDate: Tue, 30 Apr 2019 12:38:01 +0200 x86/alternatives: Add comment about module removal races Add a comment to clarify that users of text_poke() must ensure that no races with module removal take place. Signed-off-by: Nadav Amit <namit@...are.com> Signed-off-by: Rick Edgecombe <rick.p.edgecombe@...el.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org> Cc: <akpm@...ux-foundation.org> Cc: <ard.biesheuvel@...aro.org> Cc: <deneen.t.dock@...el.com> Cc: <kernel-hardening@...ts.openwall.com> Cc: <kristen@...ux.intel.com> Cc: <linux_dti@...oud.com> Cc: <will.deacon@....com> Cc: Andy Lutomirski <luto@...nel.org> Cc: Borislav Petkov <bp@...en8.de> Cc: Dave Hansen <dave.hansen@...ux.intel.com> Cc: H. Peter Anvin <hpa@...or.com> Cc: Linus Torvalds <torvalds@...ux-foundation.org> Cc: Masami Hiramatsu <mhiramat@...nel.org> Cc: Rik van Riel <riel@...riel.com> Cc: Thomas Gleixner <tglx@...utronix.de> Link: https://lkml.kernel.org/r/20190426001143.4983-22-namit@vmware.com Signed-off-by: Ingo Molnar <mingo@...nel.org> --- arch/x86/kernel/alternative.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 18f959975ea0..7b9b49dfc05a 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -810,6 +810,11 @@ static void *__text_poke(void *addr, const void *opcode, size_t len) * It means the size must be writable atomically and the address must be aligned * in a way that permits an atomic write. It also makes sure we fit on a single * page. + * + * Note that the caller must ensure that if the modified code is part of a + * module, the module would not be removed during poking. This can be achieved + * by registering a module notifier, and ordering module removal and patching + * trough a mutex. */ void *text_poke(void *addr, const void *opcode, size_t len) {
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.