From: Alejandro Colomar <alx+linux-man@kernel.org>
To: Cesar Eduardo Barros <cesarb@cesarb.eti.br>
Cc: linux-man@vger.kernel.org
Subject: Re: [PATCH v1 1/1] man/man2const/PR_SET_PTRACER.2const: Document EINVAL when Yama is not configured
Date: Fri, 27 Nov 2026 00:02:00 +0100 [thread overview]
Message-ID: <awi6VZZAlX-lOROa@devuan> (raw)
In-Reply-To: <awi38FFdYc0xnWEG@devuan>
[-- Attachment #1: Type: text/plain, Size: 4848 bytes --]
> Date: 2026-11-26 23:52:29+0100
> From: Alejandro Colomar <alx+linux-man@kernel.org>
>
> Hi Cesar,
>
> > Date: 2026-11-21 16:48:07-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.
> >
> > Fixes: 6f86bef66936 (2013-01-11; "prctl.2: Document EINVAL error for PR_SET_PTRACER")
> > Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.eti.br>
>
> Thanks for the patch! I've reworded it to be consistent with similar
> pages, such as unshare(2). Here's what I applied:
>
> commit 5a70354bca4d025720565e1e506c8adab62a01bd (HEAD -> contrib)
> Author: Cesar Eduardo Barros <cesarb@cesarb.eti.br>
> Date: 2026-11-21 16:48:07 -0300
>
> man/man2const/PR_SET_PTRACER.2const: Document EINVAL when Yama is not configured
>
> 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.
>
> Fixes: 6f86bef66936 (2013-01-11; "prctl.2: Document EINVAL error for PR_SET_PTRACER")
> Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.eti.br>
> Message-ID: <cfc899195f8d66e3846133e0488d713d6eaf975c.1795289695.git.cesarb@cesarb.eti.br>
> [alx: reword]
> Signed-off-by: Alejandro Colomar <alx@kernel.org>
>
> diff --git a/man/man2const/PR_SET_PTRACER.2const b/man/man2const/PR_SET_PTRACER.2const
> index 48bd8f04e104..b07ee5ae4d2d 100644
> --- a/man/man2const/PR_SET_PTRACER.2const
> +++ b/man/man2const/PR_SET_PTRACER.2const
> @@ -57,6 +57,9 @@ .SH ERRORS
> is not 0,
> .BR PR_SET_PTRACER_ANY ,
> nor the PID of an existing process.
> +.TP
> +.B EINVAL
> +Yama support is not built into the running kernel.
> .SH STANDARDS
> Linux.
> .SH HISTORY
Ouch! I meant to send this:
commit 0f4df33a87d3b1fbb92d948ca546736eef2dbcb9
Author: Cesar Eduardo Barros <cesarb@cesarb.eti.br>
Date: 2026-11-21 16:48:07 -0300
man/man2const/PR_SET_PTRACER.2const: Document EINVAL when Yama is not configured
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.
Fixes: 6f86bef66936 (2013-01-11; "prctl.2: Document EINVAL error for PR_SET_PTRACER")
Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.eti.br>
Message-ID: <cfc899195f8d66e3846133e0488d713d6eaf975c.1795289695.git.cesarb@cesarb.eti.br>
[alx: reword]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
diff --git a/man/man2const/PR_SET_PTRACER.2const b/man/man2const/PR_SET_PTRACER.2const
index 48bd8f04e104..233495249eee 100644
--- a/man/man2const/PR_SET_PTRACER.2const
+++ b/man/man2const/PR_SET_PTRACER.2const
@@ -57,6 +57,11 @@ .SH ERRORS
is not 0,
.BR PR_SET_PTRACER_ANY ,
nor the PID of an existing process.
+.TP
+.B EINVAL
+The kernel was not configured with the
+.B CONFIG_SECURITY_YAMA
+option.
.SH STANDARDS
Linux.
.SH HISTORY
Cheers,
Alex
>
>
> Have a lovely night!
> Alex
>
> > ---
> > man/man2const/PR_SET_PTRACER.2const | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/man/man2const/PR_SET_PTRACER.2const b/man/man2const/PR_SET_PTRACER.2const
> > index 48bd8f04e104..b07ee5ae4d2d 100644
> > --- a/man/man2const/PR_SET_PTRACER.2const
> > +++ b/man/man2const/PR_SET_PTRACER.2const
> > @@ -57,6 +57,9 @@ .SH ERRORS
> > is not 0,
> > .BR PR_SET_PTRACER_ANY ,
> > nor the PID of an existing process.
> > +.TP
> > +.B EINVAL
> > +Yama support is not built into the running kernel.
> > .SH STANDARDS
> > Linux.
> > .SH HISTORY
> > --
> > 2.56.1
> >
>
> --
> <https://www.alejandro-colomar.es>
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2026-11-26 23:02 UTC|newest]
Thread overview: 6+ 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
2026-11-21 19:48 ` [PATCH v1 0/1] man/man2const/PR_SET_PTRACER.2const: Document EINVAL Cesar Eduardo Barros
2026-11-21 19:48 ` [PATCH v1 1/1] man/man2const/PR_SET_PTRACER.2const: Document EINVAL when Yama is not configured Cesar Eduardo Barros
2026-11-26 22:52 ` Alejandro Colomar
2026-11-26 23:02 ` 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=awi6VZZAlX-lOROa@devuan \
--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