[PATCH 1/3] btreplay: fix memory corruption caused by CPU_ZERO_S

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

 



Size should be provided, not cpus number.

Signed-off-by: Roman Pen <r.peniaev@xxxxxxxxx>
Cc: Jens Axboe <axboe@xxxxxx>
Cc: <linux-btrace@xxxxxxxxxxxxxxx>
---
 btreplay/btreplay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/btreplay/btreplay.c b/btreplay/btreplay.c
index 6d19564..2a1525e 100644
--- a/btreplay/btreplay.c
+++ b/btreplay/btreplay.c
@@ -550,7 +550,7 @@ static void pin_to_cpu(struct thr_info *tip)
 
 	assert(0 <= tip->cpu && tip->cpu < ncpus);
 
-	CPU_ZERO_S(ncpus, cpus);
+	CPU_ZERO_S(size, cpus);
 	CPU_SET_S(tip->cpu, size, cpus);
 	if (sched_setaffinity(getpid(), size, cpus)) {
 		fatal("sched_setaffinity", ERR_SYSCALL, "Failed to pin CPU\n");
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-btrace" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux