Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755663Ab3IYUUK (ORCPT ); Wed, 25 Sep 2013 16:20:10 -0400 Received: from numidia.opendz.org ([98.142.220.152]:43704 "EHLO numidia.opendz.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753490Ab3IYUUI (ORCPT ); Wed, 25 Sep 2013 16:20:08 -0400 From: Djalal Harouni To: "Eric W. Biederman" , Kees Cook , Al Viro , Andrew Morton , Linus Torvalds , Ingo Molnar , "Serge E. Hallyn" , Cyrill Gorcunov , LKML , linux-fsdevel@vger.kernel.org, Cc: tixxdz@gmail.com, Djalal Harouni Subject: [PATCH 03/12] procfs: Document the proposed solution to protect procfs entries Date: Wed, 25 Sep 2013 21:14:36 +0100 Message-Id: <1380140085-29712-4-git-send-email-tixxdz@opendz.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1380140085-29712-1-git-send-email-tixxdz@opendz.org> References: <1380140085-29712-1-git-send-email-tixxdz@opendz.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1264 Lines: 40 Note the proposed solution to protect sensitive procfs entries as code comment. Cc: Kees Cook Cc: Eric W. Biederman Signed-off-by: Djalal Harouni --- fs/proc/base.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fs/proc/base.c b/fs/proc/base.c index c29eeae..8d21316 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -102,6 +102,17 @@ * * The classic example of a problem is opening file descriptors * in /proc for a task before it execs a suid executable. + * + * Solution for sensitive files: + * At each system call: open(),read(),write()... Perform the + * ptrace_may_access() check. + * + * After open() and during each system call: read(),write()... + * If the cred of current have changed then perform the + * proc_allow_access() check after the ptrace_may_access() one. + * + * This way we can determine if current has gained more privileges + * by execs a suid executable. */ struct pid_entry { -- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/