From patchwork Thu Nov 9 16:14:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Djalal Harouni X-Patchwork-Id: 10051233 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D851E60381 for ; Thu, 9 Nov 2017 16:16:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBB9D2AF8F for ; Thu, 9 Nov 2017 16:16:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C04BB2AFC5; Thu, 9 Nov 2017 16:16:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A40D2AF8F for ; Thu, 9 Nov 2017 16:16:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753088AbdKIQPw (ORCPT ); Thu, 9 Nov 2017 11:15:52 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33386 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752857AbdKIQOe (ORCPT ); Thu, 9 Nov 2017 11:14:34 -0500 Received: by mail-wm0-f66.google.com with SMTP id r68so2815709wmr.0; Thu, 09 Nov 2017 08:14:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sbrtXq38cXSTDlV8fjCqq+PteTJJ9CgLXrk5S70PRG8=; b=QJ/5vm2FkmvgB+KRnW8386vbHKXMFzUDDqIFQSQTl0WLBtiqT0CUIxtLNKm9dBB5Xn VufcGgZhOjjFptMx/k3eIXLytFYqOTVZUseHEN497tnxfoqEqeJr4FYL7kKnWFOMYD8U Xb8DLnWg3RfEZYKg5TuPLnMgfQ+Drppjfsj2YnPCii9ksI+moPj0Oknx9GkTyvaZ+Fje aB0Gl1/QtrV8VIjLwjKli7NW5XFUva0MUhS04D9InCmotjJDldBvJmPXhUZ9L514fNQe S/WlLh7eDK7ZGguHiEfydb/7jGB8kCUa3nI2yHH11YwYQFNi/qaq9BOop5h3S6T6e38f 27Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sbrtXq38cXSTDlV8fjCqq+PteTJJ9CgLXrk5S70PRG8=; b=btGCCWhxcAsBe4L353X2A2Pucdq4K0RKY+eW5xONG5OqwcQ6dTghjfXz5vMtvqfeOB dXcrdvlwvKV0OnH5dKe9ijGzsM7BDobgfkJis799Z7LBQNDqz0QXvFIkVeDX9hgeQ9Cw 38BYpOfMbXSRo9es2LH4A6jJRpIsZASIF5gP1kKCiI0PLClqGG/qKGz+i0gB81T0w5wA /E45bj0Fyp5cav2KibE5DFOq+rj4wsTuPCMfTZ0LAIMadyaDW82fsM0MOY3YLcGGvhuT j/3epijC43DIGTcK4f8c5h8Q44G4DBhNlOt7nS547Q1wrlJZDU/btI62rKZG2FvAkOoQ vK6Q== X-Gm-Message-State: AJaThX7YFA0zE3todbe9EVxEb7i7Cj1yYRRsfunofeOUaT4vy2h4QGZa TTxjpPelB9oraIPwdIeQdko= X-Google-Smtp-Source: ABhQp+TC3XevFunZqcOOOjrWh3ilKV5USjhrUlb/yRi/pXBXyKaz9Xt2MIP+C8Dc6yITTIubEl3VSQ== X-Received: by 10.80.201.12 with SMTP id o12mr1343842edh.98.1510244073325; Thu, 09 Nov 2017 08:14:33 -0800 (PST) Received: from localhost.localdomain (ip-109-45-0-227.web.vodafone.de. [109.45.0.227]) by smtp.gmail.com with ESMTPSA id d3sm5826085edd.41.2017.11.09.08.14.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Nov 2017 08:14:32 -0800 (PST) From: Djalal Harouni To: Kees Cook , Alexey Gladkov , Andy Lutomirski , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org Cc: Greg Kroah-Hartman , Alexander Viro , Akinobu Mita , me@tobin.cc, Oleg Nesterov , Jeff Layton , Ingo Molnar , Alexey Dobriyan , ebiederm@xmission.com, Linus Torvalds , Daniel Micay , Jonathan Corbet , bfields@fieldses.org, Stephen Rothwell , solar@openwall.com, Djalal Harouni Subject: [PATCH RFC v3 5/7] proc: move hidepid definitions to proc files Date: Thu, 9 Nov 2017 17:14:04 +0100 Message-Id: <1510244046-3256-6-git-send-email-tixxdz@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510244046-3256-1-git-send-email-tixxdz@gmail.com> References: <1510244046-3256-1-git-send-email-tixxdz@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This moves the 'hidepid' definitions to proc files. The 'hidepid' is a proc mount option, not really a per pid namespace value. It was there since it was used inside PID namespaces, however now we have improved proc logic and reduce the complexity and ties with PID namespaces lets move this last bit to where it really belongs. Cc: Kees Cook Cc: Greg Kroah-Hartman Cc: Andy Lutomirski Signed-off-by: Alexey Gladkov Signed-off-by: Djalal Harouni --- include/linux/pid_namespace.h | 6 ------ include/linux/proc_fs.h | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 786ea04..66f47f1 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h @@ -15,12 +15,6 @@ struct fs_pin; -enum { /* definitions for pid_namespace's hide_pid field */ - HIDEPID_OFF = 0, - HIDEPID_NO_ACCESS = 1, - HIDEPID_INVISIBLE = 2, -}; - struct pid_namespace { struct kref kref; struct idr idr; diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 408b51d..c123e5ec 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -12,6 +12,12 @@ struct proc_dir_entry; struct pid_namespace; +enum { /* definitions for 'hidepid' mount option */ + HIDEPID_OFF = 0, + HIDEPID_NO_ACCESS = 1, + HIDEPID_INVISIBLE = 2, +}; + struct proc_fs_info { struct pid_namespace *pid_ns; struct dentry *proc_self; /* For /proc/self/ */