Received: by 10.213.65.68 with SMTP id h4csp488675imn; Fri, 16 Mar 2018 09:15:59 -0700 (PDT) X-Google-Smtp-Source: AG47ELs/Uln6463vfInDYZQkFleXA1RVivc7lL+b71oUJPWe3aXrTw457EMyEmP3bfWhLMfNdsuo X-Received: by 2002:a17:902:bd05:: with SMTP id p5-v6mr2734704pls.137.1521216959897; Fri, 16 Mar 2018 09:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216959; cv=none; d=google.com; s=arc-20160816; b=tcDkrxGjpAVf6+iF7225TqyB3HdZ3W7eWyDlp+DB6k0ZERwcxsr7FaZlqdwRIxmv8n L/ce3ejYzWLVmeevn5D95MsaynqkE+DykHs/n/yv5pRLG6m+5zX4N43ZZVCSuMM5hAwZ p5rX1WVxTBhQvRj78Q8RHm1r0lO+uqTPfZjKtktk6TnYQ2yqyW3eT2+QEqTQlWEUZXBC yEnba9mxf/9Wa1oDPdAeZIorh1Dig3kXouvJTiM7wclvl78pd6HnDnXLPYzhfb4dEiiv 0KBBwWXIsnNnmPTwo8q7QfA1nY/E7PKOhJH3jwFr77EbCFpmd4M09zb98FUMCzpQa7mq lm2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/gcu4Gol5ZerFI+aVbFAoMNyazz+ifLzPhnQ/DuSDM4=; b=tvSV8pjBC9HT/EhxI46WY3fa0IUrPdjJ7KXelchowrvbBlnc0XEPBYQ06lEmihP9G0 7C6xn9hnkzYuQqmCsxOzyKJlzdqywfpM5jACyPS036kx84IwKLOgE36I5GcC4iK/pOGf xPdqy5N9vsiw9/xPXdfOhAQBcxOcn1u6SmNS6PywQW04i8fr/PQHWQqLe+ydPl6fUdlJ LOTrNzXI+nJWk0zgCCNipdcmEMI6LC+YBKWFz5SXxErr9mYxFicqQKPELY6J9IcyWSbR yblPti2U17r8IjFk/BHbQhlECpHpB4JoMtZg0VOvtK0z/rYtvRNmGQC3GrP6Ymt44CJd bCXw== 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 y16si73710pge.500.2018.03.16.09.15.45; Fri, 16 Mar 2018 09:15:59 -0700 (PDT) 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 S934646AbeCPQNd (ORCPT + 99 others); Fri, 16 Mar 2018 12:13:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43506 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754668AbeCPPkN (ORCPT ); Fri, 16 Mar 2018 11:40:13 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 863E2D4D; Fri, 16 Mar 2018 15:40:12 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andreas Gruenbacher , Bob Peterson Subject: [PATCH 4.15 027/128] gfs2: Fixes to "Implement iomap for block_map" (2) Date: Fri, 16 Mar 2018 16:22:48 +0100 Message-Id: <20180316152337.877284662@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andreas Gruenbacher commit 3b5da96e4585a2788da6a07619bda3518d76eb30 upstream. It turns out that commit 3229c18c0d6b2 'Fixes to "Implement iomap for block_map"' introduced another bug in gfs2_iomap_begin that can cause gfs2_block_map to set bh->b_size of an actual buffer to 0. This can lead to arbitrary incorrect behavior including crashes or disk corruption. Revert the incorrect part of that commit. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson Signed-off-by: Greg Kroah-Hartman --- fs/gfs2/bmap.c | 3 --- 1 file changed, 3 deletions(-) --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -811,9 +811,6 @@ do_alloc: iomap->length = hole_size(inode, lblock, &mp); else iomap->length = size - pos; - } else { - if (height <= ip->i_height) - iomap->length = hole_size(inode, lblock, &mp); } goto out_release; }