[PATCH] tsacct: Fix a truncation bug in taskstats

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

 



The KB_MASK is used to hide the low bits which prevent an information
leak about keyboard timing etc.  The problem is that it's a 32 bit mask
instead of 64 bits so it zeroes out the high 32 bits as well.

Fixes: 58c3c3aa01b4 ("Make taskstats round statistics down to nearest 1k bytes/events")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/kernel/tsacct.c b/kernel/tsacct.c
index 370724b45391..ea9375c94126 100644
--- a/kernel/tsacct.c
+++ b/kernel/tsacct.c
@@ -87,7 +87,7 @@ void bacct_add_tsk(struct user_namespace *user_ns,
 
 #define KB 1024
 #define MB (1024*KB)
-#define KB_MASK (~(KB-1))
+#define KB_MASK (~((u64)KB-1))
 /*
  * fill in extended accounting fields
  */
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux