From nobody Fri Dec 19 00:41:28 2025 Received: from mail.nppct.ru (mail.nppct.ru [195.133.245.4]) (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 D5F5E18A6C5 for ; Sun, 26 Jan 2025 10:19:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.133.245.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737886746; cv=none; b=o/9NlwVpRS1CNyC4Cbz/ArBQdWrdL93NNjtXmHutFdV+K9x5MXHGcwvYMsTI5+pp3jDlXtMnMhlm4SXa7Yy2G6UawgqmZ1xKEPui/8gkfZ8/Ps00HhaTcwO0y5wnocxo6JJ12hGEHC5c6m+0GTU5QrWUkjVJkazDRh62e75sou0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737886746; c=relaxed/simple; bh=scK5uZJeCukheXVeSQLJv4paF/hGr7MlavJuyTzXK6M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FdJoqTC+22qUzw+l5mFoUyeomUFLdSQEdR6iQNNJlSpzg2lOtfhTbERkOE8OBj5eEFg5b1cZIi2rVdGQUMv92wyN1Vfp0xoBjEH8TM8xYl1UtHTUbcVD0eHI5c+xyx2KltzLY9wS76MNMQAr+nqUrWVSOqTJka6oeXxC9LpavA4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nppct.ru; spf=pass smtp.mailfrom=nppct.ru; dkim=pass (1024-bit key) header.d=nppct.ru header.i=@nppct.ru header.b=hQWHxXIY; arc=none smtp.client-ip=195.133.245.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nppct.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nppct.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nppct.ru header.i=@nppct.ru header.b="hQWHxXIY" Received: from mail.nppct.ru (localhost [127.0.0.1]) by mail.nppct.ru (Postfix) with ESMTP id AD6451C242A for ; Sun, 26 Jan 2025 13:10:08 +0300 (MSK) Authentication-Results: mail.nppct.ru (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=nppct.ru DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nppct.ru; h= content-transfer-encoding:mime-version:x-mailer:message-id:date :date:subject:subject:to:from:from; s=dkim; t=1737886205; x= 1738750206; bh=scK5uZJeCukheXVeSQLJv4paF/hGr7MlavJuyTzXK6M=; b=h QWHxXIYGQvpYqVAcOiC5xpxCyg6jcPWueCppsyWrx/j+QFetoiPdDOb+tQ5KBgtA D00YmKXu27Vx07HWl0ANwdeaeRmOgJgmcd0r6gs9ZzwGmu0LRf2Uzs76sYJZkazK rHJ/1oBH6vHcIscpi2qlMPnGwfgUkWMLe+hhpnZhJE= X-Virus-Scanned: Debian amavisd-new at mail.nppct.ru Received: from mail.nppct.ru ([127.0.0.1]) by mail.nppct.ru (mail.nppct.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id BuD91J_GDxok for ; Sun, 26 Jan 2025 13:10:05 +0300 (MSK) Received: from localhost.localdomain (unknown [87.249.24.51]) by mail.nppct.ru (Postfix) with ESMTPSA id 510B21C2418; Sun, 26 Jan 2025 13:10:03 +0300 (MSK) From: Alexey Nepomnyashih To: stable@vger.kernel.org, Greg Kroah-Hartman Cc: Alexey Nepomnyashih , Thomas Gleixner , "Peter Zijlstra (Intel)" , Juergen Gross , Ingo Molnar , Josh Poimboeuf , "Steven Rostedt (VMware)" , linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH 5.10] static_call: Replace pointless WARN_ON() in static_call_module_notify() Date: Sun, 26 Jan 2025 10:09:24 +0000 Message-ID: <20250126100925.1573102-1-sdl@nppct.ru> 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: quoted-printable Content-Type: text/plain; charset="utf-8" From: Thomas Gleixner commit fe513c2ef0a172a58f158e2e70465c4317f0a9a2 upstream. static_call_module_notify() triggers a WARN_ON(), when memory allocation fails in __static_call_add_module(). That's not really justified, because the failure case must be correctly handled by the well known call chain and the error code is passed through to the initiating userspace application. A memory allocation fail is not a fatal problem, but the WARN_ON() takes the machine out when panic_on_warn is set. Replace it with a pr_warn(). Fixes: 9183c3f9ed71 ("static_call: Add inline static call infrastructure") Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/8734mf7pmb.ffs@tglx Signed-off-by: Alexey Nepomnyashih --- Backport to fix CVE-2024-49954 Link: https://nvd.nist.gov/vuln/detail/CVE-2024-49954 --- kernel/static_call.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/static_call.c b/kernel/static_call.c index e9408409eb46..a008250e2533 100644 --- a/kernel/static_call.c +++ b/kernel/static_call.c @@ -431,7 +431,7 @@ static int static_call_module_notify(struct notifier_bl= ock *nb, case MODULE_STATE_COMING: ret =3D static_call_add_module(mod); if (ret) { - WARN(1, "Failed to allocate memory for static calls"); + pr_warn("Failed to allocate memory for static calls\n"); static_call_del_module(mod); } break; --=20 2.43.0