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-next>] [day] [month] [year] [list]
Date:   Tue, 23 Jul 2019 11:30:53 +0800
From:   Yang Xu <xuyang2018.jy@...fujitsu.com>
To:     <akpm@...ux-foundation.org>, <gorcunov@...il.com>
CC:     <linux-kernel@...r.kernel.org>,
        Yang Xu <xuyang2018.jy@...fujitsu.com>
Subject: [PATCH] sys_prctl(): simplify arg2 judgment when calling PR_SET_TIMERSLACK

arg2 will never < 0, for its type is 'unsigned long'. So negative
judgment is meaningless.

Signed-off-by: Yang Xu <xuyang2018.jy@...fujitsu.com>
---
 kernel/sys.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index 2969304c29fe..399457d26bef 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2372,11 +2372,11 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
 			error = current->timer_slack_ns;
 		break;
 	case PR_SET_TIMERSLACK:
-		if (arg2 <= 0)
+		if (arg2)
+			current->timer_slack_ns = arg2;
+		else
 			current->timer_slack_ns =
 					current->default_timer_slack_ns;
-		else
-			current->timer_slack_ns = arg2;
 		break;
 	case PR_MCE_KILL:
 		if (arg4 | arg5)
-- 
2.18.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ