Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp292692pxx; Wed, 28 Oct 2020 05:11:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8L4hTNwp4BxwHvuIGIoSY3neFhlhd/TmMog+hU2Emwmc9s+80kgb4FVsd+Tpe+OIN+aQZ X-Received: by 2002:a17:907:2662:: with SMTP id ci2mr7011552ejc.554.1603887087517; Wed, 28 Oct 2020 05:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603887087; cv=none; d=google.com; s=arc-20160816; b=Orb7Ksx9bHJB9v0wX411jDi4m2Zrf5uftAGZYX+Gu8We1ieYLfQ8PXuPSbr8tFJRnt 9lS7iKI2SH1rJRO5Nt52FjMsJjpSCaiSsKpgIyyfcMTZ7KB3ys38CXKzD+llLQUk2SKB b76udImFKkZN7RcYsuJ0JEJ3Fx9cs/Sm3jJ2+lC63U+Pkj6whBaHvBJsAkg9QcA1HptY H+4hI8n5dP4xHukjBkvxQywk16BGWKNDQiGx+8wuWCgnOnKZ/2WXjbPuK+0uaMgxPG/N qkPcsPEbRrbyN7ymIh33XPoBg2eQCLdCex43jlNC/Lo0hlPmNj/6tSdhgEgEPhSl/Xvz Jpig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kRu1q8kzklxIAKBjD6/OE0hAp6jOA9HXgZcflvmOKUg=; b=p7NEB+KHBIJxiPlAjEeK1Oo8R6KX6yDmSZudh5SjRbNfP0mjU6ce8h5RJrgxIof/l9 DdqXJzoIL8IZ2m1/fhQqYl0CtcAXhHZRFP/dxw7hA2WT10WDwvnruMEpUYrutllYNQ7N m0TzBl+wvJ43+OGG0FLzb/Ts2v1JFmn6T1miNfVHZjY542eiPbFNEl3VeASijFs6J1+y Lm3stoSFMsXOh4iGcMLrspdjcVQwmnhZ9xr/JzUCPt5bnG1RXxoT77r94H/n1YxFh0eW zBf5JRMP/OZOIa8bzdqsM/yv91W7RTR52xfdYnFIedbMD7ClfVQPAYqMN5HbS8tW3zez iXvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ktW8Dr22; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si2897729edy.300.2020.10.28.05.11.04; Wed, 28 Oct 2020 05:11:27 -0700 (PDT) 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=@kernel.org header.s=default header.b=ktW8Dr22; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1795762AbgJ0PPU (ORCPT + 99 others); Tue, 27 Oct 2020 11:15:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:48456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1794521AbgJ0PMP (ORCPT ); Tue, 27 Oct 2020 11:12:15 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9CC9F22202; Tue, 27 Oct 2020 15:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811534; bh=gBG8HRmTkIY7Xdd2tBhde16tVJEDMwdYi/078A6T8sM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ktW8Dr22aO8PO5hsPTdxvP7NTJSCRnYk9+FxidTBdiXR9DdT+hS8nB2Bm9ya5+osF lKsaZRQopFs3/7tWN6ytwhTSwWtLUsJ5/dYebauogXAtgxQNbZIhhc8sP5NKZBrJJO peIpS3crR1KzLLQeQWMYvyiIoZFyRCFipU7Mp6lw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tetsuo Handa , Christoph Hellwig , Jens Axboe , Sasha Levin Subject: [PATCH 5.8 528/633] block: ratelimit handle_bad_sector() message Date: Tue, 27 Oct 2020 14:54:31 +0100 Message-Id: <20201027135547.548187986@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tetsuo Handa [ Upstream commit f4ac712e4fe009635344b9af5d890fe25fcc8c0d ] syzbot is reporting unkillable task [1], for the caller is failing to handle a corrupted filesystem image which attempts to access beyond the end of the device. While we need to fix the caller, flooding the console with handle_bad_sector() message is unlikely useful. [1] https://syzkaller.appspot.com/bug?id=f1f49fb971d7a3e01bd8ab8cff2ff4572ccf3092 Signed-off-by: Tetsuo Handa Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-core.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 619a3dcd3f5e7..8d6435b731186 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -798,11 +798,10 @@ static void handle_bad_sector(struct bio *bio, sector_t maxsector) { char b[BDEVNAME_SIZE]; - printk(KERN_INFO "attempt to access beyond end of device\n"); - printk(KERN_INFO "%s: rw=%d, want=%Lu, limit=%Lu\n", - bio_devname(bio, b), bio->bi_opf, - (unsigned long long)bio_end_sector(bio), - (long long)maxsector); + pr_info_ratelimited("attempt to access beyond end of device\n" + "%s: rw=%d, want=%llu, limit=%llu\n", + bio_devname(bio, b), bio->bi_opf, + bio_end_sector(bio), maxsector); } #ifdef CONFIG_FAIL_MAKE_REQUEST -- 2.25.1