* Issue in man page PR_SET_SECUREBITS.2const
@ 2025-08-24 14:48 Helge Kreutzmann
2025-08-24 19:21 ` Alejandro Colomar
0 siblings, 1 reply; 9+ messages in thread
From: Helge Kreutzmann @ 2025-08-24 14:48 UTC (permalink / raw)
To: alx; +Cc: mario.blaettermann, linux-man
Without further ado, the following was found:
Issue: malloc → B<malloc>(3) ?
"Setting this flag provides a method for disabling transparent huge pages for "
"jobs where the code cannot be modified, and using a malloc hook with "
"B<madvise>(2) is not an option (i.e., statically allocated data). The "
"setting of the \"THP disable\" flag is inherited by a child created via "
"B<fork>(2) and is preserved across B<execve>(2)."
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Issue in man page PR_SET_SECUREBITS.2const
2025-08-24 14:48 Issue in man page PR_SET_SECUREBITS.2const Helge Kreutzmann
@ 2025-08-24 19:21 ` Alejandro Colomar
2025-08-25 16:11 ` Helge Kreutzmann
2025-08-25 17:52 ` Carlos O'Donell
0 siblings, 2 replies; 9+ messages in thread
From: Alejandro Colomar @ 2025-08-24 19:21 UTC (permalink / raw)
To: Helge Kreutzmann; +Cc: mario.blaettermann, linux-man
[-- Attachment #1: Type: text/plain, Size: 1389 bytes --]
Hi Helge,
> Subject: Re: Issue in man page PR_SET_SECUREBITS.2const
You probably meant PR_SET_THP_DISABLE.2const. The text you quoted is
there:
$ grep -rn THP.disable
man/man2const/PR_SET_THP_DISABLE.2const:9:set the state of the "THP disable" flag for the calling thread
man/man2const/PR_SET_THP_DISABLE.2const:21:Set the state of the "THP disable" flag for the calling thread.
man/man2const/PR_SET_THP_DISABLE.2const:32:The setting of the "THP disable" flag is inherited by a child created via
man/man2const/PR_GET_THP_DISABLE.2const:9:get the state of the "THP disable" flag for the calling thread
man/man2const/PR_GET_THP_DISABLE.2const:22:the "THP disable" flag for the calling thread:
On Sun, Aug 24, 2025 at 02:48:48PM +0000, Helge Kreutzmann wrote:
> Without further ado, the following was found:
>
> Issue: malloc → B<malloc>(3) ?
Maybe, but we should probably add a reference to malloc_hook(3) instead?
Cheers,
Alex
>
> "Setting this flag provides a method for disabling transparent huge pages for "
> "jobs where the code cannot be modified, and using a malloc hook with "
> "B<madvise>(2) is not an option (i.e., statically allocated data). The "
> "setting of the \"THP disable\" flag is inherited by a child created via "
> "B<fork>(2) and is preserved across B<execve>(2)."
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Issue in man page PR_SET_SECUREBITS.2const
2025-08-24 19:21 ` Alejandro Colomar
@ 2025-08-25 16:11 ` Helge Kreutzmann
2025-08-25 17:52 ` Carlos O'Donell
1 sibling, 0 replies; 9+ messages in thread
From: Helge Kreutzmann @ 2025-08-25 16:11 UTC (permalink / raw)
To: Alejandro Colomar; +Cc: mario.blaettermann, linux-man
[-- Attachment #1: Type: text/plain, Size: 2084 bytes --]
Hello Alejandro,
Am Sun, Aug 24, 2025 at 09:21:39PM +0200 schrieb Alejandro Colomar:
> Hi Helge,
>
> > Subject: Re: Issue in man page PR_SET_SECUREBITS.2const
>
> You probably meant PR_SET_THP_DISABLE.2const. The text you quoted is
> there:
>
> $ grep -rn THP.disable
> man/man2const/PR_SET_THP_DISABLE.2const:9:set the state of the "THP disable" flag for the calling thread
> man/man2const/PR_SET_THP_DISABLE.2const:21:Set the state of the "THP disable" flag for the calling thread.
> man/man2const/PR_SET_THP_DISABLE.2const:32:The setting of the "THP disable" flag is inherited by a child created via
> man/man2const/PR_GET_THP_DISABLE.2const:9:get the state of the "THP disable" flag for the calling thread
> man/man2const/PR_GET_THP_DISABLE.2const:22:the "THP disable" flag for the calling thread:
Yes, sorry.
> On Sun, Aug 24, 2025 at 02:48:48PM +0000, Helge Kreutzmann wrote:
> > Without further ado, the following was found:
> >
> > Issue: malloc → B<malloc>(3) ?
>
> Maybe, but we should probably add a reference to malloc_hook(3) instead?
This I cannot judge on, I just see the reference to "malloc" in the
text and hence the question, if this should be turned into a
reference. If malloc_hook(3) is better, than of coures it should be
used.
> Cheers,
> Alex
>
> >
> > "Setting this flag provides a method for disabling transparent huge pages for "
> > "jobs where the code cannot be modified, and using a malloc hook with "
> > "B<madvise>(2) is not an option (i.e., statically allocated data). The "
> > "setting of the \"THP disable\" flag is inherited by a child created via "
> > "B<fork>(2) and is preserved across B<execve>(2)."
>
> --
> <https://www.alejandro-colomar.es/>
Greetings
Helge
--
Dr. Helge Kreutzmann debian@helgefjell.de
Dipl.-Phys. http://www.helgefjell.de/debian.php
64bit GNU powered gpg signed mail preferred
Help keep free software "libre": http://www.ffii.de/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Issue in man page PR_SET_SECUREBITS.2const
2025-08-24 19:21 ` Alejandro Colomar
2025-08-25 16:11 ` Helge Kreutzmann
@ 2025-08-25 17:52 ` Carlos O'Donell
2025-08-25 19:41 ` Alejandro Colomar
1 sibling, 1 reply; 9+ messages in thread
From: Carlos O'Donell @ 2025-08-25 17:52 UTC (permalink / raw)
To: Alejandro Colomar, Helge Kreutzmann; +Cc: mario.blaettermann, linux-man
On 8/24/25 3:21 PM, Alejandro Colomar wrote:
> Hi Helge,
>
>> Subject: Re: Issue in man page PR_SET_SECUREBITS.2const
>
> You probably meant PR_SET_THP_DISABLE.2const. The text you quoted is
> there:
>
> $ grep -rn THP.disable
> man/man2const/PR_SET_THP_DISABLE.2const:9:set the state of the "THP disable" flag for the calling thread
> man/man2const/PR_SET_THP_DISABLE.2const:21:Set the state of the "THP disable" flag for the calling thread.
> man/man2const/PR_SET_THP_DISABLE.2const:32:The setting of the "THP disable" flag is inherited by a child created via
> man/man2const/PR_GET_THP_DISABLE.2const:9:get the state of the "THP disable" flag for the calling thread
> man/man2const/PR_GET_THP_DISABLE.2const:22:the "THP disable" flag for the calling thread:
>
> On Sun, Aug 24, 2025 at 02:48:48PM +0000, Helge Kreutzmann wrote:
>> Without further ado, the following was found:
>>
>> Issue: malloc → B<malloc>(3) ?
>
> Maybe, but we should probably add a reference to malloc_hook(3) instead?
In a modern system you care about malloc not malloc_hook.
The hooks have been removed and glibc has directly integrated THP usage in malloc instead.
https://sourceware.org/glibc/manual/2.42/html_node/Memory-Allocation-Tunables.html
Tunable: glibc.malloc.hugetlb
--
Cheers,
Carlos.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Issue in man page PR_SET_SECUREBITS.2const
2025-08-25 17:52 ` Carlos O'Donell
@ 2025-08-25 19:41 ` Alejandro Colomar
2025-08-25 20:00 ` Carlos O'Donell
0 siblings, 1 reply; 9+ messages in thread
From: Alejandro Colomar @ 2025-08-25 19:41 UTC (permalink / raw)
To: Carlos O'Donell; +Cc: Helge Kreutzmann, mario.blaettermann, linux-man
[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]
Hi Carlos,
On Mon, Aug 25, 2025 at 01:52:03PM -0400, Carlos O'Donell wrote:
> On 8/24/25 3:21 PM, Alejandro Colomar wrote:
> > Hi Helge,
> >
> > > Subject: Re: Issue in man page PR_SET_SECUREBITS.2const
> >
> > You probably meant PR_SET_THP_DISABLE.2const. The text you quoted is
> > there:
> >
> > $ grep -rn THP.disable
> > man/man2const/PR_SET_THP_DISABLE.2const:9:set the state of the "THP disable" flag for the calling thread
> > man/man2const/PR_SET_THP_DISABLE.2const:21:Set the state of the "THP disable" flag for the calling thread.
> > man/man2const/PR_SET_THP_DISABLE.2const:32:The setting of the "THP disable" flag is inherited by a child created via
> > man/man2const/PR_GET_THP_DISABLE.2const:9:get the state of the "THP disable" flag for the calling thread
> > man/man2const/PR_GET_THP_DISABLE.2const:22:the "THP disable" flag for the calling thread:
> >
> > On Sun, Aug 24, 2025 at 02:48:48PM +0000, Helge Kreutzmann wrote:
> > > Without further ado, the following was found:
> > >
> > > Issue: malloc → B<malloc>(3) ?
> >
> > Maybe, but we should probably add a reference to malloc_hook(3) instead?
>
> In a modern system you care about malloc not malloc_hook.
>
> The hooks have been removed and glibc has directly integrated THP usage in malloc instead.
>
> https://sourceware.org/glibc/manual/2.42/html_node/Memory-Allocation-Tunables.html
Thanks! Do we need a more thorough rewrite of this page is needed?
Or just replace malloc by malloc(3)?
Have a lovely night!
Alex
>
> Tunable: glibc.malloc.hugetlb
>
> --
> Cheers,
> Carlos.
>
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Issue in man page PR_SET_SECUREBITS.2const
2025-08-25 19:41 ` Alejandro Colomar
@ 2025-08-25 20:00 ` Carlos O'Donell
2025-08-31 9:19 ` Alejandro Colomar
0 siblings, 1 reply; 9+ messages in thread
From: Carlos O'Donell @ 2025-08-25 20:00 UTC (permalink / raw)
To: Alejandro Colomar; +Cc: Helge Kreutzmann, mario.blaettermann, linux-man
On 8/25/25 3:41 PM, Alejandro Colomar wrote:
> Hi Carlos,
>
> On Mon, Aug 25, 2025 at 01:52:03PM -0400, Carlos O'Donell wrote:
>> On 8/24/25 3:21 PM, Alejandro Colomar wrote:
>>> Hi Helge,
>>>
>>>> Subject: Re: Issue in man page PR_SET_SECUREBITS.2const
>>>
>>> You probably meant PR_SET_THP_DISABLE.2const. The text you quoted is
>>> there:
>>>
>>> $ grep -rn THP.disable
>>> man/man2const/PR_SET_THP_DISABLE.2const:9:set the state of the "THP disable" flag for the calling thread
>>> man/man2const/PR_SET_THP_DISABLE.2const:21:Set the state of the "THP disable" flag for the calling thread.
>>> man/man2const/PR_SET_THP_DISABLE.2const:32:The setting of the "THP disable" flag is inherited by a child created via
>>> man/man2const/PR_GET_THP_DISABLE.2const:9:get the state of the "THP disable" flag for the calling thread
>>> man/man2const/PR_GET_THP_DISABLE.2const:22:the "THP disable" flag for the calling thread:
>>>
>>> On Sun, Aug 24, 2025 at 02:48:48PM +0000, Helge Kreutzmann wrote:
>>>> Without further ado, the following was found:
>>>>
>>>> Issue: malloc → B<malloc>(3) ?
>>>
>>> Maybe, but we should probably add a reference to malloc_hook(3) instead?
>>
>> In a modern system you care about malloc not malloc_hook.
>>
>> The hooks have been removed and glibc has directly integrated THP usage in malloc instead.
>>
>> https://sourceware.org/glibc/manual/2.42/html_node/Memory-Allocation-Tunables.html
>
> Thanks! Do we need a more thorough rewrite of this page is needed?
> Or just replace malloc by malloc(3)?
Yes, the existing text is only correct for < 2.34 glibc system.
A > 2.34 system has THP support with the tunable to support THP (for legacy libhugetlbfs users).
And a glibc == 2.34 system lacks this feature and doesn't support such hook + interposer deployments.
The quickest fix is to reference malloc(3) for now.
--
Cheers,
Carlos.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Issue in man page PR_SET_SECUREBITS.2const
2025-08-25 20:00 ` Carlos O'Donell
@ 2025-08-31 9:19 ` Alejandro Colomar
0 siblings, 0 replies; 9+ messages in thread
From: Alejandro Colomar @ 2025-08-31 9:19 UTC (permalink / raw)
To: Carlos O'Donell; +Cc: Helge Kreutzmann, mario.blaettermann, linux-man
[-- Attachment #1: Type: text/plain, Size: 2426 bytes --]
Hi Carlos, Helge,
On Mon, Aug 25, 2025 at 04:00:58PM -0400, Carlos O'Donell wrote:
> On 8/25/25 3:41 PM, Alejandro Colomar wrote:
> > Hi Carlos,
> >
> > On Mon, Aug 25, 2025 at 01:52:03PM -0400, Carlos O'Donell wrote:
> > > On 8/24/25 3:21 PM, Alejandro Colomar wrote:
> > > > Hi Helge,
> > > >
> > > > > Subject: Re: Issue in man page PR_SET_SECUREBITS.2const
> > > >
> > > > You probably meant PR_SET_THP_DISABLE.2const. The text you quoted is
> > > > there:
> > > >
> > > > $ grep -rn THP.disable
> > > > man/man2const/PR_SET_THP_DISABLE.2const:9:set the state of the "THP disable" flag for the calling thread
> > > > man/man2const/PR_SET_THP_DISABLE.2const:21:Set the state of the "THP disable" flag for the calling thread.
> > > > man/man2const/PR_SET_THP_DISABLE.2const:32:The setting of the "THP disable" flag is inherited by a child created via
> > > > man/man2const/PR_GET_THP_DISABLE.2const:9:get the state of the "THP disable" flag for the calling thread
> > > > man/man2const/PR_GET_THP_DISABLE.2const:22:the "THP disable" flag for the calling thread:
> > > >
> > > > On Sun, Aug 24, 2025 at 02:48:48PM +0000, Helge Kreutzmann wrote:
> > > > > Without further ado, the following was found:
> > > > >
> > > > > Issue: malloc → B<malloc>(3) ?
> > > >
> > > > Maybe, but we should probably add a reference to malloc_hook(3) instead?
> > >
> > > In a modern system you care about malloc not malloc_hook.
> > >
> > > The hooks have been removed and glibc has directly integrated THP usage in malloc instead.
> > >
> > > https://sourceware.org/glibc/manual/2.42/html_node/Memory-Allocation-Tunables.html
> >
> > Thanks! Do we need a more thorough rewrite of this page is needed?
> > Or just replace malloc by malloc(3)?
>
> Yes, the existing text is only correct for < 2.34 glibc system.
>
> A > 2.34 system has THP support with the tunable to support THP (for legacy libhugetlbfs users).
>
> And a glibc == 2.34 system lacks this feature and doesn't support such hook + interposer deployments.
>
> The quickest fix is to reference malloc(3) for now.
Thanks! I've applied that fix.
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=4de21772d70d210ff9085c65ed380b0463d47a49>
(use port 80.)
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Issue in man page PR_SET_SECUREBITS.2const
@ 2025-08-24 14:48 Helge Kreutzmann
2025-08-24 19:25 ` Alejandro Colomar
0 siblings, 1 reply; 9+ messages in thread
From: Helge Kreutzmann @ 2025-08-24 14:48 UTC (permalink / raw)
To: alx; +Cc: mario.blaettermann, linux-man
Without further ado, the following was found:
Issue: I<op> → I<flags> ?
"I<op> is B<PR_SET_SECUREBITS>, and the caller does not have the "
"B<CAP_SETPCAP> capability, or tried to unset a \"locked\" flag, or tried to "
"set a flag whose corresponding locked flag was set (see B<capabilities>(7))."
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Issue in man page PR_SET_SECUREBITS.2const
2025-08-24 14:48 Helge Kreutzmann
@ 2025-08-24 19:25 ` Alejandro Colomar
0 siblings, 0 replies; 9+ messages in thread
From: Alejandro Colomar @ 2025-08-24 19:25 UTC (permalink / raw)
To: Helge Kreutzmann; +Cc: mario.blaettermann, linux-man
[-- Attachment #1: Type: text/plain, Size: 1494 bytes --]
Hi Helge,
On Sun, Aug 24, 2025 at 02:48:48PM +0000, Helge Kreutzmann wrote:
> Without further ado, the following was found:
>
> Issue: I<op> → I<flags> ?
>
> "I<op> is B<PR_SET_SECUREBITS>, and the caller does not have the "
> "B<CAP_SETPCAP> capability, or tried to unset a \"locked\" flag, or tried to "
> "set a flag whose corresponding locked flag was set (see B<capabilities>(7))."
Hmmm, this is cruft that I forgot to update after splitting the page.
I've fixed it with this:
commit c71d7a2e31c0689d942bc3b030284144bd331f04 (HEAD -> contrib)
Author: Alejandro Colomar <alx@kernel.org>
Date: Sun Aug 24 21:23:39 2025 +0200
man/man2const/PR_SET_SECUREBITS.2const: wfix
Fixes: 2dcad3cde34e (2024-05-31; "PR_SET_SECUREBITS.2const: Tweak after split")
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
diff --git a/man/man2const/PR_SET_SECUREBITS.2const b/man/man2const/PR_SET_SECUREBITS.2const
index ae7268d7d..c80ce0f2e 100644
--- a/man/man2const/PR_SET_SECUREBITS.2const
+++ b/man/man2const/PR_SET_SECUREBITS.2const
@@ -35,10 +35,7 @@ .SH ERRORS
is not a valid value.
.TP
.B EPERM
-.I op
-is
-.BR PR_SET_SECUREBITS ,
-and the caller does not have the
+The caller does not have the
.B CAP_SETPCAP
capability,
or tried to unset a "locked" flag,
Thanks for the report!
Cheers,
Alex
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-08-31 9:19 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-24 14:48 Issue in man page PR_SET_SECUREBITS.2const Helge Kreutzmann
2025-08-24 19:21 ` Alejandro Colomar
2025-08-25 16:11 ` Helge Kreutzmann
2025-08-25 17:52 ` Carlos O'Donell
2025-08-25 19:41 ` Alejandro Colomar
2025-08-25 20:00 ` Carlos O'Donell
2025-08-31 9:19 ` Alejandro Colomar
-- strict thread matches above, loose matches on Subject: below --
2025-08-24 14:48 Helge Kreutzmann
2025-08-24 19:25 ` Alejandro Colomar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox