> Date: 2026-11-26 23:52:29+0100 > From: Alejandro Colomar > > Hi Cesar, > > > Date: 2026-11-21 16:48:07-0300 > > From: Cesar Eduardo Barros > > > > 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 > > 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 > 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 > Message-ID: > [alx: reword] > Signed-off-by: Alejandro Colomar > > 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 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 Message-ID: [alx: reword] Signed-off-by: Alejandro Colomar 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 > > > > -- > --