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: Fri, 27 Nov 2026 11:59:36 +0100	[thread overview]
Message-ID: <awlimNsIKMMa6vN-@redhat.com> (raw)
In-Reply-To: <CAGEkeHeWU1=HjMX=GETdRnWkr-xqTBZp7p8RDdtTiUVw3+qBfQ@mail.gmail.com>

On 11/26, Hungyu Lin wrote:
>
> On Thu, Nov 26, 2026 at 03:42:11PM +0100, Oleg Nesterov wrote:
> > I just noticed that __set_oom_adj() has more CAP_SYS_RESOURCE checks below.
> >
> > Shouldn't we unify them or even factor out?
>
> The checks below only decide whether a successful write also sets
> oom_score_adj_min. The checks above already prevent a write through
> an fd opened without CAP_SYS_RESOURCE from lowering it, so I left
> them as they are.
>
> I can factor out the common check in the two rejection paths in a
> separate patch on top of this one if you like.

No, up to you, I don't really understand this code anyway,

Oleg.


  reply	other threads:[~2026-11-27 10:59 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 [this message]
2026-11-26 18:08   ` Hungyu Lin
2026-11-26 19:03     ` Oleg Nesterov
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=awlimNsIKMMa6vN-@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.