From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 96A5DC10F14 for ; Thu, 3 Oct 2019 08:40:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D9002133F for ; Thu, 3 Oct 2019 08:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570092000; bh=Q/EamCP0piIKVqT8q+fJSs1fhdzNfa1naX0fKhjVnUc=; h=Subject:To:Cc:From:Date:List-ID:From; b=WvhwcgKqumKNrrfQM8NAjANRqQC9xll3bvYp6qeKI1641+faPQpvOcXAhhUFO4ZQ4 aaa1W/yPZDHFVfun7Kgh4k93HFVFkuLl0Kdi/5TCGkWisvC+2wjd9lOJmLxMqlW9MY /rOMAr5EDCtn2xgCzD26rnzVxnHj9thfu7Z9CjMc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728114AbfJCIj7 (ORCPT ); Thu, 3 Oct 2019 04:39:59 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:49835 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728842AbfJCIj7 (ORCPT ); Thu, 3 Oct 2019 04:39:59 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5437E21DFB; Thu, 3 Oct 2019 04:39:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 03 Oct 2019 04:39:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=txtlYR NJS69p6sZZA1vwcSDnKK3GzjILfJHn9GTrRFA=; b=O+hEUn1nN2usbapHOtgU89 TUYmm04GurSTPO0Tez3K7FM/sClhLLd8nn0FqkFqxdrcCrScHECaZttHSxphtMyr yrMaNKQs4Dr/J0AzOF+jcCxpgAqaoGbWSAnuJZzcDC4MrFPBgjZY/nZs0Q4NKdKG 0d4S+xJh4gQgIrr3T/mcMIRTQFZIco3tzL34z643UNXSP+IJEs7bP4EN23eHaehy 0pzXAJmiiPHYI6khVWcpfd3fNNhp3fclzCm1Xtjc/L/2B6cCs6+kE1JBE8kKQdl4 eKpmfvd+p19U1mc16H7jWamoC4YnJjmzGVJHq8FB2sV42YmWPZsBwKG9VLNgyOFg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrgeekgddtiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeekfedrkeeirdekledrud dtjeenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhmnecu vehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 830BA80060; Thu, 3 Oct 2019 04:39:57 -0400 (EDT) Subject: FAILED: patch "[PATCH] staging: erofs: avoid endless loop of invalid lookback" failed to apply to 4.19-stable tree To: gaoxiang25@huawei.com, gregkh@linuxfoundation.org, stable@vger.kernel.org, yuchao0@huawei.com Cc: From: Date: Thu, 03 Oct 2019 10:39:54 +0200 Message-ID: <1570091994189245@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 598bb8913d015150b7734b55443c0e53e7189fc7 Mon Sep 17 00:00:00 2001 From: Gao Xiang Date: Mon, 19 Aug 2019 18:34:26 +0800 Subject: [PATCH] staging: erofs: avoid endless loop of invalid lookback distance 0 As reported by erofs-utils fuzzer, Lookback distance should be a positive number, so it should be actually looked back rather than spinning. Fixes: 02827e1796b3 ("staging: erofs: add erofs_map_blocks_iter") Cc: # 4.19+ Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20190819103426.87579-7-gaoxiang25@huawei.com Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/erofs/zmap.c b/drivers/staging/erofs/zmap.c index 7408e86823a4..774dacbc5b32 100644 --- a/drivers/staging/erofs/zmap.c +++ b/drivers/staging/erofs/zmap.c @@ -350,6 +350,12 @@ static int vle_extent_lookback(struct z_erofs_maprecorder *m, switch (m->type) { case Z_EROFS_VLE_CLUSTER_TYPE_NONHEAD: + if (unlikely(!m->delta[0])) { + errln("invalid lookback distance 0 at nid %llu", + vi->nid); + DBG_BUGON(1); + return -EFSCORRUPTED; + } return vle_extent_lookback(m, m->delta[0]); case Z_EROFS_VLE_CLUSTER_TYPE_PLAIN: map->m_flags &= ~EROFS_MAP_ZIPPED;