Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp247410yba; Mon, 20 May 2019 08:05:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCSvEidxM5SptPS1kEOV1lRCO7JIhpBIvHsSP4F2eN66u6JScU9yuGDBny4ZmOTQGgTK0f X-Received: by 2002:a65:4105:: with SMTP id w5mr76294748pgp.260.1558364715096; Mon, 20 May 2019 08:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558364715; cv=none; d=google.com; s=arc-20160816; b=YmVZK3HSw33PHp2Sa8GA0x2RSc6fjHjPRfcyHHQ376VEtXpiRQWX/NxIoJ7v1Khh5P iiEJYv/xACNyxmmLPP9Kgfxt93hDmKdqgGwU6kflT3QJ4ph/FsPkOOVakvxSbiYYWSBQ Jzo7cSCJvZoSALb3n8o6T8bTykU0hjLdtu8kDnjUYR/bjq3DVLEiMAfq9koIPQAud1PY n7Vk9xVhC0eUZzVv1HpxzmC+6k0K1PkdcGC4q5quZma719i+o+1JUu2IQR7xZkF7sRkC kgtvXXg9WUoMX43Li11MpX/9vQESm6DwCVl+jPujv47mBuVV7x9U2EDWAXSo7OVJYZyN /aLw== 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=ofkt0EjVRXnGMd6So0VtyLtIRAF5XrPEQ+H8nM8w7+o=; b=Jjv3/L0fl/6lU2s/0Od7fv+xVa+IMu1/yCpgDnfIyE00cc6PjD0IHAfa8Z4Qoiio6f CRtgczied+Nn0QHpRgIXVm6h7ogabAzT+e1wwePNDjPthxqV1Rhuruam2st/Rq5NYc1e OemN6b2mhp6MtXCEnmzEkHAdBqLKGNteKpfanpanwyqfzdYzI420EYgvjlBOT74sILhD IC8NWNzKbeol0sslYQKRVmcFRBOoWVwx9ioHYyxSk/Hr0aZjqFRrOLvwU+FqJoCiNf+q ggOvasKTZ6+PSngXYK5xZo+T6KPlEzZ7ZASlk9LLg+HQUbt6SaK5DgR1+cql7Nm+6Zxe C9Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nQLlp465; 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 3si16383279pli.78.2019.05.20.08.05.00; Mon, 20 May 2019 08:05:15 -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=nQLlp465; 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 S2387871AbfETMTt (ORCPT + 99 others); Mon, 20 May 2019 08:19:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:33042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730795AbfETMTr (ORCPT ); Mon, 20 May 2019 08:19:47 -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 EA96C20815; Mon, 20 May 2019 12:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558354787; bh=Y6EuyZEjvaLernhvKw4omgcW49gcVTdIABeEb1lxmfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nQLlp4650Wj78DZdHdLpmNiq1HIXvN8J6GrNVLVGJQQmW7LQdQm2ENTWWPl1tNYGc iWkMDWrxbaJzhPT2I2YSxbJwRLgJQas259UgPyGx4LGN9dzDUdyqQVQLiP+w1JS4UD HQs6YY3O0Yw5AVDjAWjrNdb1l4jbCpPUG4njihws= 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.14 42/63] ext4: ignore e_value_offs for xattrs with value-in-ea-inode Date: Mon, 20 May 2019 14:14:21 +0200 Message-Id: <20190520115235.746611796@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115231.137981521@linuxfoundation.org> References: <20190520115231.137981521@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 @@ -1698,7 +1698,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);