lkml.org 
[lkml]   [2020]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [RFC PATCH 2/2] mm: readahead: handle LARGE input to get_init_ra_size()
From
Date
On 12/23/20 2:50 AM, Randy Dunlap wrote:
>> What motivates this change? Is there any reason to think this can
>> happen?
> Spotted in the wild:
I run 2 hardened Gentoo systems, a server and a desktop.

I patched the server with this:

mr-fox ~ # cat ubsan.patch
--- linux-5.10.1.orig/mm/readahead.c
+++ linux-5.10.1/mm/readahead.c
@@ -310,7 +310,11 @@ void force_page_cache_ra(struct readahea
*/
static unsigned long get_init_ra_size(unsigned long size, unsigned
long max)
{
- unsigned long newsize = roundup_pow_of_two(size);
+ unsigned long newsize;
+
+ if (!size)
+ size = 32;
+ newsize = roundup_pow_of_two(size);

if (newsize <= max / 32)
newsize = newsize * 4;


and the issue did no longer occurred at the server (5.10.2).

I did not patched the desktop system and the issue occurred still 3
times since 21th of december (5.10.2/3)

--
Toralf

\
 
 \ /
  Last update: 2020-12-29 19:04    [W:0.069 / U:1.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site