9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] devproc noteid changing for none
@ 2014-01-02 21:17 cinap_lenrek
  2014-01-02 21:22 ` erik quanstrom
  0 siblings, 1 reply; 24+ messages in thread
From: cinap_lenrek @ 2014-01-02 21:17 UTC (permalink / raw)
  To: 9fans

one can change the note group of a process with devproc
by writing noteid file.

	case Qnoteid:
		id = atoi(a);
		if(id == p->pid) {
			p->noteid = id;
			break;
		}
		t = proctab(0);
		for(et = t+conf.nproc; t < et; t++) {
			if(t->state == Dead)
				continue;
			if(id == t->noteid) {
				if(strcmp(p->user, t->user) != 0)
					error(Eperm);
				p->noteid = id;
				break;
			}
		}
		if(p->noteid != id)
			error(Ebadarg);
		break;

the strcmp() check in that loop isnt enougth when the
user doing the write is "none" as this would allow him
to change the noteid of its process to another "none"
session and and then kill it. like for example to one
of the aux/listen procs.

the rules for "none" user is that he cant open other
processes running as "none" except its own calling
proc.

http://code.google.com/p/plan9front/source/detail?r=118280a79161c8cf42164bcc9458af7650652f91

--
cinap



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2014-01-03  1:31 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-02 21:17 [9fans] devproc noteid changing for none cinap_lenrek
2014-01-02 21:22 ` erik quanstrom
2014-01-02 21:29   ` cinap_lenrek
2014-01-02 21:32   ` cinap_lenrek
2014-01-02 21:35     ` erik quanstrom
2014-01-02 21:41       ` cinap_lenrek
2014-01-02 21:43       ` erik quanstrom
2014-01-02 21:55         ` cinap_lenrek
2014-01-02 22:31           ` erik quanstrom
2014-01-02 22:47             ` erik quanstrom
2014-01-02 22:56               ` cinap_lenrek
2014-01-02 22:53             ` cinap_lenrek
2014-01-02 22:57               ` erik quanstrom
2014-01-02 23:01                 ` cinap_lenrek
2014-01-02 23:04                   ` erik quanstrom
2014-01-02 23:05                 ` cinap_lenrek
2014-01-02 23:09                 ` cinap_lenrek
2014-01-02 23:17                   ` cinap_lenrek
2014-01-02 23:28                     ` erik quanstrom
2014-01-03  0:23                       ` erik quanstrom
2014-01-03  0:32                         ` cinap_lenrek
2014-01-03  1:16                           ` erik quanstrom
2014-01-03  1:23                             ` cinap_lenrek
2014-01-03  1:31                               ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).