| Message ID | 20260924222944.3683556-8-sandeen@redhat.com |
|---|---|
| State | New |
| Headers | show
Return-Path:
<SRS0=BT2m=HQ=vger.kernel.org=linux-ext4+bounces-19804-patchwork-incoming=ozlabs.org@ozlabs.org>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@legolas.ozlabs.org
Authentication-Results: legolas.ozlabs.org;
dkim=pass (1024-bit key;
unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256
header.s=mimecast20190719 header.b=DViykgxw;
dkim=pass (2048-bit key;
unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256
header.s=google header.b=VZltkrsn;
dkim-atps=neutral
Authentication-Results: legolas.ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org
(client-ip=150.107.74.76; helo=mail.ozlabs.org;
envelope-from=srs0=bt2m=hq=vger.kernel.org=linux-ext4+bounces-19804-patchwork-incoming=ozlabs.org@ozlabs.org;
receiver=patchwork.ozlabs.org)
Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange x25519)
(No client certificate requested)
by legolas.ozlabs.org (Postfix) with ESMTPS id 4hrT7L2yrVz1y0M
for <incoming@patchwork.ozlabs.org>; Fri, 25 Sep 2026 08:30:38 +1000 (AEST)
Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])
by gandalf.ozlabs.org (Postfix) with ESMTP id 4hrT6s5GZzz4w9b
for <incoming@patchwork.ozlabs.org>; Fri, 25 Sep 2026 08:30:13 +1000 (AEST)
Received: by gandalf.ozlabs.org (Postfix)
id 4hrT6s5CWTz4wCp; Fri, 25 Sep 2026 08:30:13 +1000 (AEST)
Delivered-To: patchwork-incoming@ozlabs.org
Authentication-Results: gandalf.ozlabs.org;
arc=pass smtp.remote-ip="2600:3c0a:e001:db::12fc:5321"
arc.chain=subspace.kernel.org
ARC-Seal: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1790289013; cv=pass;
b=QlX8D2j86WBD88dsWNRgjjQJH9qmwMa776fuQlpHDRwYhRVzk6pGYcBEtXnZUX67K+4451Y/8G0i3eUwV3etQqkJaesWWc/t7etZbyDKNj+azcgxBc8W129EzYnpqYx0eG/QZc9XhFe+wlRkOQCpK3e/e6SM+6nhXNUAwddq0xA2O+HqJ12hWl9c4lTYkCXbn4Xm9h2mUPzpp1zpbDvP25WLC8MdnYKwNPaLNBPdsIV+XsNQXIp4zJ2Yl47VxZfMHkBK0zjAQtmT62z3wwlngdQCGYr87iuN4g6wJf526g1ofEHN/FcISOHdH3o167D1PEZjsFM4gBNpdmabWrwnEA==
ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707;
t=1790289013; c=relaxed/relaxed;
bh=xMcSTPpN5kocTVflAfMX/xt5pG0WUj+FRla3DJ1xx94=;
h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version;
b=JSt6dbEoJUxkb6w+jHNv5U8QVbZaykvcfTao7Q7i4k8VYXisTqgdYCHZjJ2NDK++P0NNlXIidBVz/K+plEgByY0AoEKBfxe6RKtJ9txgUsnIKBmcH7FicRTpaCNTu7QmLM0mV5ZzayXw+Uzh9gdbSszRAXXYUX6SVzUJqZIYQolrpRMW8uAnrQoK6qAR6OZyAxNMgJ7KZpSWeEizhRKnvOXH7U62cuza+61rrIqLmmQOeOJcGY8iw2IPTXzpy72aa6OXVznopqLZgz+uX2RDRkG055kAV8rj0zzZUa3WPL1hxAThLCaTYvgnD0QJRmwi0BnSnasZiH4YzGUFDmta+w==
ARC-Authentication-Results: i=2; gandalf.ozlabs.org;
dmarc=pass (p=quarantine dis=none) header.from=redhat.com;
dkim=pass (1024-bit key;
unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256
header.s=mimecast20190719 header.b=DViykgxw; dkim=pass (2048-bit key;
unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256
header.s=google header.b=VZltkrsn; dkim-atps=neutral;
spf=pass (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;
envelope-from=linux-ext4+bounces-19804-patchwork-incoming=ozlabs.org@vger.kernel.org;
receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org
Authentication-Results: gandalf.ozlabs.org;
dmarc=pass (p=quarantine dis=none) header.from=redhat.com
Authentication-Results: gandalf.ozlabs.org;
dkim=pass (1024-bit key;
unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256
header.s=mimecast20190719 header.b=DViykgxw;
dkim=pass (2048-bit key;
unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256
header.s=google header.b=VZltkrsn;
dkim-atps=neutral
Authentication-Results: gandalf.ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org
(client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;
envelope-from=linux-ext4+bounces-19804-patchwork-incoming=ozlabs.org@vger.kernel.org;
receiver=ozlabs.org)
Received: from sea.lore.kernel.org (sea.lore.kernel.org
[IPv6:2600:3c0a:e001:db::12fc:5321])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange x25519)
(No client certificate requested)
by gandalf.ozlabs.org (Postfix) with ESMTPS id 4hrT6n6pGTz4w9b
for <patchwork-incoming@ozlabs.org>; Fri, 25 Sep 2026 08:30:09 +1000 (AEST)
Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org
[100.90.174.1])
by sea.lore.kernel.org (Postfix) with ESMTP id 7554E68774
for <patchwork-incoming@ozlabs.org>; Thu, 24 Sep 2026 22:30:01 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 21D34409298;
Thu, 24 Sep 2026 22:30:00 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com
header.b="DViykgxw";
dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com
header.b="VZltkrsn"
X-Original-To: linux-ext4@vger.kernel.org
Received: from us-smtp-delivery-124.mimecast.com
(us-smtp-delivery-124.mimecast.com [170.10.133.124])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CB54408031
for <linux-ext4@vger.kernel.org>; Thu, 24 Sep 2026 22:29:58 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.client-ip=170.10.133.124
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1790288999; cv=none;
b=TnPahlcOjT8GhQr/jh42FnqxqcW+xWbfV3U0IDa8UbyOULkwCEva70cG4EKwgp9ObSkvX7mOzUSQjlFWu9h3064I4IwTTamvo7F9LsWzrmYHpaqzkd+3EYqDKAf1m4EBUk/RB7MzRbVaUqb4Ht7DUMHo1cYmVm8RPfznNXlzQv4=
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1790288999; c=relaxed/simple;
bh=UdERNbAB8vlra4wXL0TO2IlxSkvg4HTfl53kERB8wy4=;
h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version;
b=IP+uPqA1a+eOx5uZ4t+4cgd3+YXd4eZY2V6/hDGvNPnT7/KSeSikLRxo6or85dDkqLxJGJYe9n0usQDrMR8PukXkFaDuK8BxUb3s2V74IWHE8tGjsHJK8rISHIpnAx/SeD0joov9JAwMpSXiA/hUjpi2Dalzl0Ff6RWuAYVSivU=
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass (p=quarantine dis=none) header.from=redhat.com;
spf=pass smtp.mailfrom=redhat.com;
dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com
header.b=DViykgxw;
dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com
header.b=VZltkrsn; arc=none smtp.client-ip=170.10.133.124
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=quarantine dis=none) header.from=redhat.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=redhat.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
s=mimecast20190719; t=1790288997;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:cc:mime-version:mime-version:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references;
bh=xMcSTPpN5kocTVflAfMX/xt5pG0WUj+FRla3DJ1xx94=;
b=DViykgxwD1ymFPlOHaQv0eBB+pa5m/46p0QfZNiOkluXtaMtNASffa50Map7URvGIY/KhG
wNn2RLJQ6m8BsdV+I7YVf2xQqFS1iHWe6rc34/9Qso3S+AM/t9ygtm8G+HeHF3RzU39mh1
IqjKySeoj7X7Fr77U8cGCT8Sn1ymNUU=
Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com
[209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS
(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
us-mta-696-0EkR1kx0MBelTyfSbBnWew-1; Thu, 24 Sep 2026 18:29:55 -0400
X-MC-Unique: 0EkR1kx0MBelTyfSbBnWew-1
X-Mimecast-MFC-AGG-ID: 0EkR1kx0MBelTyfSbBnWew_1790288995
Received: by mail-qk1-f200.google.com with SMTP id
af79cd13be357-93a183a0e93so64303085a.1
for <linux-ext4@vger.kernel.org>;
Thu, 24 Sep 2026 15:29:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=redhat.com; s=google; t=1790288995; x=1790893795;
darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=xMcSTPpN5kocTVflAfMX/xt5pG0WUj+FRla3DJ1xx94=;
b=VZltkrsn13iaErBytvAt656Ky/i2+xuKIH++3pFY7XTOsh4BC2+TwYDDGPBSeS6G3q
gRZOFdTG+x4i/IJUrgriq4CM/x/5mAj9ZbmW53wNpkYx/dQYwq54RGrvGcCyYxhbdodX
iD0CF+TJ5IUo+gIDcYLw5DvopdjruS4t74kxRDTWV9XS5BYPMdgVO+lABULh8ZlWcp1u
ikfqk47aiP/DbmNWZmGbYYo9L0eGdQq1+66BohslNqsZrg7ucbGJuzn0gvQ4gC4kvNAm
22NJ/j+Nvy3jjouaJRQsFw628fdGsccY/dIu9vkdk+ws0HylF0u/h/I1Jm+ZkgpzvRBT
TdnQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1790288995; x=1790893795;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
:to:cc:subject:date:message-id:reply-to:content-type;
bh=xMcSTPpN5kocTVflAfMX/xt5pG0WUj+FRla3DJ1xx94=;
b=dxbx6NbeeWwgB2jKibdlp/8YLyjNoC+Z1IX8jbfFuODz0AMig6w445vsCu+80P9e/K
alhlQKV3YKF5WJ91DXs6TQNpa+ZMWNdq6ZWScoN+DEuo2Djnl2ajmQm71V8QG/owudV/
1mnVDqtTG57p47PcvPPzusbFn5x+lLrRJuVEc6b+wTdLrdt+oZxC5o8AL7dOX3EkO/CZ
vIXTZky3sDdYcLxueVawz4DHP6yiCiZcwpXxg2pNduUM7ZT7hOxCkTNRaqKOrt4qc7Qa
aV1SIAESyOVRdV3jwRTE0esdRkGSSrgmAmDn+q9tEDI4PFfe/w9YwifNBX7xyJaXgH86
YhEA==
X-Gm-Message-State: AFuF++kS7o9ii1UfK19HrFL2YHcLHfr5Yk2i55j5bnfBosB2ZDwY4+qN
BjDkv5lHqeE+fJrwemCqDD6KfcO3YVcCwJE3pFxQQuDQmNCLchdNCBLV1MpP44z369XuIIQmuLz
xZfxkW47BTJz6+FIlW2nCWdLIziok/12lGw3ssURk3iv4UJ6rPVt7YGtdOFXh3hhOtYsgzhkUaG
P3ok5byWDNB/oJV7p95bTTmu7+tdeKefNOvXiKO7XRJ4BmVGZp
X-Gm-Gg: AYBFou0XI/xMvJDiAO299dVUF7qfVc518S5SY7nUHMKlW/bv1BGXgWet8zMhIh//aFN
N5lVkXB8ZndrS1LLitlnd0TPnoOWAnGtsM5kkzrbsJc/ztgPwA1aCYxnNNZlDmj4ljGcsY6zZKa
elGXHlLjLhVXMmrEpO/ef3RRGjN+JU8p9pGpBMAv7XtQb4JmWmL/c78aNIpWMt6GpbQvHF/VLH2
AO0FRKHwDxf5SjJwEJhwb5GOePwwEJL1UiTNmOLdEtVMtnPMhDzrP7NPiBWsJciY13uM3lUyJUI
OqAIC2VRFmBptIC2z7J4xMuA3OshMsCRRvX47YTfZENEfxus4YinTP2318bp8fRjMhpO6JEw3P1
WwTYLOQpptxBQGJXxlWv2WDgu6da3UbMIzFykVg==
X-Received: by 2002:a05:620a:4612:b0:939:5ab4:e6ab with SMTP id
af79cd13be357-93c43b8352amr148130185a.5.1790288995140;
Thu, 24 Sep 2026 15:29:55 -0700 (PDT)
X-Received: by 2002:a05:620a:4612:b0:939:5ab4:e6ab with SMTP id
af79cd13be357-93c43b8352amr148127185a.5.1790288994695;
Thu, 24 Sep 2026 15:29:54 -0700 (PDT)
Received: from big24.sandeen.net (97-116-156-223.mpls.qwest.net.
[97.116.156.223])
by smtp.gmail.com with ESMTPSA id
af79cd13be357-93c44972febsm37216985a.39.2026.09.24.15.29.53
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 24 Sep 2026 15:29:54 -0700 (PDT)
From: Eric Sandeen <sandeen@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu,
sandeen@redhat.com,
agruenba@redhat.com
Subject: [PATCH 7/8] resize2fs: fix ea loop in update_xattr_entry_hashes
Date: Thu, 24 Sep 2026 17:23:41 -0500
Message-ID: <20260924222944.3683556-8-sandeen@redhat.com>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260924222944.3683556-1-sandeen@redhat.com>
References: <20260924222944.3683556-1-sandeen@redhat.com>
Precedence: bulk
X-Mailing-List: linux-ext4@vger.kernel.org
List-Id: <linux-ext4.vger.kernel.org>
List-Subscribe: <mailto:linux-ext4+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-ext4+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled
version=4.0.1
X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org
|
| Series |
e2fsprogs: fix extended attribute iteration loop bounds checking
|
expand
|
diff --git a/resize/resize2fs.c b/resize/resize2fs.c index c8964af5..49aa039c 100644 --- a/resize/resize2fs.c +++ b/resize/resize2fs.c @@ -2039,13 +2039,28 @@ static void quiet_com_err_proc(const char *whoami EXT2FS_ATTR((unused)), { } +#define fatal_err(code, args...) \ + do { \ + com_err(__func__, code, args); \ + exit(1); \ + } while (0); + static int fix_ea_entries(ext2_extent imap, struct ext2_ext_attr_entry *entry, struct ext2_ext_attr_entry *end, ext2_ino_t last_ino) { + unsigned int remain; int modified = 0; ext2_ino_t new_ino; - while (entry < end && !EXT2_EXT_IS_LAST_ENTRY(entry)) { + /* take finish entry 0UL into account */ + remain = (void *)end - (void *)entry - sizeof(__u32); + + while (!EXT2_EXT_IS_LAST_ENTRY(entry)) { + /* end->e_name_len is within the first four bytes */ + if (EXT2_EXT_ATTR_LEN(entry->e_name_len) > remain) + fatal_err(0, "corrupted extended attribute field"); + remain -= EXT2_EXT_ATTR_LEN(entry->e_name_len); + if (entry->e_value_inum > last_ino) { new_ino = ext2fs_extent_translate(imap, entry->e_value_inum);