Re: [PATCH] introduce put_pid_rcu() to fix unsafe put_pid(vc->vt_pid)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2 Dec 2006 02:48:26 +0300
Oleg Nesterov <[email protected]> wrote:

> drivers/char/vt_ioctl.c changes vc->vt_pid doing
> 
> 	put_pid(xchg(&vc->vt_pid, ...));
> 
> This is unsafe, put_pid() can actually free the memory while vc->vt_pid is
> still used by kill_pid(vc->vt_pid).
> 
> Add a new helper, put_pid_rcu(), which frees "struct pid" via rcu callback
> and convert vt_ioctl.c to use it.
> 


I'm a bit reluctant to go adding more tricky infrastructure (especially
100% undocumented infrastructure) on behalf of a single usage site in a
place as creepy as the VT ioctl code.

If we envisage future users of this infrastructure (and if it gets
documented) then OK.  Otherwise I'd rather just stick another bandaid into
the vt code.  Can we add some locking there, or change it to use a
task_struct* or something?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux