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>
Wed, 23 Nov 2022 02:31:04 +0000 (11:31 +0900)
commit2e15d5dcadfff3796358a344fa1819196f85c4d9
tree36da31ac4bc18f6714516069374a3dbce6982004
parent52032ccb644fbb8be6eb3265cdc741df298676f7
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