mm: LKSM: fix a bug in the filter length calculation
authorSung-hun Kim <sfoon.kim@samsung.com>
Thu, 19 May 2022 11:53:02 +0000 (20:53 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Thu, 3 Aug 2023 09:33:03 +0000 (18:33 +0900)
commit36bd7973e4ac3ce68ed2d45ddc2bf68e3951e37e
tree18590c738d71231fec2f58083e8b5741e7e6a969
parent45dcfe231790ab76ad9bf650a674aa8a7ecfb5d7
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