From nobody Mon Apr 08 06:49:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VCfp20Nz5z5GL7p; Mon, 8 Apr 2024 06:49:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VCfp166vRz4mLy; Mon, 8 Apr 2024 06:49:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712558953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B1763JEkBMLvX7HDwyWO9l4WOjczfLnUulbpsWxEjVg=; b=rj1BugbkeFLgoe0ygtn8RpPcZ7zI8ppBXdYXIWenlEYOuc2MdCVtt6pDsThH5ybayyZTs9 e8sWZr1STqcrnpCNg+8EpIv77s7DsRt2AnNx6BDz5pkq/BlU5OliZf0PeP6SGf558W4Gh4 yEXnAyPItcOoY7P4haInTORTqerxGGVvTRUnzD1K09wdeAWJbJ3pjWP8ONEj8TH10CzaBf cx75M/UtTZeM99clk/4i/bJuJ7TUF+ylm2kXUr3aAWFjiGUCZEhIDlGrzHUHsd3sC5fCLD UA5IgvXsJleJjoQbtmraA2OnX/BSZbxXmet7vb669jH5u3vDezR9xXJ9iNB5jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712558953; a=rsa-sha256; cv=none; b=tk8gxpm2QIXVwfpJJ73IJiLgtXQYeUzaOEz+oRH/sN8L1JBKl+JahD4gpz7MYzazNM4f4k Su2qAxRXOtwtQX6uWnx0XS+fwmSAU5OGx55UkfIV6wCTabQSCwf6HXlcBER7sb06OCeZYW P8RGSiFCOIz0qLuGvZwA9xAguYvHcYjPqt41HxIN18tQ9Lql8YYq78/QXwK3RXJmoQ/Cya bynHDoShqsixXEqQqIp6rHCnzSXHvzGfeRgBJWRK2hjSqTAH8i/EgQ3mIGPdhEBClsnqCd 5Yvdm5PRX3TD1y2ppnlfRT5XfLEKfylYAN2m2C2L9nZXDRuHWYrlnqPiK3Uzmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712558953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B1763JEkBMLvX7HDwyWO9l4WOjczfLnUulbpsWxEjVg=; b=eMwBzS62Geoad1791333sfNwet55rFfHZV26peRP1qUcJ5vseAyI/S9oybLTuLDA09+CIb xFJR4coq7n8KC5Fx0O0BuNgHNki+uthrrWssxcs98wYJI8ijBEq3uNOZP/5HhtzAn+tsm4 4cZynMWVOoJ7wvzK2Kw/R9Y/fPcKqNlEDSMgbtZCAzGQo/2mTqPn1wObNVQtesjB1R5oGy mx7kL5FavU4dwaE/uu4YFbKqnPHjOz/LE8EGONw2GRLS2TO2d+f1xZbUbqJoQYRTMK6hwe /U8ZR1OuH/iCoWuGVioDuvgnxd9cQfHaQIwJ1Klwvto4B2iJ476zCv3T7kTSiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VCfp15kwDz11h4; Mon, 8 Apr 2024 06:49:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4386nDOX032847; Mon, 8 Apr 2024 06:49:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4386nDQm032844; Mon, 8 Apr 2024 06:49:13 GMT (envelope-from git) Date: Mon, 8 Apr 2024 06:49:13 GMT Message-Id: <202404080649.4386nDQm032844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 61fb195e8dd0 - main - LinuxKPI: Improve timer_shutdown_sync List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61fb195e8dd08d4b006a176c09682f061424cb95 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=61fb195e8dd08d4b006a176c09682f061424cb95 commit 61fb195e8dd08d4b006a176c09682f061424cb95 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-04-08 06:47:42 +0000 LinuxKPI: Improve timer_shutdown_sync timer_shutdown_sync not only shutdowns a timer but prevents it rearming. Sponsored by: Serenity CyberSecurity, LLC Reviewed by: emaste MFC after: 1 week --- sys/compat/linuxkpi/common/src/linux_compat.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 36ed7b84cc94..a6eb7bb17e16 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1920,6 +1920,10 @@ linux_timer_callback_wrapper(void *context) timer = context; + /* the timer is about to be shutdown permanently */ + if (timer->function == NULL) + return; + if (linux_set_current_flags(curthread, M_NOWAIT)) { /* try again later */ callout_reset(&timer->callout, 1, @@ -1992,6 +1996,7 @@ int timer_shutdown_sync(struct timer_list *timer) { + timer->function = NULL; return (del_timer_sync(timer)); }