SeongJae Park cb954ffb4e
UPSTREAM: mm/damon/dbgfs: use '__GFP_NOWARN' for user-specified size buffer allocation
Patch series "DAMON fixes".

This patch (of 2):

DAMON users can trigger below warning in '__alloc_pages()' by invoking
write() to some DAMON debugfs files with arbitrarily high count
argument, because DAMON debugfs interface allocates some buffers based
on the user-specified 'count'.

        if (unlikely(order >= MAX_ORDER)) {
                WARN_ON_ONCE(!(gfp & __GFP_NOWARN));
                return NULL;
        }

Because the DAMON debugfs interface code checks failure of the
'kmalloc()', this commit simply suppresses the warnings by adding
'__GFP_NOWARN' flag.

Link: https://lkml.kernel.org/r/20211110145758.16558-1-sj@kernel.org
Link: https://lkml.kernel.org/r/20211110145758.16558-2-sj@kernel.org
Fixes: 4bc05954d007 ("mm/damon: implement a debugfs-based user space interface")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit db7a347b26fe05d2e8c115bb24dfd908d0252bc3)

Bug: 228223814
Signed-off-by: Hailong Tu <tuhailong@oppo.com>
Change-Id: Ie04cc634d998260e5791b4daa4215b83a6af9071
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-07-31 09:36:38 +00:00
..
2021-04-28 13:44:48 +02:00
2022-04-06 13:18:17 +07:00
2022-04-06 13:18:17 +07:00
2021-11-26 15:15:32 +01:00
2022-07-26 08:09:42 +00:00
2022-07-31 09:27:36 +00:00
2022-07-31 09:24:50 +00:00
2022-07-31 09:27:36 +00:00