lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130827145345.GC19425@redhat.com>
Date:	Tue, 27 Aug 2013 16:53:45 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Willy Tarreau <w@....eu>, Al Viro <viro@...iv.linux.org.uk>,
	Andy Lutomirski <luto@...capital.net>,
	Ingo Molnar <mingo@...nel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Linux FS Devel <linux-fsdevel@...r.kernel.org>,
	Brad Spengler <spender@...ecurity.net>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] proc: make proc_fd_permission() thread-friendly

On 08/26, Eric W. Biederman wrote:
>
> Oleg Nesterov <oleg@...hat.com> writes:
> >
> > And I also assume that you agree with this change ;)
>
> I don't disagree.  Comparing tgid to pids is goofy and my brain is
> elsewhere so I have no thought through the implications.
>
> Actually thinking I think the check should really be.  In which case we
> are comparing what we really care about.
>
> int proc_fd_permission(struct inode *inode, int mask)
> {
> 	int rv = generic_permission(inode, mask);
> 	if (rv == 0)
> 		return 0;
>
>         rcu_read_lock();
>         struct task *task = pid_task(proc_pid(inode));
>         if (task && (current->files == task->files))

But for what?

To me, this looks like the unnecessary semantic complication. It
looks as if we actually need to restrict the access to /proc/self/fd
or /proc/<tgid>/fd or /proc/<subthread-tid>/fd.

I do not think there is any security reason to deny this. They share
->mm, a sub-thread can do "everything" with its leader or vice versa.

same_thread_group() looks more simple and natural to me. And note
that __ptrace_may_access() was recently changed (in -mm) to use
same_thread_group() instead of "task == current".

So personally I'd prefer to not change this patch and I think it
makes sense even with "make /proc/self point to thread" I sent.

But. please tell me if you really dislike it. You are maintainer,
I won't argue.

Oleg.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ