Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1593766

[PATCH 03/18] pstore: Avoid race in module unloading

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject [PATCH 03/18] pstore: Avoid race in module unloading
Date 2017-03-06 23:30 +0100
Message-ID <ti9iF-6ij-1@gated-at.bofh.it> (permalink)
References <ti98Z-6eI-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Technically, it might be possible for struct pstore_info to go out of
scope after the module_put(), so report the backend name first.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 fs/pstore/platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 074fe85a2078..d69ef8a840b9 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -722,10 +722,10 @@ int pstore_register(struct pstore_info *psi)
 	 */
 	backend = psi->name;
 
-	module_put(owner);
-
 	pr_info("Registered %s as persistent store backend\n", psi->name);
 
+	module_put(owner);
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(pstore_register);
-- 
2.7.4

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH 03/18] pstore: Avoid race in module unloading Kees Cook <keescook@chromium.org> - 2017-03-06 23:30 +0100
  Re: [PATCH 03/18] pstore: Avoid race in module unloading Namhyung Kim <namhyung@gmail.com> - 2017-03-07 17:30 +0100
    Re: [PATCH 03/18] pstore: Avoid race in module unloading Kees Cook <keescook@chromium.org> - 2017-03-07 19:30 +0100

csiph-web