summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMahad Ibrahim <mahad.ibrahim.dev@gmail.com>2026-07-22 23:02:46 +0000
committerKees Cook <kees@kernel.org>2026-09-21 21:26:10 -0700
commitfaebcf725c5a7b278cecc8eac2e4f4f46bfa050b (patch)
tree7fe2d9979ccc00153798c919d8578caeabc7613c /include
parentdf2908090cda368b01ff43709f51890076c56157 (diff)
downloadlinux-next-faebcf725c5a7b278cecc8eac2e4f4f46bfa050b.tar.gz
linux-next-faebcf725c5a7b278cecc8eac2e4f4f46bfa050b.zip
lkdtm: use kmalloc() instead of __get_free_page
lkdtm_debugfs_entry and direct_entry use __get_free_page to allocate a temporary buffer, perform copy_from_user to get the crashtype name, strim() to strip whitespace and find_crashtype to find the corresponding crashtype that is being requested. The lkdtm_debugfs_read uses __get_free_page to allocate a temporary buffer to store all the available crashtypes, and then copy it to userspace. The buffers that are allocated can be allocated with kmalloc as there is nothing special that requires a struct page, or the page allocator. kmalloc() additionally provides a better API that doesn't require ugly casts which obfuscate the code and kfree does not need to know the size of the freed object. Replace use of __get_free_page() with kmalloc(). Signed-off-by: Mahad Ibrahim <mahad.ibrahim.dev@gmail.com> Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Link: https://patch.msgid.link/20260722230246.2869-1-mahad.ibrahim.dev@gmail.com Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions