All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@chromium.org>
To: Kees Cook <keescook@chromium.org>
Cc: Adrian Ratiu <adrian.ratiu@collabora.com>,
	jannh@google.com,  Doug Anderson <dianders@chromium.org>,
	linux-security-module@vger.kernel.org,
	 linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	 kernel@collabora.com, Guenter Roeck <groeck@chromium.org>,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH] proc: allow restricting /proc/pid/mem writes
Date: Mon, 26 Feb 2024 15:28:49 -0500	[thread overview]
Message-ID: <CAAbOSckyxGka1vWTpuYwA8eH=17sJbGMUOuCwHs2gE_FPnXG3A@mail.gmail.com> (raw)
In-Reply-To: <202402261123.B2A1D0DE@keescook>

(lemme try this again as plain text)

On Mon, Feb 26, 2024 at 2:24 PM Kees Cook <keescook@chromium.org> wrote:
> On Mon, Feb 26, 2024 at 09:10:54AM -0800, Doug Anderson wrote:
> > On Wed, Feb 21, 2024 at 1:06 PM Adrian Ratiu <adrian.ratiu@collabora.com> wrote:
> > +     if (ptracer_capable(current, mm->user_ns) &&
>
> It really looks like you're trying to do a form of ptrace_may_access(),
> but _without_ the introspection exception?

to be clear, we want the check to be "ptracer is attached, and the
process attempting the write is the ptracer", not "does the writer
pass ptrace access checks".  the latter opens up more angles,
including shellcode self-modification, that we don't want.  the only
use case we have for writable mem files is for debuggers, and those
should already be attached.
-mike

  reply	other threads:[~2024-02-26 20:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21 21:06 [PATCH] proc: allow restricting /proc/pid/mem writes Adrian Ratiu
2024-02-26 17:10 ` Doug Anderson
2024-02-26 19:22   ` Kees Cook
2024-02-26 19:24     ` Kees Cook
2024-02-26 20:28       ` Mike Frysinger [this message]
2024-02-26 22:33       ` Adrian Ratiu
2024-02-26 22:37         ` Doug Anderson
2024-02-27  0:53           ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAbOSckyxGka1vWTpuYwA8eH=17sJbGMUOuCwHs2gE_FPnXG3A@mail.gmail.com' \
    --to=vapier@chromium.org \
    --cc=adrian.ratiu@collabora.com \
    --cc=dianders@chromium.org \
    --cc=groeck@chromium.org \
    --cc=jannh@google.com \
    --cc=keescook@chromium.org \
    --cc=kernel@collabora.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.