Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752642Ab3JAUaD (ORCPT ); Tue, 1 Oct 2013 16:30:03 -0400 Received: from numidia.opendz.org ([98.142.220.152]:46319 "EHLO numidia.opendz.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751230Ab3JAUaA (ORCPT ); Tue, 1 Oct 2013 16:30:00 -0400 From: Djalal Harouni To: "Eric W. Biederman" , Kees Cook , Al Viro , Andrew Morton , Linus Torvalds , Ingo Molnar , "Serge E. Hallyn" , Cyrill Gorcunov , David Rientjes , LKML , linux-fsdevel@vger.kernel.org, kernel-hardening@lists.openwall.com Cc: tixxdz@gmail.com, Djalal Harouni Subject: [PATCH v2 3/9] procfs: Document the proposed solution to protect procfs entries Date: Tue, 1 Oct 2013 21:26:12 +0100 Message-Id: <1380659178-28605-4-git-send-email-tixxdz@opendz.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1380659178-28605-1-git-send-email-tixxdz@opendz.org> References: <1380659178-28605-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: 1274 Lines: 40 Note the proposed solution to protect sensitive procfs entries as code comment. Cc: Kees Cook Suggested-by: 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/