Re: [PATCH 6/7] vt: Update spawnpid to be a struct pid_t

From: Andrew Morton
Date: Wed Aug 16 2006 - 11:40:45 EST


On Wed, 16 Aug 2006 23:35:57 +0400
Oleg Nesterov <oleg@xxxxxxxxxx> wrote:

> On 08/15, Eric W. Biederman wrote:
> >
> > diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
> > index 28eff1a..d7e0187 100644
> > --- a/drivers/char/vt_ioctl.c
> > +++ b/drivers/char/vt_ioctl.c
> > @@ -645,12 +645,13 @@ #endif
> > */
> > case KDSIGACCEPT:
> > {
> > - extern int spawnpid, spawnsig;
> > + struct pid *spawnpid;
> ^^^^^^^^^^^^^^^^^^^^
> Should be "extern struct pid *spawnpid" ?
>

It was updated thusly: (the identifiers are a bit generic-sounding though)


From: Eric Biederman <ebiederm@xxxxxxxxxxxx>

This moves the declaration of spawnpid and spawnsig into, a header
file, and makes spawnpid extern. Without being extern the declaration
of swanpid was a nice little struct pid leak in the kernel and totally
broke the spawnpid functionality :(

Signed-off-by: Eric Biederman <ebiederm@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

drivers/char/vt_ioctl.c | 2 --
include/linux/vt_kern.h | 3 +++
2 files changed, 3 insertions(+), 2 deletions(-)

diff -puN drivers/char/vt_ioctl.c~vt-update-spawnpid-to-be-a-struct-pid_t-tidy drivers/char/vt_ioctl.c
--- a/drivers/char/vt_ioctl.c~vt-update-spawnpid-to-be-a-struct-pid_t-tidy
+++ a/drivers/char/vt_ioctl.c
@@ -645,8 +645,6 @@ int vt_ioctl(struct tty_struct *tty, str
*/
case KDSIGACCEPT:
{
- struct pid *spawnpid;
- extern int spawnsig;
if (!perm || !capable(CAP_KILL))
return -EPERM;
if (!valid_signal(arg) || arg < 1 || arg == SIGKILL)
diff -puN include/linux/vt_kern.h~vt-update-spawnpid-to-be-a-struct-pid_t-tidy include/linux/vt_kern.h
--- a/include/linux/vt_kern.h~vt-update-spawnpid-to-be-a-struct-pid_t-tidy
+++ a/include/linux/vt_kern.h
@@ -84,4 +84,7 @@ void reset_vc(struct vc_data *vc);
extern char con_buf[CON_BUF_SIZE];
extern struct semaphore con_buf_sem;

+extern struct pid *spawnpid;
+extern int spawnsig;
+
#endif /* _VT_KERN_H */
_

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