From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6E07C2D6E5A for ; Thu, 9 Apr 2026 22:08:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775772483; cv=none; b=nFdrW5TJke1M9lUvuDoDtRl6t+0bTM51BoHXHFbdfxUsVkaZqveaD0cTV7ARliCHaPMMZ06K14yncBP9WDAAMOYLXICuL56Y6WwDxfBsmNgLDmrLDceqJbXgY20KCGSU8+GKwbYW8E9PN2EKaScCDnlOymaIskHMeI53Xq5X/wc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775772483; c=relaxed/simple; bh=+G3f1pApENEjUmf8/ey15GcIeDZlQhQyE/iU1l/XDHA=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=noafSiyIYrMY7QvhFjjNwrtRAd0eYWDwMmgimhuXZgxA9tpzp9P3gYYw77IpjB2ODg5azZOqzB//0iSpuTzslUOdOeEcs/wRSbM7zZxVxi4kdZKfzTNokThFQA1cK03P1lmoy+3E/gTZ3GzqsYfxz0F+9+4ORmAtfepo8fFgp20= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=nLTyAt5m; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="nLTyAt5m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAA32C4CEF7; Thu, 9 Apr 2026 22:08:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1775772483; bh=+G3f1pApENEjUmf8/ey15GcIeDZlQhQyE/iU1l/XDHA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nLTyAt5mpJa8aEV4EsEvUSy7WoQR9BIMvp42QupSvFk18TFbfPUzXH8oSXb5KXOG+ SVXgkBzZjYd6+q+sQFdD76OtTJQTXuX4vQ+m6EWmO7JxTlbRAd/j2pYmcPqinxyXg9 PccXarbDIljFQfHWQk1vG7nmzsIIlKuCTA7xndys= Date: Thu, 9 Apr 2026 15:08:02 -0700 From: Andrew Morton To: Breno Leitao Cc: Alexander Graf , Mike Rapoport , Pasha Tatashin , Pratyush Yadav , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH] kho: fix error handling in kho_add_subtree() Message-Id: <20260409150802.fd7b91c9beea6abe4e8a63c2@linux-foundation.org> In-Reply-To: <20260407-kho_fix_send-v1-1-b21977feb960@debian.org> References: <20260407-kho_fix_send-v1-1-b21977feb960@debian.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 07 Apr 2026 10:01:47 -0700 Breno Leitao wrote: > Fix two error handling issues in kho_add_subtree(), where it doesn't > handle the error path correctly. > > 1. If fdt_setprop() fails after the subnode has been created, the > subnode is not removed. This leaves an incomplete node in the FDT > (missing "preserved-data" or "blob-size" properties). > > 2. The fdt_setprop() return value (an FDT error code) is stored > directly in err and returned to the caller, which expects -errno. > > Fix both by storing fdt_setprop() results in fdt_err, jumping to a new > out_del_node label that removes the subnode on failure, and only setting > err = 0 on the success path, otherwise returning -ENOMEM (instead of > FDT_ERR_ errors that would come from fdt_setprop). > > Fixes: 3dc92c311498 ("kexec: add Kexec HandOver (KHO) generation helpers") v6.16. > Suggested-by: Pratyush Yadav > Signed-off-by: Breno Leitao > --- > kernel/liveupdate/kexec_handover.c | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) Do -stable kernels want this? Changelog is missing a description of userspace-visible effects, So I (and others) can't tell!