linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2] proc: show personality via /proc/pid/personality
       [not found]               ` <20081005101438.GR10632-oSa+0FWJbaXR7s880joybQ@public.gmane.org>
@ 2008-10-07 13:39                 ` Michael Kerrisk
  2008-10-07 16:14                   ` Kees Cook
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kerrisk @ 2008-10-07 13:39 UTC (permalink / raw)
  To: Kees Cook
  Cc: Alexey Dobriyan, Arjan van de Ven,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Michael Kerrisk,
	linux-api-u79uwXL29TY76Z2rM5mHXA

Kees,

On Sun, Oct 5, 2008 at 12:14 PM, Kees Cook <kees.cook-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> wrote:
> Make process personality flags visible in /proc.  Since a process's
> personality is potentially sensitive (e.g. READ_IMPLIES_EXEC), make this
> file only readable by the process owner.

Please CC userland interface changes to linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Ceers,

Michael

> Signed-off-by: Kees Cook <kees.cook-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> ---
> Please revert the prior patch against the "status" file -- this is the
> alternative.
> ---
>  fs/proc/array.c    |    8 ++++++++
>  fs/proc/base.c     |    2 ++
>  fs/proc/internal.h |    2 ++
>  3 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/fs/proc/array.c b/fs/proc/array.c
> index 71c9be5..6b6b492 100644
> --- a/fs/proc/array.c
> +++ b/fs/proc/array.c
> @@ -337,6 +337,14 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
>        return 0;
>  }
>
> +int proc_pid_personality(struct seq_file *m, struct pid_namespace *ns,
> +                       struct pid *pid, struct task_struct *task)
> +{
> +       seq_printf(m, "%08x\n", task->personality);
> +
> +       return 0;
> +}
> +
>  static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
>                        struct pid *pid, struct task_struct *task, int whole)
>  {
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index a28840b..c675c62 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -2459,6 +2459,7 @@ static const struct pid_entry tgid_base_stuff[] = {
>        REG("environ",    S_IRUSR, environ),
>        INF("auxv",       S_IRUSR, pid_auxv),
>        ONE("status",     S_IRUGO, pid_status),
> +       ONE("personality", S_IRUSR, pid_personality),
>        INF("limits",     S_IRUSR, pid_limits),
>  #ifdef CONFIG_SCHED_DEBUG
>        REG("sched",      S_IRUGO|S_IWUSR, pid_sched),
> @@ -2794,6 +2795,7 @@ static const struct pid_entry tid_base_stuff[] = {
>        REG("environ",   S_IRUSR, environ),
>        INF("auxv",      S_IRUSR, pid_auxv),
>        ONE("status",    S_IRUGO, pid_status),
> +       ONE("personality", S_IRUSR, pid_personality),
>        INF("limits",    S_IRUSR, pid_limits),
>  #ifdef CONFIG_SCHED_DEBUG
>        REG("sched",     S_IRUGO|S_IWUSR, pid_sched),
> diff --git a/fs/proc/internal.h b/fs/proc/internal.h
> index 4422023..747e3de 100644
> --- a/fs/proc/internal.h
> +++ b/fs/proc/internal.h
> @@ -53,6 +53,8 @@ extern int proc_tgid_stat(struct seq_file *m, struct pid_namespace *ns,
>                                struct pid *pid, struct task_struct *task);
>  extern int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
>                                struct pid *pid, struct task_struct *task);
> +extern int proc_pid_personality(struct seq_file *m, struct pid_namespace *ns,
> +                               struct pid *pid, struct task_struct *task);
>  extern int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
>                                struct pid *pid, struct task_struct *task);
>  extern loff_t mem_lseek(struct file *file, loff_t offset, int orig);
> --
> 1.5.6.3
>
>
> --
> Kees Cook
> Ubuntu Security Team
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>



-- 
Michael Kerrisk Linux man-pages maintainer;
http://www.kernel.org/doc/man-pages/ Found a documentation bug?
http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] proc: show personality via /proc/pid/personality
  2008-10-07 13:39                 ` [PATCH v2] proc: show personality via /proc/pid/personality Michael Kerrisk
@ 2008-10-07 16:14                   ` Kees Cook
       [not found]                     ` <20081007161422.GD10357-oSa+0FWJbaXR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Kees Cook @ 2008-10-07 16:14 UTC (permalink / raw)
  To: Michael Kerrisk
  Cc: Alexey Dobriyan, Arjan van de Ven, linux-kernel, linux-api

Hi Michael,

On Tue, Oct 07, 2008 at 03:39:26PM +0200, Michael Kerrisk wrote:
> On Sun, Oct 5, 2008 at 12:14 PM, Kees Cook <kees.cook@canonical.com> wrote:
> > Make process personality flags visible in /proc.  Since a process's
> > personality is potentially sensitive (e.g. READ_IMPLIES_EXEC), make this
> > file only readable by the process owner.
> 
> Please CC userland interface changes to linux-api@vger.kernel.org

Sure, I'd be happy to do that for future stuff.  I don't see this email
address mentioned anywhere in the kernel tree.  It seems like this is
useful information that should go in either MAINTAINERS or better yet
Documentation/SubmittingPatches for it to be discoverable by future
patch-senders -- and somewhere that I can look it up easily later.  :)

-Kees

-- 
Kees Cook
Ubuntu Security Team

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] proc: show personality via /proc/pid/personality
       [not found]                     ` <20081007161422.GD10357-oSa+0FWJbaXR7s880joybQ@public.gmane.org>
@ 2008-10-08  2:45                       ` Michael Kerrisk
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Kerrisk @ 2008-10-08  2:45 UTC (permalink / raw)
  To: Kees Cook
  Cc: Alexey Dobriyan, Arjan van de Ven,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-api-u79uwXL29TY76Z2rM5mHXA

Hi Kees,

On Tue, Oct 7, 2008 at 6:14 PM, Kees Cook <kees.cook-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> wrote:
> Hi Michael,
>
> On Tue, Oct 07, 2008 at 03:39:26PM +0200, Michael Kerrisk wrote:
>> On Sun, Oct 5, 2008 at 12:14 PM, Kees Cook <kees.cook-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> wrote:
>> > Make process personality flags visible in /proc.  Since a process's
>> > personality is potentially sensitive (e.g. READ_IMPLIES_EXEC), make this
>> > file only readable by the process owner.
>>
>> Please CC userland interface changes to linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>
> Sure, I'd be happy to do that for future stuff.  I don't see this email
> address mentioned anywhere in the kernel tree.  It seems like this is
> useful information that should go in either MAINTAINERS or better yet
> Documentation/SubmittingPatches for it to be discoverable by future
> patch-senders -- and somewhere that I can look it up easily later.  :)

It's there, but only as of a few days ago.

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-10-08  2:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20081002211424.GJ10632@outflux.net>
     [not found] ` <20081004145149.52c34ee7@infradead.org>
     [not found]   ` <20081004220220.GK10632@outflux.net>
     [not found]     ` <20081004164239.0c1483a4@infradead.org>
     [not found]       ` <20081005004233.GL10632@outflux.net>
     [not found]         ` <20081004174843.6fe48a8e@infradead.org>
     [not found]           ` <20081005091120.GA21003@x200.localdomain>
     [not found]             ` <20081005101438.GR10632@outflux.net>
     [not found]               ` <20081005101438.GR10632-oSa+0FWJbaXR7s880joybQ@public.gmane.org>
2008-10-07 13:39                 ` [PATCH v2] proc: show personality via /proc/pid/personality Michael Kerrisk
2008-10-07 16:14                   ` Kees Cook
     [not found]                     ` <20081007161422.GD10357-oSa+0FWJbaXR7s880joybQ@public.gmane.org>
2008-10-08  2:45                       ` Michael Kerrisk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).