All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Hungyu Lin <dennylin0707@gmail.com>
Cc: akpm@linux-foundation.org, brauner@kernel.org,
	adobriyan@gmail.com, jannh@google.com, jack@suse.cz,
	sforshee@kernel.org, me@black-desk.cn,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc: also check the opener's capability for oom_score_adj and oom_adj
Date: Thu, 26 Nov 2026 20:03:29 +0100	[thread overview]
Message-ID: <awiCgZ3cOW7BaIET@redhat.com> (raw)
In-Reply-To: <CAGEkeHcK2rSWyQOp5a6Ub2SJ4wi8qK_Wz5uKH0WN+pLksL9jLw@mail.gmail.com>

On 11/26, Hungyu Lin wrote:
>
> On Thu, Nov 26, 2026 at 11:50:54AM +0100, Oleg Nesterov wrote:
> > do we really need to keep the old capable(CAP_SYS_RESOURCE) check?
> >
> > If a privileged opener of /proc/<pid>/oom_score_adj passes fd to
> > to unprivileged writer, we probably don't care?
>
> A write that needs CAP_SYS_RESOURCE still needs it from the writer,
> even if the opener was privileged. For example, a task can open its
> own oom_score_adj with CAP_SYS_RESOURCE and still have the fd after
> dropping that capability and calling execve(). If we only check the
> opener, it could then lower its value down to OOM_SCORE_ADJ_MIN, and
> any children it creates afterward would inherit that.

And my question was: do we really care about this case?

> I kept capable() so that a fix for stable doesn't relax anything.

OK,

> Or do
> you think the opener check alone is enough?

Well, let me quote the part of my email you have removed:

	Just in case, I am not saying that the old check should be removed,
	I am trying to understand.

So no, I am not sure the opener check alone is enough.

Oleg.


  reply	other threads:[~2026-11-26 19:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  4:52 [PATCH] proc: also check the opener's capability for oom_score_adj and oom_adj Hungyu Lin
2026-11-26 10:50 ` Oleg Nesterov
2026-11-26 14:42   ` Oleg Nesterov
2026-11-26 20:34     ` Hungyu Lin
2026-11-27 10:59       ` Oleg Nesterov
2026-11-26 18:08   ` Hungyu Lin
2026-11-26 19:03     ` Oleg Nesterov [this message]
2026-12-01  8:59 ` Chen Linxuan
2026-12-01 16:26   ` Oleg Nesterov

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=awiCgZ3cOW7BaIET@redhat.com \
    --to=oleg@redhat.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=dennylin0707@gmail.com \
    --cc=jack@suse.cz \
    --cc=jannh@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@black-desk.cn \
    --cc=sforshee@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.