From: Alejandro Colomar <alx+linux-man@kernel.org>
To: Cesar Eduardo Barros <cesarb@cesarb.eti.br>
Cc: linux-man@vger.kernel.org
Subject: Re: PR_SET_PTRACER can also EINVAL when Yama is not configured
Date: Sat, 7 Nov 2026 12:06:48 +0100 [thread overview]
Message-ID: <au8GKjxzoGpp4MqU@debian> (raw)
In-Reply-To: <d18b61d8-640e-4474-9a61-9cc5aac1c7d9@cesarb.eti.br>
[-- Attachment #1: Type: text/plain, Size: 929 bytes --]
Hi Cesar,
> Date: 2026-11-07 07:26:32-0300
> From: Cesar Eduardo Barros <cesarb@cesarb.eti.br>
>
> The man page for PR_SET_PTRACER mentions three cases in which
> prctl(PR_SET_PTRACER, ...) can fail with EINVAL, but there's a fourth case:
> when CONFIG_SECURITY_YAMA=n
>
> The code which deals with the three currently documented cases is at
> security/yama/yama_lsm.c which is only compiled when "Yama support" is
> configured. When it isn't, it falls through to the default case at
> kernel/sys.c which returns EINVAL.
>
> (I was alerted to this at
> https://github.com/cesarb/count_instructions/pull/1 where I was told that it
> fails with EINVAL when the Yama LSM is not installed. I had written the code
> based on the man page, so I hadn't considered this fourth case.)
Thanks for the report! Would you mind sending a patch?
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2026-11-07 11:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 10:26 PR_SET_PTRACER can also EINVAL when Yama is not configured Cesar Eduardo Barros
2026-11-07 11:06 ` Alejandro Colomar [this message]
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=au8GKjxzoGpp4MqU@debian \
--to=alx+linux-man@kernel.org \
--cc=cesarb@cesarb.eti.br \
--cc=linux-man@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox