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 BB0FF2494F0 for ; Thu, 21 May 2026 22:44:32 +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=1779403473; cv=none; b=pItN8ClDDThE4++xUY2zriYEySDLmjBnyOtTtwnAxWiInJ5ANKa+k4MHCFqpioPufmw/RniG17/7DXQM1JGG8RtWdIvSasTAZPCFef2YlZ57OoFtwdsesxS5UX1WKvD1C0mUnfst+4NEqmTxIjTjUbu4cy00ru2HXTkyhvj6s/E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779403473; c=relaxed/simple; bh=uhJD0cb1C/jeAy7mlkL5/rpMCx0+B3s2n1w5v5isS44=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=YBTHv2U9V4239Df37oQNDp4lNuXXRqOVx/y03VTPfMFxeNI5AqR+5kEm7SsOguarP7AhoS1SCW4UpsyenVHZ2pM68iGN2Dvgc+hGxmqgbrkld1DSyrHfrGEQGQDU4v05YCd4qn+asOdVSE2gnZJ4nzUNUt4izl6hqiJY+6+mWfA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PqW/l0fU; 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="PqW/l0fU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B0EF1F000E9; Thu, 21 May 2026 22:44:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779403472; bh=rnB4kN/tOx2ErVQGUg/PDWLqnB/m3dv/ZnSJFKt4sdc=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=PqW/l0fU6W2G3j8NXCtAaMb5ldJy+ZhIdyKjJ/JJFfmZ7iRkYz0HdCoS6MyYe9lEb /5nDxuzNVZZqnVPcBF+d8Mp+xr4qnLPO7OVvnhBUGStSvuWFPBMDmXQ6zPGMxW4MCu qgpQ1nOhZRMxRe7bhCcPXPfAp7auVjXoEv1LeRuqGmxgGZK5DH1dlfFeuyCmwN7gk2 +S28eCC8GFQ0j616qZDwWmuJ56LlbkHNB3qlW0kQN3VCGDxAFECdDE85uRGUXDl7Z9 jPVVR9YJX4J6OrN6pGxrXFgQySNjjXV68cJWi4tDBS31odP/3l5qqcvcz7DKMjRvWq TE1Mrdrvdjs1Q== Date: Thu, 21 May 2026 16:44:28 -0600 (MDT) From: Paul Walmsley To: Zishun Yi cc: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, alex@ghiti.fr, kees@kernel.org, charlie@rivosinc.com Subject: Re: [PATCH v2] riscv: Check the return value of reloc handlers In-Reply-To: <20260509074046.1747927-1-vulab@iscas.ac.cn> Message-ID: References: <20260509074046.1747927-1-vulab@iscas.ac.cn> 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 Hi, On Sat, 9 May 2026, Zishun Yi wrote: > Currently, process_accumulated_relocations() ignores the return values > from both reloc_handler() and accumulate_handler(). > > As a result, the kernel will proceed to load the module with corrupted > or incomplete sections, which can lead to unpredictable behavior or > kernel panics. > > So we need to check the return values of the handlers to propagate the > error, and fall back to the cleanup mode. Thanks for the patch. Rather than continuing to loop without purpose when an error occurs, can the function simply be exited? - Paul