Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp895774imu; Thu, 20 Dec 2018 07:03:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/V7N0fj6JavPFeEkgiLyavh1tFnUOL9zzhixYFNTLEfWFt5blxK/HmCGSjfyhobrQnL9qJN X-Received: by 2002:a17:902:145:: with SMTP id 63mr24393156plb.256.1545318217452; Thu, 20 Dec 2018 07:03:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545318217; cv=none; d=google.com; s=arc-20160816; b=l0q9+nDATMd92zDfeCkEAFjrk4nlFgA0Mk3MElycijs3yCwbYOct1bbz85NVXT+02j mWnLw0AwJSM5409yU4+Zeh0YkWTWvEeJRYmV+LDdJHcdQztDEtopJNX15IYqMm/qTN7b ewxZnBWOD+t1XEx90Ij6BBYJhvzXgqseKAGyOL56dRy3rugZKeHNzOP3qduUuWUZp5kU rTh8WJWpuNT1inDk3GcefkFuyucffnq+01tRnTb/3Gk9y/nUqr0rSmcQMzh59YH7Cjab VNi6TBKl7YiMtr5Tv2RKUN5OKC4Wx6pQ4zSBjwzPX1Gtblnom6t9f4GlZ7m4012Jzriz cQ4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Ow5k/bfOyZetGCB75s4z+RTwXgp65Xc9uA9uzK/GgAg=; b=LLs6MlDZltXsQhe738npMON6EuiaxL07AKlqwpygxPHanW94AAeKS86j08Ou8AEnkG ZJz+VBtcYLHqSGA/anFvpZ3uDfHeZHtnZWevE0ZNkutg4P2bXg0jq+N7en8JPwLSu+4A fRK4xKGX3tqr8ELioncipt3s1BGcQ6gBjYIQa3Krqu+ea9//wGpAkepbBY/DoktoLoGM 85fc6fNnwnNNExuKl3g3y/LDMxTBDDN9adZE2W8NSDHs/vV7wgHO3M9YZeDRncDLL2jV xwjXzhxIxkXcQQSRuxMAYhDoAwJ3PAxi6m5ORTJMRlcoU+1x2wZvnuAJ33Zne+VdhUnO 4dmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k22si14556012pgl.29.2018.12.20.07.03.21; Thu, 20 Dec 2018 07:03:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731067AbeLTKpl (ORCPT + 99 others); Thu, 20 Dec 2018 05:45:41 -0500 Received: from lithops.sigma-star.at ([195.201.40.130]:39562 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725869AbeLTKpl (ORCPT ); Thu, 20 Dec 2018 05:45:41 -0500 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 40EAE608A3A5; Thu, 20 Dec 2018 11:45:39 +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 6C2j1tvITbBT; Thu, 20 Dec 2018 11:45:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id D18A2608A3AD; Thu, 20 Dec 2018 11:45:38 +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 dYOE1HfC68eR; Thu, 20 Dec 2018 11:45:38 +0100 (CET) Received: from blindfold.localnet (unknown [82.150.214.1]) by lithops.sigma-star.at (Postfix) with ESMTPSA id 835F8608A3A5; Thu, 20 Dec 2018 11:45:38 +0100 (CET) From: Richard Weinberger To: Hou Tao Cc: linux-mtd@lists.infradead.org, dwmw2@infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] jffs2: Fix integer underflow in jffs2_rtime_compress Date: Thu, 20 Dec 2018 11:45:37 +0100 Message-ID: <2142335.HPRDAJu19m@blindfold> In-Reply-To: References: <20181215162350.12489-1-richard@nod.at> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Donnerstag, 20. Dezember 2018, 11:43:08 CET schrieb Hou Tao: > > On 2018/12/16 0:23, Richard Weinberger wrote: > > The rtime compressor assumes that at least two bytes are > > compressed. > > If we try to compress just one byte, the loop condition will > > wrap around and an out-of-bounds write happens. > > > > Cc: > > Signed-off-by: Richard Weinberger > > --- > > fs/jffs2/compr_rtime.c | 3 +++ > > 1 file changed, 3 insertions(+) > > It seems that it doesn't incur any harm because the minimal allocated > size will be 8-bytes and jffs2_rtime_compress() will write 2-bytes into > the allocated buffer. Are you sure about that? I saw odd kernel behavior and KASAN complained too. Thanks, //richard