Files
linux/mm
Maurizio Lombardi 96b7461874 mm: prevent page_frag_alloc() from corrupting the memory
commit dac22531bb upstream.

A number of drivers call page_frag_alloc() with a fragment's size >
PAGE_SIZE.

In low memory conditions, __page_frag_cache_refill() may fail the order
3 cache allocation and fall back to order 0; In this case, the cache
will be smaller than the fragment, causing memory corruptions.

Prevent this from happening by checking if the newly allocated cache is
large enough for the fragment; if not, the allocation will fail and
page_frag_alloc() will return NULL.

Link: https://lkml.kernel.org/r/20220715125013.247085-1-mlombard@redhat.com
Fixes: b63ae8ca09 ("mm/net: Rename and move page fragment handling from net/ to mm/")
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Cc: Chen Lin <chen45464546@163.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-13 14:13:29 +09:00
..
2015-09-08 15:35:28 -07:00
2018-04-17 17:58:08 -08:00
2015-11-05 19:34:48 -08:00
2017-08-24 17:12:19 -07:00
2023-05-15 17:11:06 +09:00
2023-05-16 10:40:22 +09:00
2016-03-17 15:09:34 -07:00
2018-04-17 17:58:08 -08:00
2023-05-15 14:47:39 +09:00