Commit f104fa0e authored by Sergey Senozhatsky's avatar Sergey Senozhatsky Committed by Jinjiang Tu
Browse files

zram: correctly handle all next_arg() cases

mainline inclusion
from mainline-v6.3-rc1
commit df32de14
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I822Z8
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=df32de1433412621b92daf1b3369ac053214031e

-------------------------------------------

When supplied buffer does not have assignment sign next_arg() sets `val`
pointer to NULL, so we cannot dereference it.  Add a NULL pointer test to
handle `param` case, in addition to `*val` test, which handles cases when
param has no value assigned to it: `param=`.

Link: https://lkml.kernel.org/r/20230103030119.1496358-1-senozhatsky@chromium.org


Signed-off-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJinjiang Tu <tujinjiang@huawei.com>
parent 8545e9cf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment