From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 EC9B32868AB for ; Sat, 2 May 2026 01:03:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777683787; cv=none; b=R/IymFgWFtOADD9dlpl2ZO06S9PcwH8A1dI8OUgq+LbDuk2YssLJlRLGIZRgxtFZ9mXshTgutR3+gCaPObwEsR/g4gtWvcS5CpaklF2Vn5QyuIagcY7XQjBFq8ip/ZJOx+SFlL7HteYnvYpZlZ+K199bdb3fOxszBKxaqoyZP1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777683787; c=relaxed/simple; bh=vAVMoN9ChhomV8WgcMM6gyYG9pZECki3XI5fEfP7NhI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TMXzFzOlaffAsGwzQQ9VOI7x0OS1vk/eWs3FMJrp1pfmdJVyfn74rN9XlEcuzIOYyPYr/vnksWHUIQkB334qBUTK2hbWi6XUlpt2902Eyul105vXiSWpTuC1EpYD5M/o3XFuRUUPQTSM234WDqnN3dZ6Ob/pHYG+0Nt9zg8xFJc= 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=Lm1NMIUV; arc=none smtp.client-ip=209.85.210.170 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="Lm1NMIUV" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-82f943870baso1101064b3a.1 for ; Fri, 01 May 2026 18:03:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777683785; x=1778288585; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=n0E83EgdT3ony/VkYAJeXhWQa6c3+LcyfrsSsEshuFA=; b=Lm1NMIUVY+GL2HLQcdsyK2JP1Laz9KFgw98+9BRmNaqpeM55PPmv5G2LCYoIlZeKoH 3t48BxccXb9aidf8XfjpvAIAdnpEqlRk7FqAv1fwQf+vk3N0m0UslLvXKTURlD3uqYQU d8dwH1RJnXM5P6Cif5UmUrE+BDl3zq5CepjnUqRakVjGnmInQM9CPfekF4fov55WvFcr 8Ph8aqpOBjAA/GmRN5hNpz+h+XxWF2LlWMSUHwcE0ETNHwvmjT490LCJNR3ei7LQbdoB PbXprAdGMHdti+uCdNdiMe5pXrEkmXKIztcs3uLi8vMv8yhGOove3iCOGC4lI3+h4ehc 13Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777683785; x=1778288585; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=n0E83EgdT3ony/VkYAJeXhWQa6c3+LcyfrsSsEshuFA=; b=Hxfs4eUFXUbni/nvkBf76YqPTeJDi3lteuhavW/BVrzyotQqETH0EBLPpMbNIz8Gii 8pvaw4gCuN4Ox2KvTcn44pI/4/KIBEw5yDPNfnSMp6ra/tp2lV8IyM9h9U30DPyjCZpx j6qaSBU44QD0B8IUbHBDgODEJWF5fx65sJQOdATYeOwC7iLtqFZZpJ88L3SDNSHZk/I+ v3eN7/DwEslnobQnBT4sd1vUH4P8FQ8WOoJ1LXOSkqWf8Kw86WrY168a3GxyFVtoWegv aG0HzZNrmVqEqurx+gMLzHfewZKmEeUvYopuY9SzFsEourPDTmDTV8GGbgcE2Uh52rA0 flLA== X-Forwarded-Encrypted: i=1; AFNElJ+UlJ464IqWjIVIyJ5wDnljmNUgXYUYqwtpn7FltuuQsm4RxGJyu5oto/B5GzgpI3pk/7mtmf0t1aERUfQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyGmxo99d0X0L5zbnsb8rh7k8Wt0dfRULZ7onqafSlXdXCZ34zO H7bZfvBkPAYwdNyrGmkpo72h78zr3U/+ZtJLC2ls9GhLDTFbQBTFxb4N X-Gm-Gg: AeBDiessnH19fGtFdBVHyrHoFgdwj0npJ4+34j84BcRD6JqzbayNP7/INAEpO5Nl9dL T8iSd8hl0fU7Z0xe0JvVDNtQ5lLYJWke/yUQEluBp5627PqT/cCJF6YcMPDLzXQC6ZpWfkTnQjK aicP1sHx7Qb2bh71cYQ+aTdSWlr59s2vkEENHnUUNwZJVqOxWOJUMu7dg9G1Hx/g8WhBweiYR2Y s3pkBfFThCD9VhVTesJoeheNUqzQkPABjRlqIeoFpntpwGEctlyYCSYCS1LqTRa2fRZjifKXleF 0a80m+dAAb68y+SwW0Tk8pZiPV2qcoE2VtGNllo2eX6HFjt4oNRWGoElxvFtrhiItooNe6njjuz lf9wkPFt6TAAsadlag2dvNs0lz+rzP2Pz0vBgevyj9E5NLf/NgGLk/ap55SbJYSjlSRc3+g0vpO 1mPs/c50D9DxuwzS99CFJYmzwSsTi07PKEcENJVepP X-Received: by 2002:a05:6a00:9515:b0:82f:aae5:c7a9 with SMTP id d2e1a72fcca58-8352d26c18dmr1257773b3a.27.1777683785129; Fri, 01 May 2026 18:03:05 -0700 (PDT) Received: from localhost ([121.237.249.41]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83515b73affsm3743556b3a.55.2026.05.01.18.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 18:03:04 -0700 (PDT) Date: Sat, 2 May 2026 07:54:05 +0800 From: Coiby Xu To: Sourabh Jain Cc: kexec@lists.infradead.org, stable@vger.kernel.org, Andrew Morton , Baoquan He , Vivek Goyal , Dave Young , open list Subject: Re: [PATCH] crash_dump: Fix potential double free and UAF of keys_header Message-ID: References: <20260403100126.1468200-1-coxu@redhat.com> <972b9a73-d066-4a38-8a4b-fe7d1ba2944b@linux.ibm.com> <401693ba-1455-4b45-8596-b81625f01201@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <401693ba-1455-4b45-8596-b81625f01201@linux.ibm.com> On Tue, Apr 07, 2026 at 03:29:18PM +0530, Sourabh Jain wrote: > [...] >>>As per kdump.rst, restore was introduced to handle CPU and >>>memory hotplug cases. Is it needed when there is no in-kernel >>>update to the kdump image on CPU or memory hotplug events? >>> >>>But in that case, we rely on a udev rule to reload the kdump image >>>again. >>> >>>I am confused about when exactly we need to restore. >> >>To clarify, reuse other than restore is needed for non in-kernel update >>when handing CPU/memory hotplugging. Yes, a udev rule is also needed in >>this case. > >Below commit explains how the reuse is utilized: > >commit 9ebfa8dcaea77a8ef02d0f9478717a138b0ad828 >Author: Coiby Xu >Date:   Fri May 2 09:12:38 2025 +0800 > >    crash_dump: reuse saved dm crypt keys for CPU/memory hot-plugging > >It got it now. This is helpful when kdump needs to be reloaded due to >CPU/memory hotplug events using the kexec_file_load system call, >but only when CONFIG_CRASH_HOTPLUG is not enabled. > >IIUC this feature is not support on crash image loaded using >kexec_load syscall, right? Glad you've figured it out! Yes, you are correct. If CONFIG_CRASH_HOTPLUG is enabled, there is no need for configfs/reuse. In v2, I've improved the doc and also added a patch to prevented using this API when CONFIG_CRASH_HOTPLUG is enabled. -- Best regards, Coiby