lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2v47s2xlbmuz2mgxk2p7o2q4t343nde6hkyqxpmfgmrjygmrz7@alrwuxvupe36>
Date: Thu, 10 Jul 2025 17:44:55 +0200
From: Michal Koutný <mkoutny@...e.com>
To: Chen Ridong <chenridong@...weicloud.com>
Cc: Peter Zijlstra <peterz@...radead.org>, timvp@...gle.com, 
	rafael@...nel.org, pavel@...nel.org, tj@...nel.org, linux-pm@...r.kernel.org, 
	linux-kernel@...r.kernel.org, lujialin4@...wei.com, chenridong@...wei.com
Subject: Re: [PATCH next] sched,freezer: prevent tasks from escaping being
 frozen

On Mon, Jul 07, 2025 at 12:02:47PM +0800, Chen Ridong <chenridong@...weicloud.com> wrote:
> I was looking at the WARN_ON_ONCE(freezing(p)) check in __thaw_task and started wondering: since we
> already have !frozen(p) check, is this warning still needed? If we can remove it, maybe reverting
> commit cff5f49d433f ("cgroup_freezer: cgroup_freezing: Check if not frozen") would be a better approach.

I think freezing(p) (the part of global freezer) and cgroup_freezing(p)
should be consistent with each other. AFAICS, the former predicate is
derived from pm_freezing and that is set all the time between
freeze_processes() and thaw_processes(), i.e. it stands for both the
transition (freezing) and goal (frozen).
With that, the warning in __thaw_task() is incorrect and the solution
might be the revert + drop the warning.

(Or transfer the logic from cff5f49d433f only to the warning like
@@ -204,7 +204,7 @@ void __thaw_task(struct task_struct *p)
        unsigned long flags;

        spin_lock_irqsave(&freezer_lock, flags);
-       if (WARN_ON_ONCE(freezing(p)))
+       if (WARN_ON_ONCE(freezing(p) && !frozen(p)))
                goto unlock;

but I'm not sure the warning buys us anything in either case.)

0.02€,
Michal

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ