Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp251344pxx; Wed, 28 Oct 2020 04:07:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnza2TWhESs6/1IyAo3nslnaAJeP5LwXCWvQhnKwqn4c/eU7R8mvt8ERVIL3CPTvtPyja5 X-Received: by 2002:a17:906:49cf:: with SMTP id w15mr7280302ejv.252.1603883264886; Wed, 28 Oct 2020 04:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603883264; cv=none; d=google.com; s=arc-20160816; b=Fu16EMds9j0r3HxwaEd2UwyDfVFHan5lJ8dhIyE1BAHsH1ipREVAWDWI7tpVVhL98L ewyDIG3cKUh22fuGg5hA9Ts2Dkq95RXHVAKvCHdZJ5iS/lD7ita/FE3vZKRPYU7ukmZn r/dW46PTCiavk2lGDxQysbXZOysbIut7IH5vUOxwG6PsIRLJ/HdMa97YT7L8/cNKtSnZ GuzDArUTTqFW7KvxIkU15lJhs1b+w9nGXrsetfjYgU06R5B/jE1VUnHpVPbdlgaTWJYM 0Mavs+Wrxb46AfUE9x9HGoyg+/1umXGUaO7JHpI+dyviGdAHc94KjFID1icc+yhLC79J HrsQ== 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=dcYOXwGLlaY5kXs7gUKFvY8SwtuIy93Zd6GloOdGejk=; b=IQn404sm+AfxMWmc3f7QwYrmXTDywFC8gidW03i7ubeJqBASRnvixZ17wgHX5ZFKCG 9yEPnYPvAsDZYbeEtXscg36qlx4jALFmGdvzgbISnHbgY3QIjdYooT6EW8R6ZLa6cEK5 O3mZEY4R0b+9GA29boigQ1Zutg8Jd0C/lil3AAYlKWvIM/D82Oi1/B9tmZiPQikBhb4d +2V8UtO1IzjATHHExk7y2I2rsd153i5Z4TWeDjpFynN5MU+6+vEJQMTvJKK7WpOkXFkj UQjdx8joFNH9Lb+tQHaEJuFFmagVEfTqhZ3EXfRgU4abyHBMNcQVjqjfIHxSiO1By7BR 0U5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M46pOOix; 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 bs17si3022913ejb.543.2020.10.28.04.07.22; Wed, 28 Oct 2020 04:07:44 -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=M46pOOix; 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 S1786256AbgJ0O7t (ORCPT + 99 others); Tue, 27 Oct 2020 10:59:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:43138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762543AbgJ0OnW (ORCPT ); Tue, 27 Oct 2020 10:43:22 -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 C98EA206E5; Tue, 27 Oct 2020 14:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809801; bh=CABQCfiIlkUUv1ROXKZhVMXVjel4c7ecedP+9uIvzSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M46pOOixpGpMqqcYFMMuNgrK4SydAuPpXqU4wnJo2Eu23L0fKoKEu7oOPz5byRv+h OYLXSRhcw00Q5XOSpahUyW9fY+iQ8aQqk7SuwV8HkQSjwo9Z14bQa8T+lHPaAUCwYj J1KWzJFY+XLG0WHJDrlJGu2vxzN/OKeTCVafJpFo= 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.4 325/408] block: ratelimit handle_bad_sector() message Date: Tue, 27 Oct 2020 14:54:23 +0100 Message-Id: <20201027135510.100900473@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 81aafb601df06..d2213220099d3 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -743,11 +743,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