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=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 626F3C433E9 for ; Thu, 28 Jan 2021 11:23:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1489A64DDB for ; Thu, 28 Jan 2021 11:23:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbhA1LXW convert rfc822-to-8bit (ORCPT ); Thu, 28 Jan 2021 06:23:22 -0500 Received: from lithops.sigma-star.at ([195.201.40.130]:37524 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbhA1LXU (ORCPT ); Thu, 28 Jan 2021 06:23:20 -0500 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id EA0A16083244; Thu, 28 Jan 2021 12:22:37 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id mkb795HYT3tx; Thu, 28 Jan 2021 12:22:36 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 5A5FE6083270; Thu, 28 Jan 2021 12:22:36 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 9rn1BgoA46tL; Thu, 28 Jan 2021 12:22:36 +0100 (CET) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 363536083244; Thu, 28 Jan 2021 12:22:36 +0100 (CET) Date: Thu, 28 Jan 2021 12:22:36 +0100 (CET) From: Richard Weinberger To: Joakim Tjernlund Cc: menglong8 dong , David Woodhouse , yang yang29 , stable , linux-kernel , linux-mtd Message-ID: <95961161.337242.1611832956034.JavaMail.zimbra@nod.at> In-Reply-To: References: <20210128105535.49479-1-yang.yang29@zte.com.cn> Subject: Re: [PATCH] jffs2: check the validity of dstlen in jffs2_zlib_compress() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF78 (Linux)/8.8.12_GA_3809) Thread-Topic: jffs2: check the validity of dstlen in jffs2_zlib_compress() Thread-Index: AQHW9WSdcQjTUgG4ZEOlNPQW4whXrao844+AZaZjKmc= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- Ursprüngliche Mail ----- > Von: "Joakim Tjernlund" > An: "menglong8 dong" , "David Woodhouse" > CC: "yang yang29" , "stable" , "linux-kernel" > , "richard" , "linux-mtd" > Gesendet: Donnerstag, 28. Januar 2021 12:17:34 > Betreff: Re: [PATCH] jffs2: check the validity of dstlen in jffs2_zlib_compress() > On Thu, 2021-01-28 at 02:55 -0800, menglong8.dong@gmail.com wrote: >> From: Yang Yang >> >> KASAN reports a BUG when download file in jffs2 filesystem.It is >> because when dstlen == 1, cpage_out will write array out of bounds. >> Actually, data will not be compressed in jffs2_zlib_compress() if >> data's length less than 4. > > Ouch, data corruption will ensue. Good find! > I think this needs to go to stable as well. Indeed! Do you know whether this is a regression? Seems to be like that since ever. Thanks, //richard