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]
Message-Id: <20230506074253.44526-1-yanyan.yan@antgroup.com>
Date:   Sat, 06 May 2023 15:42:53 +0800
From:   "晏艳(采苓)" <yanyan.yan@...group.com>
To:     linux-kernel@...r.kernel.org
Cc:     "谈鉴锋" <henry.tjf@...group.com>,
        "Tiwei Bie" <tiwei.btw@...group.com>, <peterz@...radead.org>,
        "晏艳(采苓)" <yanyan.yan@...group.com>,
        "Ingo Molnar" <mingo@...hat.com>,
        "Juri Lelli" <juri.lelli@...hat.com>,
        "Vincent Guittot" <vincent.guittot@...aro.org>,
        "Dietmar Eggemann" <dietmar.eggemann@....com>,
        "Steven Rostedt" <rostedt@...dmis.org>,
        "Ben Segall" <bsegall@...gle.com>, "Mel Gorman" <mgorman@...e.de>,
        "Daniel Bristot de Oliveira" <bristot@...hat.com>,
        "Valentin Schneider" <vschneid@...hat.com>
Subject: [PATCH v2] sched/debug: correct printing for rq->nr_uninterruptible

Commit e6fe3f422be1 ("sched: Make multiple runqueue task counters
32-bit") changed the type for rq->nr_uninterruptible from "unsigned
long" to "unsigned int", but left wrong cast print to
/sys/kernel/debug/sched/debug and to the console.

For example, nr_uninterruptible's value is fffffff7 with type
"unsigned int", (long)nr_uninterruptible shows 4294967287 while
(int)nr_uninterruptible prints -9. So using int cast fixes wrong
printing.

Signed-off-by: Yan Yan <yanyan.yan@...group.com>
---
 kernel/sched/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 667876da8382..ac6684cd4ae4 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -730,7 +730,7 @@ static void print_cpu(struct seq_file *m, int cpu)
 #define P(x)								\
 do {									\
 	if (sizeof(rq->x) == 4)						\
-		SEQ_printf(m, "  .%-30s: %ld\n", #x, (long)(rq->x));	\
+		SEQ_printf(m, "  .%-30s: %d\n", #x, (int)(rq->x));	\
 	else								\
 		SEQ_printf(m, "  .%-30s: %Ld\n", #x, (long long)(rq->x));\
 } while (0)
-- 
2.32.0.3.g01195cf9f

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ