Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10044350pxu; Tue, 29 Dec 2020 12:03:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXouaUqENkl+cH4aI+UwJClt6AiwaS/bVP1qAUnuVGOELs2VCRcJonTUkNxWP1ihdL2dG9 X-Received: by 2002:a17:906:ae41:: with SMTP id lf1mr48031409ejb.369.1609272179767; Tue, 29 Dec 2020 12:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609272179; cv=none; d=google.com; s=arc-20160816; b=EkJq5EVecX4lMvJlAz+Jts3OoNtQlzFU0fhSllhnN455F2mPbhJrHCv+dKpUNb4l1X OCrLXApD/kamaQpRxJhwApb0tZT0+VNtIlcQs3GcFfLI+7sT/UW0vvM8wD2LYEURVbiP s3xH6Z3xZU/One93+owAApT0pmcKtJ5K+yITH5DtS724+rdCglcH8ztk9N8EFl6gN7gY iep9soxbt3RcNEHL7snCizYI0/qIgmsml8Rol6UQrB7dJy6Lz/EniljxvNM1A4XQLeWr z6EKuqfUkUG1dFj1vueoZxxYtwrXglK5O6sokIl6iV4ojFFbSkCAnZAVipwgpuuLZshJ SB3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject:dkim-signature; bh=hknaYncnvFzO1C779LIvHAn1a7BE6equJ8aDcI93zR8=; b=YGW/Bi30bLHrwkztE7dopRK/uphGrnxg+raSKob95XhH2PzV22OsOQX8a7ogOrwh+f INbE+C1zuDWUlNForJuLQ52sCLLtt6xLLPan5YEe4n3nI7Es8POia64VF66ejTkhwU22 +xUhtPFgesrWJT/jdi1FbdlsxDIec8mycSyCE4HPnY4/ZnG6YtDYjurTOqtqG+tGZ8vr dls2985cgOXNfwVMk5qhDE5Sv2DXsKG4QFl/gMiqprv8alTqKkQt/hcFgo/8XhYr5xgD fPiz9RWiT6T84GsePSJZVPDweKT/Gocn6YSGI6fSlfNBrtJRfu3nYDasVqs58b7CKVRO UbbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=kj+AwoTc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z21si23451456edr.365.2020.12.29.12.02.25; Tue, 29 Dec 2020 12:02:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=kj+AwoTc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726214AbgL2UBa (ORCPT + 99 others); Tue, 29 Dec 2020 15:01:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726111AbgL2UB3 (ORCPT ); Tue, 29 Dec 2020 15:01:29 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F948C0613D6 for ; Tue, 29 Dec 2020 12:00:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:References:Cc:To:From:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=hknaYncnvFzO1C779LIvHAn1a7BE6equJ8aDcI93zR8=; b=kj+AwoTcwamJZXhxHkWyKVxsQe foUYulmgp9J8vj+6JxeYNddC3xyDjTObRg0FyFEuqtPFIXKrppvG30lqrxw5vkXVOMtxH5yCeOc/M ue9tARmpv2vTHvxTphUP7vKmvBfLeGMJnNvcBUaPD3UafYN+vLWloTm4426v6nkITvPp5Mve7HVjT gTN1cViNW5uSAuigOF2avCuKU3wum7lt1339mv7pyOYPFxtvzFNdYBQlXRhHj1tQDpVEKZe3sWkFT Y19x7CBHkwo/lK3UcXGtFaiST7jdxQGSPlFHHHsuWKIB+1aoGjnLKycMz9iE5g8W3HDsYSO5Apu74 KoZqJ1TA==; Received: from [2601:1c0:6280:3f0::2c43] by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kuLAe-0001DZ-S3; Tue, 29 Dec 2020 20:00:41 +0000 Subject: Re: [RFC PATCH 2/2] mm: readahead: handle LARGE input to get_init_ra_size() From: Randy Dunlap To: =?UTF-8?Q?Toralf_F=c3=b6rster?= , Andrew Morton Cc: linux-kernel@vger.kernel.org, Jens Axboe , linux-mm@kvack.org References: <20201220211051.1416-1-rdunlap@infradead.org> <20201222173533.c9e28416835d7487b0e28cda@linux-foundation.org> <6a595671-20a8-e63f-f3ea-f4749a574efa@infradead.org> <1f5a6e7b-c779-861e-fde8-409ca8e2541b@infradead.org> Message-ID: Date: Tue, 29 Dec 2020 12:00:36 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <1f5a6e7b-c779-861e-fde8-409ca8e2541b@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/29/20 10:11 AM, Randy Dunlap wrote: > On 12/29/20 10:01 AM, Toralf Förster wrote: >> 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) > > Yes, that's the patch that I posted on 2020-DEC-22. > > Looks like I should submit a real patch for that. > > thanks. > Hi Toralf, Do you want either or both of your Reported-by: and Tested-by: on the patch? thanks. -- ~Randy