From patchwork Tue Oct 27 13:54:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312074 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1031EC4363A for ; Tue, 27 Oct 2020 17:23:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A957121D42 for ; Tue, 27 Oct 2020 17:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603819393; bh=CABQCfiIlkUUv1ROXKZhVMXVjel4c7ecedP+9uIvzSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=lnKgjdiP7rjRM4+RaDaX/sJNR/+L3y+S3LgXASFFVZUUY/RJbGw/0Yj9uB5mEatol cnRgnb56BdiNPkBilvHMi7htzjmC5lAYNejgBMmLHoI8PvU96TemU4vkFpoP48vimL IMZ2pdapxEHvm9HxQpbqg8Dz8EYAe5QTVSudcE1s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1780490AbgJ0Oyp (ORCPT ); Tue, 27 Oct 2020 10:54:45 -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 Precedence: bulk List-ID: X-Mailing-List: stable@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