From patchwork Wed Jul 25 18:09:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kleber Sacilotto de Souza X-Patchwork-Id: 949335 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41bNYC01wNz9s1x; Thu, 26 Jul 2018 04:09:50 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fiOEK-0007uB-7f; Wed, 25 Jul 2018 18:09:44 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fiOEH-0007tI-W2 for kernel-team@lists.ubuntu.com; Wed, 25 Jul 2018 18:09:41 +0000 Received: from mail-ed1-f72.google.com ([209.85.208.72]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fiOEH-0003jR-Os for kernel-team@lists.ubuntu.com; Wed, 25 Jul 2018 18:09:41 +0000 Received: by mail-ed1-f72.google.com with SMTP id d5-v6so3421083edq.3 for ; Wed, 25 Jul 2018 11:09:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=J3DtDnSBbTeRgsMOciIDL9i7hk1oc9u2mWSPhx3OyKA=; b=Hmk1MikHCfPExSSoFUynPMRWa8BXS+3OnSQy4c0unOoiPu/3t/1meNUX7uIecCF+kE wYnUHU8iwbwyKPLFwpiMQucNz86KLZhSlhVd1mSyAXmy23CHNLHn0KfeCdf348HSzTHp TXeZGS9XkCMWl7mGMSaA2EhL85KEamGk223a7rKHqy3A7zsxR395cl34gIwysOTuM3OV LBKAiZwxjdPJQluQ4uuwz3Kf05fK/fUOJurY/rKe/D91OjKieWD1pIGn2kt7DiCNssRb NgPFrlskAI0cM19Tj+YTjGt1rr/OKCwv07RvhHpXo06k8XZaz5vELhqM1nUrji2OeWF0 xIsw== X-Gm-Message-State: AOUpUlF1u4MCNIVLlYelwoQjc+OXbD4Bfi3AE1IYbpaaC4YxReD5rtQ5 38cZE/Y8Rq+GuVH88oTay1ei0PKELRS8IXe9nOabmUyqkupTDjcUByAK1sZt0nAqXpWIOp7SNog c1C1nUG5Hvyhtn6nEdtLMQHRQtdBl/SvT4vk3OMcuRA== X-Received: by 2002:a50:ae98:: with SMTP id e24-v6mr23412290edd.16.1532542181249; Wed, 25 Jul 2018 11:09:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpevFEMCDjNHTaEv98t0jE2aeuNHN5K+yGoCfszjwKq57UogLlFGYFpbJAbtvkc2wmQEw8240Q== X-Received: by 2002:a50:ae98:: with SMTP id e24-v6mr23412282edd.16.1532542181065; Wed, 25 Jul 2018 11:09:41 -0700 (PDT) Received: from localhost ([2a02:8109:98c0:1604:b106:8d3e:8009:f269]) by smtp.gmail.com with ESMTPSA id w26-v6sm6731612eds.7.2018.07.25.11.09.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Jul 2018 11:09:40 -0700 (PDT) From: Kleber Sacilotto de Souza To: kernel-team@lists.ubuntu.com Subject: [SRU][Trusty][PATCH 2/2] ext4: fix fencepost in s_first_meta_bg validation Date: Wed, 25 Jul 2018 20:09:35 +0200 Message-Id: <20180725180935.2503-3-kleber.souza@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180725180935.2503-1-kleber.souza@canonical.com> References: <20180725180935.2503-1-kleber.souza@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Theodore Ts'o It is OK for s_first_meta_bg to be equal to the number of block group descriptor blocks. (It rarely happens, but it shouldn't cause any problems.) https://bugzilla.kernel.org/show_bug.cgi?id=194567 Fixes: 3a4b77cd47bb837b8557595ec7425f281f2ca1fe Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org CVE-2016-10208 (backported from commit 2ba3e6e8afc9b6188b471f27cf2b5e3cf34e7af2) Signed-off-by: Kleber Sacilotto de Souza --- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ffca676b968d..942c98b270fd 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3832,7 +3832,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) db_count = (sbi->s_groups_count + EXT4_DESC_PER_BLOCK(sb) - 1) / EXT4_DESC_PER_BLOCK(sb); if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_META_BG)) { - if (le32_to_cpu(es->s_first_meta_bg) >= db_count) { + if (le32_to_cpu(es->s_first_meta_bg) > db_count) { ext4_msg(sb, KERN_WARNING, "first meta block group too large: %u " "(group descriptor block count %u)",