+ sys_prctl-simplify-arg2-judgment-when-calling-pr_set_timerslack.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: sys_prctl(): simplify arg2 judgment when calling PR_SET_TIMERSLACK
has been added to the -mm tree.  Its filename is
     sys_prctl-simplify-arg2-judgment-when-calling-pr_set_timerslack.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/sys_prctl-simplify-arg2-judgment-when-calling-pr_set_timerslack.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/sys_prctl-simplify-arg2-judgment-when-calling-pr_set_timerslack.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Yang Xu <xuyang2018.jy@xxxxxxxxxxxxxx>
Subject: 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.

Link: http://lkml.kernel.org/r/1563852653-2382-1-git-send-email-xuyang2018.jy@xxxxxxxxxxxxxx
Signed-off-by: Yang Xu <xuyang2018.jy@xxxxxxxxxxxxxx>
Cc: John Stultz <john.stultz@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 kernel/sys.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/kernel/sys.c~sys_prctl-simplify-arg2-judgment-when-calling-pr_set_timerslack
+++ a/kernel/sys.c
@@ -2372,11 +2372,11 @@ SYSCALL_DEFINE5(prctl, int, option, unsi
 			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)
_

Patches currently in -mm which might be from xuyang2018.jy@xxxxxxxxxxxxxx are

sys_prctl-simplify-arg2-judgment-when-calling-pr_set_timerslack.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux