public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cedric Le Goater <clg@fr.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Paul Mackerras <paulus@samba.org>
Subject: Re: [RFC][PATCH -mm] replace cad_pid by a struct pid
Date: Thu, 21 Sep 2006 15:21:23 +0200	[thread overview]
Message-ID: <451291D3.10401@fr.ibm.com> (raw)
In-Reply-To: <20060920143028.fd446145.akpm@osdl.org>

Hello,

Andrew Morton wrote:
> On Wed, 20 Sep 2006 11:38:35 +0200
> Cedric Le Goater <clg@fr.ibm.com> wrote:
> 
>> There are a few places in the kernel where the init task is
>> signaled. The ctrl+alt+del sequence is one them. It kills a task,
>> usually init, using a cached pid (cad_pid).
>>
>> This patch replaces the pid_t by a struct pid to avoid pid wrap around
>> problem. The struct pid is initialized at boot time in init() and can
>> be modified through systctl with
>>
>> 	/proc/sys/kernel/cad_pid
> 
> hm.  Is there any sane scenario in which C-A-D would be directed to any
> other process?

I don't know. I really looked hard to see where this was used and i didn't
find any distro using it. 
 
> What happens if/when the process which is identifier by
> /proc/sys/kernel/cad_pid exits?  User error, I guess...

kill_pid() fails.

>> +extern struct pid* cad_pid;
> 
> Whitespace violation detected!
> 
>> -	if (shuting_down || kill_proc(1, SIGINT, 1)) {
>> +	if (shuting_down || kill_cad_pid(SIGINT, 1)) {
> 
> So your patch actually makes functional changes: lots of random
> init-signallers gain extra functionality: the process which they signal can
> now be configured via /proc/sys/kernel/cad_pid.  But by default, things
> remain unchanged.  Fair enough.

yes.

>> --- 2.6.18-rc7-mm1.orig/drivers/char/nwbutton.c
>> +++ 2.6.18-rc7-mm1/drivers/char/nwbutton.c
> 
> This driver can be compiled as a module.  I shall add the missing export...

oops thanks,

> (And I'll fix the parisc build too)

the only parisc i have still runs its native hpux 11. 

do we still need /proc/sys/kernel/cad_pid ? If it is obsolete, i'd send a 
different patch to disable this feature with some warning in dmesg and the
kill_proc(1) would stay as they are.

but may be some small distros for embedded linux use it.  

thanks,

C.

  reply	other threads:[~2006-09-21 13:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-20  9:38 [RFC][PATCH -mm] replace cad_pid by a struct pid Cedric Le Goater
2006-09-20 21:30 ` Andrew Morton
2006-09-21 13:21   ` Cedric Le Goater [this message]
2006-09-21 17:39     ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=451291D3.10401@fr.ibm.com \
    --to=clg@fr.ibm.com \
    --cc=akpm@osdl.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox