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]
Date:   Fri,  8 Dec 2017 18:25:23 +0100
From:   Miroslav Benes <mbenes@...e.cz>
To:     jpoimboe@...hat.com, jeyu@...nel.org, jikos@...nel.org
Cc:     linux-kernel@...r.kernel.org, live-patching@...r.kernel.org,
        pmladek@...e.com, jbaron@...mai.com,
        Miroslav Benes <mbenes@...e.cz>
Subject: [PATCH 2/2] livepatch: Allow loading modules on architectures without HAVE_RELIABLE_STACKTRACE

Now that immediate feature was removed, it is not possible to load
livepatch modules on architectures without HAVE_RELIABLE_STACKTRACE. Fix
it by removing guilty check in klp_register_patch().

The architectures without HAVE_RELIABLE_STACKTRACE will now rely only on
kernelspace/userspace boundary switching, the (fake) signal and force
feature.

Also remove the check from all sample modules.

Signed-off-by: Miroslav Benes <mbenes@...e.cz>
---
 kernel/livepatch/core.c                      | 6 ++----
 samples/livepatch/livepatch-callbacks-demo.c | 3 ---
 samples/livepatch/livepatch-sample.c         | 3 ---
 samples/livepatch/livepatch-shadow-fix1.c    | 3 ---
 samples/livepatch/livepatch-shadow-fix2.c    | 3 ---
 5 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
index 461c0b7dc913..fa7e33aeb2a6 100644
--- a/kernel/livepatch/core.c
+++ b/kernel/livepatch/core.c
@@ -890,10 +890,8 @@ int klp_register_patch(struct klp_patch *patch)
 	if (!klp_initialized())
 		return -ENODEV;
 
-	if (!klp_have_reliable_stack()) {
-		pr_err("This architecture doesn't have support for the livepatch consistency model.\n");
-		return -ENOSYS;
-	}
+	if (!klp_have_reliable_stack())
+		pr_notice("This architecture doesn't have full support for the livepatch consistency model. The transition may not finish.\n");
 
 	return klp_init_patch(patch);
 }
diff --git a/samples/livepatch/livepatch-callbacks-demo.c b/samples/livepatch/livepatch-callbacks-demo.c
index bda7f3841f3e..72f9e6d1387b 100644
--- a/samples/livepatch/livepatch-callbacks-demo.c
+++ b/samples/livepatch/livepatch-callbacks-demo.c
@@ -197,9 +197,6 @@ static int livepatch_callbacks_demo_init(void)
 {
 	int ret;
 
-	if (!klp_have_reliable_stack())
-		pr_notice("The consistency model isn't supported for your architecture. The transition may not finish.\n");
-
 	ret = klp_register_patch(&patch);
 	if (ret)
 		return ret;
diff --git a/samples/livepatch/livepatch-sample.c b/samples/livepatch/livepatch-sample.c
index a150fca6f7cd..2d554dd930e2 100644
--- a/samples/livepatch/livepatch-sample.c
+++ b/samples/livepatch/livepatch-sample.c
@@ -71,9 +71,6 @@ static int livepatch_init(void)
 {
 	int ret;
 
-	if (!klp_have_reliable_stack())
-		pr_notice("The consistency model isn't supported for your architecture. The transition may not finish.\n");
-
 	ret = klp_register_patch(&patch);
 	if (ret)
 		return ret;
diff --git a/samples/livepatch/livepatch-shadow-fix1.c b/samples/livepatch/livepatch-shadow-fix1.c
index 415db31aca8d..830c55514f9f 100644
--- a/samples/livepatch/livepatch-shadow-fix1.c
+++ b/samples/livepatch/livepatch-shadow-fix1.c
@@ -133,9 +133,6 @@ static int livepatch_shadow_fix1_init(void)
 {
 	int ret;
 
-	if (!klp_have_reliable_stack())
-		pr_notice("The consistency model isn't supported for your architecture. The transition may not finish.\n");
-
 	ret = klp_register_patch(&patch);
 	if (ret)
 		return ret;
diff --git a/samples/livepatch/livepatch-shadow-fix2.c b/samples/livepatch/livepatch-shadow-fix2.c
index 04b3fe23bfd3..ff9948f0ec00 100644
--- a/samples/livepatch/livepatch-shadow-fix2.c
+++ b/samples/livepatch/livepatch-shadow-fix2.c
@@ -128,9 +128,6 @@ static int livepatch_shadow_fix2_init(void)
 {
 	int ret;
 
-	if (!klp_have_reliable_stack())
-		pr_notice("The consistency model isn't supported for your architecture. The transition may not finish.\n");
-
 	ret = klp_register_patch(&patch);
 	if (ret)
 		return ret;
-- 
2.15.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ