Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751870AbdH2XCg (ORCPT ); Tue, 29 Aug 2017 19:02:36 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:40988 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275AbdH2XCf (ORCPT ); Tue, 29 Aug 2017 19:02:35 -0400 Date: Tue, 29 Aug 2017 16:02:32 -0700 (PDT) Message-Id: <20170829.160232.1901318933754673000.davem@davemloft.net> To: prakash.sangappa@oracle.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, ebiederm@xmission.com, drepper@redhat.com Subject: Re: [RESEND PATCH] Allow passing tid or pid in SCM_CREDENTIALS without CAP_SYS_ADMIN From: David Miller In-Reply-To: <1503965540-30393-1-git-send-email-prakash.sangappa@oracle.com> References: <1503965540-30393-1-git-send-email-prakash.sangappa@oracle.com> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 29 Aug 2017 16:02:35 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1049 Lines: 24 From: Prakash Sangappa Date: Mon, 28 Aug 2017 17:12:20 -0700 > Currently passing tid(gettid(2)) of a thread in struct ucred in > SCM_CREDENTIALS message requires CAP_SYS_ADMIN capability otherwise > it fails with EPERM error. Some applications deal with thread id > of a thread(tid) and so it would help to allow tid in SCM_CREDENTIALS > message. Basically, either tgid(pid of the process) or the tid of > the thread should be allowed without the need for CAP_SYS_ADMIN capability. > > SCM_CREDENTIALS will be used to determine the global id of a process or > a thread running inside a pid namespace. > > This patch adds necessary check to accept tid in SCM_CREDENTIALS > struct ucred. > > Signed-off-by: Prakash Sangappa I'm pretty sure that by the descriptions in previous changes to this function, what you are proposing is basically a minor form of PID spoofing which we only want someone with CAP_SYS_ADMIN over the PID namespace to be able to do. Sorry, I'm not applying this.