Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp273559yba; Mon, 20 May 2019 08:29:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5aZjxOTrw32QkVvw/tjk2bDbH34s89eMJWkkTHv1HXGNixiY5wQsLl8pyLEMGYq7e/Mus X-Received: by 2002:a63:5c5b:: with SMTP id n27mr76772940pgm.52.1558366144266; Mon, 20 May 2019 08:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558366144; cv=none; d=google.com; s=arc-20160816; b=Q1l6MHbUhdTTIAA4w8hxDISNlrKWon8yIgt/1cUJl9Q0u8FvAXNFpX8mr98SRrr+1z +X/+VomW5JNL4dPDdRFeDKL9XWoD6XFIo6pHwOM0Cm2oUK4zupuDndW2WMEzXQ9GAhBR hQktuweNN9geQXap9RSL0ZrWEcxFvT00bHDcnhg/HYdDhjbysEupbahj5aMdM33WN8Av h6tnqxb1pitZiL/nnhTgaN3y/nzf3cQdjvumACcCb5QGjnvVm3UWGyKfrQoA1SLkRTUe CIVJG1T74gtMvD4/snxz9FVM9cUcA48KRmAzZpoedWbPgm70m07OdmG4UWExVQT2lSYI NCvw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tJe0RgAVjcE4Bi93UPSo74ESDMhS+XRQn205O0X8cy4=; b=E2QCpmM/5V7rTx8j07t9c/6qwg5VfxpEHkAi+PKrDybMU7FX7VL0zU2ZWcJdAU9JFX hvkYOJDTKC6Bri/L9wwb/fJ7VfRM5OB25CfiSqcvODVyr48YStF4VWsi8eQnr94KIBlQ 7pbKSZdSVpHDazll1MeXu3WOzD0QxlbpplLDQKcLnB0sG+Zy3Qwrb6S5IiI9d/GEvp64 Mw7fS+uTDrKXxYi3Tg8ctW70A3XWs1tiDa3MEYEQt+nr7zNw2+KRDv3ToUloQo7+DC9f BO//E0Mus1kW0hXqqrKtlUNn3S6P+MPhnmA9nSjYjv0X6h5GnMt/aCcLN7RYIuyR85x9 REDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qzJ5WxjK; 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 77si18438688pgb.237.2019.05.20.08.28.48; Mon, 20 May 2019 08:29:04 -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; dkim=pass header.i=@kernel.org header.s=default header.b=qzJ5WxjK; 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 S2388672AbfETMXq (ORCPT + 99 others); Mon, 20 May 2019 08:23:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:38348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388221AbfETMXp (ORCPT ); Mon, 20 May 2019 08:23:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3708421019; Mon, 20 May 2019 12:23:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558355024; bh=expjlwB/73mP3qBvKb4YwklP5U0RXcL9LpJh47zrtYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qzJ5WxjKzHLpNyIn370ClX6O6EGJr0mCuoUo4wb8mo4kSflE3jjmxmqOxxZxGO6GD VLmNg7TurdzoZjTDfFO1f27/jvfQhqtzvo9M8D964vSINWvKjwumS0zXPK1EOK5wA5 sFJGlGqu57t/hkJqUqhrRoFqhBethr0f15+n4ktg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Theodore Tso , stable@kernel.org Subject: [PATCH 4.19 068/105] ext4: ignore e_value_offs for xattrs with value-in-ea-inode Date: Mon, 20 May 2019 14:14:14 +0200 Message-Id: <20190520115251.872912200@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115247.060821231@linuxfoundation.org> References: <20190520115247.060821231@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Theodore Ts'o commit e5d01196c0428a206f307e9ee5f6842964098ff0 upstream. In other places in fs/ext4/xattr.c, if e_value_inum is non-zero, the code ignores the value in e_value_offs. The e_value_offs *should* be zero, but we shouldn't depend upon it, since it might not be true in a corrupted/fuzzed file system. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202897 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202877 Signed-off-by: Theodore Ts'o Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1700,7 +1700,7 @@ static int ext4_xattr_set_entry(struct e /* No failures allowed past this point. */ - if (!s->not_found && here->e_value_size && here->e_value_offs) { + if (!s->not_found && here->e_value_size && !here->e_value_inum) { /* Remove the old value. */ void *first_val = s->base + min_offs; size_t offs = le16_to_cpu(here->e_value_offs);