From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pz2-f9.google.com (mail-pz2-f9.google.com [74.125.228.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9897443A9D for ; Fri, 14 Aug 2026 08:14:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786695298; cv=none; b=W2KJ9eeh9WI0I0xjoxIDpAfjvDnNhqjZoSZIioNrXjpTS20LMpC7Oi1Hvk/4txSgS15DK5xlsMHHBxICHLIQ8jCUgkTCnRMwuwYdfiRcttjCH2d90utddBZ6G9KhLrRoSTYo5NSUAS4A/XcyoSj58vyhiKLVoO4lPH8RPjKfegM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786695298; c=relaxed/simple; bh=kEwHUAh9ewS3dJDyKb1n4yEAHcPYrkol6ClYvFyrCOI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=QBZC4/I3hKozXIXxc+AhBtGza9HUu2daFuzH7HfGJxNgEuKt+/9CbDlWqFO4kke/9coRIt5SFq76WFkdzSFS+uH0veA9y6GcV5AZNhSxPozPrB67aHt71tY2meiVKdA3QSnLP4DCei3JEZ3HnHyodfp6z6x7hXtShOdmUcFkE6w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=loMxWZ5c; arc=none smtp.client-ip=74.125.228.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="loMxWZ5c" Received: by mail-pz2-f9.google.com with SMTP id 41be03b00d2f7-cbbc9e6e637so218279a12.0 for ; Fri, 14 Aug 2026 01:14:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786695292; x=1787300092; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=L4ghwLD+QfPnlvCNwm0Xh6QvcMbP7hR78uAWqfejPRY=; b=loMxWZ5cd77gkDxeJIOKjFjSnadZslfPmOjlR8fGd3s61UO5egBUw1x7kUOti+YcLY h6FmmFUj9A1CMnttjFuAVj0o9d2+ZIZ0s/toYLGch/+TtOqCpeh4HdIOZDcTGQdsyy83 G/SKiCFgAA69e0OURZUgEzxzQ1bKlVy4DPPrVL1drHbGKD5iSEy0JTNxd0i9xgpqmITX uM3Sv0FIGV1l8cu7Or2braGOTNTwVVR9glPVR88iYkAfOqA3sU5bMSeXZcN/TrE6iJzV kU/m2jdQeQ3ugkEuD6vyH2v0BV9H5iZfSwsu/CXxvc4baXVLTsE73S5HzBDY4cFCJgSB qc2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786695292; x=1787300092; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=L4ghwLD+QfPnlvCNwm0Xh6QvcMbP7hR78uAWqfejPRY=; b=Cj50jIueWZ8/0kr18WpY/K72dNFzuQ4WWsVpeGhCVijWOwuHGg21rikY4lPM8Ccx8z /qZ5tqwZEKjLCXYXOQdxs5LOv+SAZJdGRJRXn2LXAWU2RuAM7bpVMt9hlAfAJDH6wpH+ GMQ48SzbrEJqVc6F1hQpWvmoWNBP9+ffIgZP8/J3ejxmJ2BN6F8YPgPvf8OpSUviT6Mz 7U45OHehugjHxAwZGgJK6XYrJf/VHoDWL5b3LYjc5+q+pKtXH9i/JMZPL1IYXY29G1qS prnr2+Cu5f5+TkPS9ZkWuHgTm8FdS+cmmWKLl3ae3OqZORlPqcN3Awwra2Vq8nMgWKON 1ILg== X-Forwarded-Encrypted: i=1; AHgh+RrPVHJULP3bQGSXzzL2AkJGTMtX9rksryi63qgTx5jtDE/oLggaX4vUONbOyBhxiKVXtUGwN3izgnX9hgc=@vger.kernel.org X-Gm-Message-State: AOJu0YwYqldaqfTw9mS6ZVh7yUwOeM2KtrnfHucunzy0+Yx/MG1u4v6P LdwB7cXvraMteidX11Z0J4iBeROXXpiGOEUKblVT63azfYrCdZV7S3lA X-Gm-Gg: AR+sD11P1LVX4+siPV1XJO0Zi3Re1jjyZA2wcQOKoKaG8ElYEkFM0GofMMwEIFH82vM 8yitc8v7fHoF3K5G9JZ+DyS25bHdp0wsJRlOThhRQCfpZY64mKeFhM/wKn1pz7yynms0XGnNRtM Yg8zb9SMLPBN0ELjOwvQsY9FZuSYqMiyAKv5wsH2eGLwsju/qMMNyKYpmaE3+g891yM2GfQ3EWP S8M4nZ+Ct4FYqygVAl+z3Ooyhb4KNqEebOJ+1WuMPvY/HKfADgodsocZPbvfhyvcCESXIaxoXkY W5MuFpS0hsYctcOex3gSespwj/xtl1ps4j0ObW4OK3463ivDeWAvbKgfZw0F8s/bw+1xBo20lKe rgcxPfQ4v0djgu8bSeJ9bs3P6oxxIm2kmoQEXaWI6BItw0/YuwL44vaZHALJ8fJzPIa2XzU2k9n KqU3X+aX6bYVpJk7oyNBvcya6tEFQpWRjYui4ET3A7y9mFvryxnxaMJySkqZk/Srd/7nV0Wdem6 OAlTQ== X-Received: by 2002:a05:6a00:929b:b0:847:9745:2f8f with SMTP id d2e1a72fcca58-84fde20af67mr3537676b3a.18.1786695292078; Fri, 14 Aug 2026 01:14:52 -0700 (PDT) Received: from intel.company.local ([122.11.210.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8517cfeb39esm149986b3a.4.2026.08.14.01.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 01:14:51 -0700 (PDT) From: Wandun Chen To: robh@kernel.org, saravanak@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] of: reserved_mem: fix a few reserved memory issues Date: Fri, 14 Aug 2026 16:14:40 +0800 Message-ID: <20260814081443.1061046-1-chenwandun1@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Wandun Chen This series fixes a few issues in the reserved-memory handling: 1. A region whose early reservation failed was still counted and initialized by the late scan, handing unprotected memory to a device. (patch 1) 2. A statically placed region overlapping an existing reservation was accepted, so the overlap could be used by two regions concurrently and freed on init failure. (patch 2) 3. A dynamically allocated no-map region was never returned to the buddy allocator when its driver init failed: only memblock_clear_nomap() was called, leaving the entry in memblock.reserved. (patch 3) Sashiko reported the original issue in [1]. This is sent for review now; given the v7.2 release is closing, there is no expectation to merge it this cycle. [1] https://lore.kernel.org/all/20260806100605.2C2C01F000E9@smtp.kernel.org/ Wandun Chen (3): of: reserved_mem: skip init for regions whose early reservation failed of: reserved_mem: reject statically placed regions overlapping existing reservations of: reserved_mem: release dynamically allocated no-map region on init failure drivers/of/of_reserved_mem.c | 69 ++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 14 deletions(-) -- 2.43.0