public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug network/14889] svc_run() produces high cpu usage when accept() fails with EMFILE (CVE-2011-4609)
Date: Thu, 10 Dec 2020 10:13:16 +0000	[thread overview]
Message-ID: <bug-14889-131-DfNaGQBRGW@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-14889-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=14889

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Stefan Liebler <stli@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4b2e40a9259fab08161e1c607b06a41e15d543dc

commit 4b2e40a9259fab08161e1c607b06a41e15d543dc
Author: Stefan Liebler <stli@linux.ibm.com>
Date:   Fri Dec 4 17:00:27 2020 +0100

    Handle out-of-memory case in svc_tcp.c/svc_unix.c:rendezvous_request.

    If glibc is build with -O3 on at least 390 (-m31) or x86 (-m32),
    gcc 11 dumps this warning:
    svc_tcp.c: In function 'rendezvous_request':
    svc_tcp.c:274:3: error: 'memcpy' offset [0, 15] is out of the bounds [0, 0]
[-Werror=array-bounds]
      274 |   memcpy (&xprt->xp_raddr, &addr, sizeof (addr));
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    In out-of-memory case, if one of the mallocs in makefd_xprt function
    returns NULL, a message is dumped, makefd_xprt returns NULL
    and the subsequent memcpy would copy to NULL.

    Instead of a segfaulting, we delay a bit (see also __svc_accept_failed
    and Bug 14889 (CVE-2011-4609) - svc_run() produces high cpu usage when
    accept() fails with EMFILE (CVE-2011-4609).

    The same applies to svc_unix.c.
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2020-12-10 10:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28 21:09 [Bug network/14889] New: CVE-2011-4609 svc_run() produces high cpu usage when accept() fails with EMFILE law at redhat dot com
2012-11-28 21:17 ` [Bug network/14889] " law at redhat dot com
2014-06-13  9:26 ` fweimer at redhat dot com
2015-01-16 16:59 ` cvs-commit at gcc dot gnu.org
2015-01-29 18:50 ` cvs-commit at gcc dot gnu.org
2015-02-23 15:03 ` cvs-commit at gcc dot gnu.org
2020-12-10 10:13 ` cvs-commit at gcc dot gnu.org [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=bug-14889-131-DfNaGQBRGW@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).