From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 6D6E93AB5DE; Mon, 7 Sep 2026 19:42:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788810152; cv=none; b=ZCZlHmjMjCscfMipqH5sQHKV0eY3T7zZ236tbJAl8WRXKywqlKTKPgxBFl23xEYDhkOFQa4czoWTZKdo1k9RKcg7tKSzutYHu6WLYvyo9af8YkYQrsMdMgopuJJhce8eOPAmGmh16Ilf5ZY3/aGMV1ka9gnZ4sYx35b5IElpYoU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788810152; c=relaxed/simple; bh=IwH3FuM5Wbks8HTKxzyW4z/1bW+NjkDXu4BJZySaiG0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f5+lbGpud87iMsOepg7n6eWFQgkzpMmijvDCsX9o2TYDO9HE2ULEDX7J6Jj2mcghpvtqH+WbIlFzDXPABXedz0M3R9qj2IHKmH4VMt0T4s/Y5cmShO8460iwi+MYe5H0SY+q/9Rt5BjQom5M+UPooOgonISnoGIwv+nc4swNxEM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KEj9O9xu; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KEj9O9xu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 748461F00A3A; Mon, 7 Sep 2026 19:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788810150; bh=IwH3FuM5Wbks8HTKxzyW4z/1bW+NjkDXu4BJZySaiG0=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=KEj9O9xu/+6yoEgPy64ynq1F6oTS+ys2H+2YURc6D7yBeruySU57DmZG+OIHd9/M6 CAV9nkyt1eBeCSacTWcy/K3o2I1uvtfWtmSt46htZ/mFKL0T0NocdaDxEitD/BVqS9 nz+sSpq7HSPH9fZn3I9+xRl+yMB1g6jAuSXFonU0lgGQtnxi581INhLIU0XaUt3XE7 UMmd+8/a85xNHHTOYJDJfRA65FnQYZtXfSeq00kDcJnAApvRwR7XenQd9/EJCxaRd4 Itm2Vy7tLcOEfq4tyJ/Koni6vIQBkR1PUQDyx+tWjPND7cxaTyvMSQyxhkm1eXKa8k 8N0ytOnz7Nj/g== Date: Mon, 7 Sep 2026 21:42:01 +0200 From: Daniel Gomez To: Hao Ge Cc: Luis Chamberlain , Petr Pavlu , Sami Tolvanen , Aaron Tomlin , Suren Baghdasaryan , Andrew Morton , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, Sashiko , Bradley Morgan , stable@vger.kernel.org Subject: Re: [PATCH v2] module: fix lost error code from codetag_load_module() Message-ID: <20260907213815.0-da.gomez@kernel.org> In-Reply-To: <20260827030503.49171-1-hao.ge@linux.dev> References: <20260827030503.49171-1-hao.ge@linux.dev> 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=utf-8 X-Mailer: lorebird On 2026-08-27T11:05:03+08:00, Hao Ge wrote: > If codetag_load_module() fails, err is not set to reflect the failure > and load_module() returns 0 after the module has been torn down. > > Also, if the module is a livepatch, mod->klp_info allocated by > copy_module_elf() leaks on this error path. Free it via a new > livepatch_cleanup label. > > Fixes: 044d2aee6c57 ("alloc_tag: handle module codetag load errors as module load failures") > Reported-by: Sashiko > Suggested-by: Petr Pavlu > Reviewed-by: Bradley Morgan > Cc: stable@vger.kernel.org > Signed-off-by: Hao Ge We need the unwind from codetag_unload_module() as reported by sashiko. With that, Reviewed-by: Daniel Gomez