mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Kirill Korotaev <dev@sw.ru>
Cc: Kirill Korotaev <dev@openvz.org>,
	serue@us.ibm.com, arjan@infradead.org, frankeh@watson.ibm.com,
	clg@fr.ibm.com, haveblue@us.ibm.com, mrmacman_g4@mac.com,
	alan@lxorguk.ukuu.org.uk,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	devel@openvz.org
Subject: Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
Date: Wed, 08 Feb 2006 13:29:30 -0700	[thread overview]
Message-ID: <m1irrpsifp.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <43E23179.5010009@sw.ru> (Kirill Korotaev's message of "Thu, 02 Feb 2006 19:21:13 +0300")

Kirill Korotaev <dev@sw.ru> writes:

> This is one of the major patches,
> it adds vpid-to-pid conversions by placing macros
> introduced in diff-vpid-macro patch.
>
> Note that in CONFIG_VIRTUAL_PIDS=n case these macros expand to default code.

Do you know how incomplete this patch is?
 drivers/char/tty_io.c |    7 +++++--
 fs/binfmt_elf.c       |   16 ++++++++--------
 fs/exec.c             |    4 ++--
 fs/fcntl.c            |    3 ++-
 fs/locks.c            |    4 ++--
 fs/proc/array.c       |   18 ++++++++++--------
 fs/proc/base.c        |    6 +++---
 include/net/scm.h     |    2 +-
 ipc/msg.c             |    6 +++---
 ipc/sem.c             |    8 ++++----
 ipc/shm.c             |    6 +++---
 kernel/capability.c   |    8 ++++++--
 kernel/exit.c         |   28 ++++++++++++++++++++++------
 kernel/fork.c         |    2 +-
 kernel/sched.c        |    2 +-
 kernel/signal.c       |   23 ++++++++++++++---------
 kernel/sys.c          |   37 +++++++++++++++++++++++++++----------
 kernel/timer.c        |    6 +++---
 net/core/scm.c        |    2 +-
 net/unix/af_unix.c    |    8 +++-----
 20 files changed, 121 insertions(+), 75 deletions(-)

You missed drivers/char/drm, and in your shipping OpenVZ patch.
You missed get_xpid() on alpha.
You missed nfs.

All it seems you have found is the low hanging fruit where pids are used.
Without compile errors to help I don't know how you are ever going to find
everything, especially with the kernel constantly changing.

Honestly this approach looks like a maintenance nightmare, you didn't
even correctly handle all of the interfaces you posted in you patch.

I suspect the tagging of the VPIDS and the WARN_ON's help so you have
a chance of catching things if someone uses a code path you haven't
caught.  But I don't see how you can possibly get full kernel
coverage.

Is there a plan to catch all of the in-kernel use of pids that I am
being to dense to see?

Eric

> Kirill

> --- ./kernel/capability.c.vpid_core	2006-02-02 14:15:35.152784704 +0300
> +++ ./kernel/capability.c	2006-02-02 14:33:58.808003608 +0300
> @@ -67,7 +67,7 @@ asmlinkage long sys_capget(cap_user_head
>       spin_lock(&task_capability_lock);
>       read_lock(&tasklist_lock); 
>  
> -     if (pid && pid != current->pid) {
> +     if (pid && pid != virt_pid(current)) {
>  	     target = find_task_by_pid(pid);
>  	     if (!target) {
>  	          ret = -ESRCH;
> @@ -100,6 +100,10 @@ static inline int cap_set_pg(int pgrp, k
>  	int ret = -EPERM;
>  	int found = 0;
>  
> +	pgrp = vpid_to_pid(pgrp);
> +	if (pgrp < 0)
> +		return ret;
> +
>  	do_each_task_pid(pgrp, PIDTYPE_PGID, g) {
>  		target = g;
>  		while_each_thread(g, target) {
> @@ -199,7 +203,7 @@ asmlinkage long sys_capset(cap_user_head
>       spin_lock(&task_capability_lock);
>       read_lock(&tasklist_lock);
>  
> -     if (pid > 0 && pid != current->pid) {
> +     if (pid > 0 && pid != virt_pid(current)) {
>            target = find_task_by_pid(pid);
>            if (!target) {
>                 ret = -ESRCH;

You missed cap_set_all.



  reply	other threads:[~2006-02-08 20:31 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-02 15:54 [RFC][PATCH] VPIDs: Virtualization of PIDs (OpenVZ approach) Kirill Korotaev
2006-02-02 16:16 ` [RFC][PATCH 1/7] VPIDs: add VPID config option Kirill Korotaev
2006-02-02 16:21 ` [RFC][PATCH 2/7] VPIDs: pid/vpid conversions Kirill Korotaev
2006-02-08 20:29   ` Eric W. Biederman [this message]
2006-02-08 23:53     ` Alexey Kuznetsov
2006-02-09  0:37       ` Eric W. Biederman
2006-02-09  1:11         ` Alexey Kuznetsov
2006-02-09  1:36           ` Eric W. Biederman
2006-02-09  2:51           ` Serge E. Hallyn
2006-02-09  9:55             ` Alexey Kuznetsov
2006-02-09 19:22               ` Eric W. Biederman
2006-02-20 14:57     ` Kirill Korotaev
2006-02-20 16:56       ` Herbert Poetzl
2006-02-21 16:19         ` Kirill Korotaev
2006-02-21 23:17           ` Herbert Poetzl
2006-02-02 16:24 ` [RFC][PATCH 3/7] VPIDs: fork modifications Kirill Korotaev
2006-02-02 20:08   ` Cedric Le Goater
2006-02-02 16:26 ` [RFC][PATCH 4/7] VPIDs: vpid macros in non-VPID case Kirill Korotaev
2006-02-02 16:30 ` [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case Kirill Korotaev
2006-02-02 17:05   ` Dave Hansen
2006-02-02 19:29     ` Serge E. Hallyn
2006-02-03 10:52     ` Alexey Kuznetsov
2006-02-03 12:48       ` Cedric Le Goater
2006-02-03 14:02         ` Alexey Kuznetsov
2006-02-03 16:25           ` Dave Hansen
2006-02-06 11:24             ` Alexey Kuznetsov
2006-02-03 17:05           ` Cedric Le Goater
2006-02-06  9:48             ` Alexey Kuznetsov
2006-02-06 14:51               ` Serge E. Hallyn
2006-02-06 15:51                 ` Alexey Kuznetsov
2006-02-06 16:24                   ` Serge E. Hallyn
2006-02-07  9:46                   ` Cedric Le Goater
2006-02-07 11:44                     ` Kirill Korotaev
2006-02-07 12:59                       ` Cedric Le Goater
2006-02-07  9:15               ` Cedric Le Goater
2006-02-03 14:05         ` Kirill Korotaev
2006-02-03 15:40           ` Cedric Le Goater
2006-02-03 16:28             ` Kirill Korotaev
2006-02-02 16:31 ` [RFC][PATCH 6/7] VPIDs: small proc VPID export Kirill Korotaev
2006-02-02 16:33 ` [RFC][PATCH 7/7] VPIDs: required VPS interface for VPIDs Kirill Korotaev
2006-02-03  3:01 ` [RFC][PATCH] VPIDs: Virtualization of PIDs (OpenVZ approach) Herbert Poetzl
2006-02-03 10:30   ` Kirill Korotaev
2006-02-03 12:45   ` Alexey Kuznetsov

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=m1irrpsifp.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=clg@fr.ibm.com \
    --cc=dev@openvz.org \
    --cc=dev@sw.ru \
    --cc=devel@openvz.org \
    --cc=frankeh@watson.ibm.com \
    --cc=haveblue@us.ibm.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrmacman_g4@mac.com \
    --cc=serue@us.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

Powered by JetHome