All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx.manpages@gmail.com>
To: Jack Pearson <jack@pearson.onl>
Cc: linux-man@vger.kernel.org,
	GNU C Library <libc-alpha@sourceware.org>,
	Carlos O'Donell <carlos@redhat.com>
Subject: Re: [PATCH] clone.2: note EINVAL when exit_signal + bad flags
Date: Wed, 14 Dec 2022 22:02:26 +0100	[thread overview]
Message-ID: <244682bc-3636-1305-da8f-5a635a82c896@gmail.com> (raw)
In-Reply-To: <6223bdf7-bbb4-890f-ad41-3ee75ecb0fb4@pearson.onl>


[-- Attachment #1.1: Type: text/plain, Size: 1460 bytes --]

Hi Jack,

Please keep glibc and Carlos in the loop.

Thanks,

Alex

On 12/14/22 22:00, Jack Pearson wrote:
> On 12/12/22 18:53, Carlos O'Donell wrote:
>> On 12/9/22 14:49, Alejandro Colomar wrote:
>>> Hi Jack,
>>>
>>> On 12/2/22 23:44, Jack Pearson wrote:
>>>> Document that Linux will report EINVAL when exit_signal is specified and
>>>> either CLONE_THREAD or CLONE_PARENT is specified.
>>>>
>>>>   From clone3_args_valid in Linux:
>>>> ```
>>>>      if ((kargs->flags & (CLONE_THREAD | CLONE_PARENT)) &&
>>>>          kargs->exit_signal)
>>>>          return false;
>>>> ```
>>>>
>>>> I have verified that this happens on my kernel with a small program, and
>>>> that this doesn't happen with normal `clone` through the glibc helper.
>>>
>>> Could you please also send a test program with the glibc wrapper?
>>>
>>> BTW, glibc has a clone3(2) wrapper since last year.  It would be interesting 
>>> to document it instead of the raw syscall.
>>
>> glibc does not have a clone3 wrapper.
>>
>> glibc has an internal non-exported __clone3 interface that we use for pthreads,
>> and likely soon for posix_spawn.
>>
>> We have not yet chosen to export clone3 as a public global symbol that developers
>> can use.
>>
> 
> Ahhh, that's why I couldn't find it in the headers.
> 
> Incoming patch with the glibc clone wrapper test program.
> 
> 
> Jack

-- 
<http://www.alejandro-colomar.es/>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-12-14 21:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02 22:44 [PATCH] clone.2: note EINVAL when exit_signal + bad flags Jack Pearson
2022-12-09 19:49 ` Alejandro Colomar
2022-12-13  2:53   ` Carlos O'Donell
2022-12-13 22:59     ` Alejandro Colomar
2022-12-14 21:00     ` Jack Pearson
2022-12-14 21:02       ` Alejandro Colomar [this message]
2022-12-14 21:13         ` Jack Pearson
2023-02-28 23:42 Jack Pearson
2023-03-01 21:31 ` Alejandro Colomar

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=244682bc-3636-1305-da8f-5a635a82c896@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=carlos@redhat.com \
    --cc=jack@pearson.onl \
    --cc=libc-alpha@sourceware.org \
    --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 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.