mm: LKSM: fix a bug in the filter length calculation 86/275286/3 accepted/tizen/unified/20220525.010040 submit/tizen/20220520.083127
authorSung-hun Kim <sfoon.kim@samsung.com>
Thu, 19 May 2022 11:53:02 +0000 (20:53 +0900)
committerSung-hun Kim <sfoon.kim@samsung.com>
Fri, 20 May 2022 02:04:34 +0000 (11:04 +0900)
commitbc771c4b5a58c15ec1527bfc9290e300e792886b
tree2bf6087910168a4c29c45993859470fb0c6e8023
parent7e503d9d2442106d393a7359890f16df5967aaa8
mm: LKSM: fix a bug in the filter length calculation

Since type of a size variable in the calculation of the
filter length is signed integer, it can make a buggy
situation when the size of a vma is bigger than a range
of a signed integer variable. In this case, the size is
treated as a negative number. As a result, it incurs a
kernel bug at BUG_ON(size < 0).

This patch changes types of variables and members in
lksm_region data structure from signed integer to unsigned
long. Additionally, remove an assertion BUG_ON(size < 0)
because the size never be a negative number.

Change-Id: I822a2ba5d372596ee55dcbec90a019fdf1dc2416
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
mm/lksm.c