Files
linux/kernel
Zheng Yejian 7259ce8311 acct: fix potential integer overflow in encode_comp_t()
[ Upstream commit c5f31c655b ]

The integer overflow is descripted with following codes:
  > 317 static comp_t encode_comp_t(u64 value)
  > 318 {
  > 319         int exp, rnd;
    ......
  > 341         exp <<= MANTSIZE;
  > 342         exp += value;
  > 343         return exp;
  > 344 }

Currently comp_t is defined as type of '__u16', but the variable 'exp' is
type of 'int', so overflow would happen when variable 'exp' in line 343 is
greater than 65535.

Link: https://lkml.kernel.org/r/20210515140631.369106-3-zhengyejian1@huawei.com
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Zhang Jinhao <zhangjinhao2@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-13 14:13:58 +09:00
..
2023-06-13 14:13:21 +09:00
2016-01-22 18:04:28 -05:00
2016-04-04 09:46:47 -04:00
2023-05-15 15:18:40 +09:00
2018-05-01 16:49:34 +00:00
2017-10-12 22:31:24 +02:00
2015-04-12 21:03:31 +02:00
2015-11-23 09:44:58 +01:00
2023-05-12 16:39:07 +09:00
2023-05-16 10:34:10 +09:00
2023-05-15 17:11:06 +09:00
2016-02-16 13:04:58 -05:00
2015-01-17 10:02:23 +13:00
2016-03-01 20:36:56 +01:00
2023-05-12 16:43:35 +09:00
2023-05-15 16:30:15 +09:00
2018-04-03 11:15:30 -07:00
2016-09-22 20:00:36 -05:00
2018-05-09 19:39:28 -07:00
2018-05-09 19:39:28 -07:00