Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3327915imu; Sun, 11 Nov 2018 12:28:24 -0800 (PST) X-Google-Smtp-Source: AJdET5fHvWZlVehjpUnxBy/WBOCMSWfjNnDh7Dpbl+yFFELTx+yWVAt4wI8Y0LDp/USciHRHpSXU X-Received: by 2002:a17:902:6848:: with SMTP id f8mr1073775pln.300.1541968104811; Sun, 11 Nov 2018 12:28:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968104; cv=none; d=google.com; s=arc-20160816; b=JUVvt3RYzmzr7nq9hrtgzGtVqwmCxH3ZBPEirT+IKL9Q3c8CIdT+CDYCqpnHauGp7z A/8L4j0D8S3XKMGjn1FcPeFW8qTgcM1UmlpX0bhjXhJNAEecO1sbyjuxp4YTQgmdHEtR rkYYamVVlVhDQwipjt2B9qEtkb0cjGG68W0Q4xKNZePo1iawWS+aF3v00yBM5u4ns3lo pBw43hg50zXoSZRrN9EuxFZqzCbW2PXNySFfS3mpCoGiaNgsuB9x4KlkLqPiYOH6zqcq mCM636KE4AoVRLlvBbMH1xI37LnEm2P3wEPt2QQz/KZt1b3SoucVfB2bn0ZXebp94tQF 2mYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=CIEbK+x6GJUw09XADjBH9ctaOm9yZO8X4sOgIwdXIbk=; b=EYzFNz4EAQ9BupgmhtPCQy0r4kKhsATsl6sEys3Gvu8if5LfkZND2CfyCpgjNvvqmx 5797KrqjKUMrChqfi5c7ZCeIV+vcrGCSr2aWBkA7Z3sDuTgZODgqLlD71JuFbiFJZsm+ 0xEyAnqbpoi6/+0Xb/ediHswFiZCgecVF5bbKicf82Oxr3FDHTLDOBvPsRTeRfQfBp4H S54n0yxw+DrpJ0PkJVYiJSGjnrfLTBlQrCids+sg0f7tZliiPl33h9EwgdDtR2FCQnvV EcRsAp6o1todA7+QP/iy026Us9Ne3/S8j7RJWOfpWzUBL2Wx1s7lqdW+ZahqoVY04bgu kJmw== 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 b12-v6si15029505plr.175.2018.11.11.12.28.09; Sun, 11 Nov 2018 12:28:24 -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 S1730614AbeKLFs0 (ORCPT + 99 others); Mon, 12 Nov 2018 00:48:26 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50744 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730579AbeKLFsZ (ORCPT ); Mon, 12 Nov 2018 00:48:25 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsj-0000oG-Qd; Sun, 11 Nov 2018 19:58:53 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsY-0001oU-TL; Sun, 11 Nov 2018 19:58:42 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Anatoly Trosinenko" , "Phillip Lougher" , "Linus Torvalds" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 306/366] squashfs: more metadata hardening In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Linus Torvalds commit d512584780d3e6a7cacb2f482834849453d444a1 upstream. Anatoly reports another squashfs fuzzing issue, where the decompression parameters themselves are in a compressed block. This causes squashfs_read_data() to be called in order to read the decompression options before the decompression stream having been set up, making squashfs go sideways. Reported-by: Anatoly Trosinenko Acked-by: Phillip Lougher Signed-off-by: Linus Torvalds Signed-off-by: Ben Hutchings --- fs/squashfs/block.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/squashfs/block.c +++ b/fs/squashfs/block.c @@ -166,6 +166,8 @@ int squashfs_read_data(struct super_bloc } if (compressed) { + if (!msblk->stream) + goto read_failure; length = squashfs_decompress(msblk, bh, b, offset, length, output); if (length < 0)