unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: "Никита Попов" <npv1310@gmail.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] librt: fix NULL pointer dereference (bug 28213)
Date: Mon, 9 Aug 2021 19:02:35 +0530	[thread overview]
Message-ID: <5e77e8ef-f526-045b-945f-c582f2c8144c@gotplt.org> (raw)
In-Reply-To: <ef1aecbb-fb10-7c93-5315-0f5ed886b152@gotplt.org>

On 8/9/21 6:51 PM, Siddhesh Poyarekar wrote:
> On 8/9/21 5:55 PM, Никита Попов via Libc-alpha wrote:
>> Helper thread frees copied attribute on NOTIFY_REMOVED message 
>> received from the OS kernel. Unfortunately, it fails to check whether 
>> copied attribute actually exists (data.attr != NULL). This worked 
>> earlier because free() checks passed pointer before actually 
>> attempting to release corresponding memory. But __pthread_attr_destroy 
>> assumes pointer is not NULL. So passing NULL pointer to 
>> __pthread_attr_destroy will result in segmentation fault. This 
>> scenario is possible if notification->sigev_notify_attributes == NULL 
>> (which means default thread attributes should be used).
> 
> Thank you, the fix looks good to me.  Do you have a test case to go with 
> it?

Also, I don't know if you have an FSF copyright assignment, but it's no 
longer necessary.  Please confirm that you're the original author and 
are authorized to contribute this patch by adding a DCO, i.e. add a 
Signed-off-by to indicate that.  See also:

https://developercertificate.org/

Thanks,
Siddhesh

  parent reply	other threads:[~2021-08-09 13:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-09 12:25 [PATCH] librt: fix NULL pointer dereference (bug 28213) Никита Попов via Libc-alpha
2021-08-09 13:21 ` Siddhesh Poyarekar
2021-08-09 13:27   ` Florian Weimer via Libc-alpha
2021-08-09 13:32   ` Siddhesh Poyarekar [this message]
2021-08-09 13:45     ` Никита Попов via Libc-alpha
2021-08-09 14:35       ` Siddhesh Poyarekar
2021-08-09 14:50       ` Siddhesh Poyarekar

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5e77e8ef-f526-045b-945f-c582f2c8144c@gotplt.org \
    --to=siddhesh@gotplt.org \
    --cc=libc-alpha@sourceware.org \
    --cc=npv1310@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).