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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 24 Jun 2008 22:51:22 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Oleg Nesterov <oleg@...sign.ru>
Cc:	Andrew Morton <akpm@...ux-foundation.org>, ebiederm@...ssion.com,
	mingo@...e.hu, torvalds@...ux-foundation.org, roland@...hat.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] introduce PF_KTHREAD flag

On Tuesday, 24 of June 2008, Oleg Nesterov wrote:
> On 06/23, Andrew Morton wrote:
> >
> > On Mon, 23 Jun 2008 13:47:06 -0700
> > Andrew Morton <akpm@...ux-foundation.org> wrote:
> > 
> > > I don't yet know how much additional damage will happen as a result.
> > 
> > Lots.
> > 
> > I restored the patches and just dropped the hunk:
> > 
> >   static int has_mm(struct task_struct *p)
> >   {
> > -       return (p->mm && !(p->flags & PF_BORROWED_MM));
> >   }
> >   
> >   /**
> > --- 86,92 ----
> >   
> >   static int has_mm(struct task_struct *p)
> >   {
> > +       return (p->mm && !(p->flags & PF_KTHREAD));
> >   }
> > 
> > due to that function having been turned into:
> > 
> > static inline bool should_send_signal(struct task_struct *p)
> > {
> >         return !(p->flags & PF_FREEZER_NOSIG);
> > }
> >
> > Please check the result?
> 
> Thanks, this looks OK.
> 
> Rafael, can't freezer just use PF_KTHREAD (which btw kills PF_BORROWED_MM)
> instead of the new PF_FREEZER_NOSIG flag? They look very similar, please
> look at
> 
> 	"[PATCH 1/3] introduce PF_KTHREAD flag"
> 	http://marc.info/?l=linux-kernel&m=121233423530812
> 
> 	"[PATCH 2/3] kill PF_BORROWED_MM in favour of PF_KTHREAD"
> 	http://marc.info/?l=linux-kernel&m=121233423530820

The problem is that some kernel threads may actually want to clear
PF_FREEZER_NOSIG, but it would be invalid to clear PF_KTHREAD I think.

Hmm, well, in principle we could use two flags for that, with the combinations
of bits defined as follows:
11 - user space task (freezable with a fake signal)
10 - kernel thread freezable with a fake signal
01 - kernel thread freezable withoug a fake signal
00 - non-freezable kernel thread

Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ