mm: LKSM: fix a bug in the filter length calculation 92/275292/1 accepted/tizen_6.5_unified tizen_6.5 accepted/tizen/6.5/unified/20220523.143041 submit/tizen_6.5/20220520.083617
authorSung-hun Kim <sfoon.kim@samsung.com>
Thu, 19 May 2022 11:53:02 +0000 (20:53 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 20 May 2022 03:06:39 +0000 (03:06 +0000)
commita00f4121cc9fe0d7a3a3b6ec7d1767e4c67d8e11
tree93438b87b7789eefe6aaf6d7e050df2b1c7a0c18
parent8bb55b00d92ccb61db0497d627b3d803f5c86466
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