Openembedded Core Discussions
 help / color / mirror / Atom feed
From: akuster808 <akuster808@gmail.com>
To: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>,
	openembedded-core@lists.openembedded.org
Subject: Re: [rocko] [PATCH] glibc:CVE-2017-17426
Date: Fri, 29 Dec 2017 20:29:51 -0800	[thread overview]
Message-ID: <19404760-e3b8-aaf5-3ff8-4d22398cb4e4@gmail.com> (raw)
In-Reply-To: <1514438375-4227-1-git-send-email-huangqy.fnst@cn.fujitsu.com>



On 12/27/2017 09:19 PM, Huang Qiyu wrote:
> Fix the CVE-2017-17426.

Is this fix in master?

- armin
>
> Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
> ---
>  ...-overflow-in-malloc-when-tcache-is-enable.patch | 49 ++++++++++++++++++++++
>  meta/recipes-core/glibc/glibc_2.26.bb              |  1 +
>  2 files changed, 50 insertions(+)
>  create mode 100644 meta/recipes-core/glibc/glibc/0029-Fix-integer-overflow-in-malloc-when-tcache-is-enable.patch
>
> diff --git a/meta/recipes-core/glibc/glibc/0029-Fix-integer-overflow-in-malloc-when-tcache-is-enable.patch b/meta/recipes-core/glibc/glibc/0029-Fix-integer-overflow-in-malloc-when-tcache-is-enable.patch
> new file mode 100644
> index 0000000..fb52be5
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc/0029-Fix-integer-overflow-in-malloc-when-tcache-is-enable.patch
> @@ -0,0 +1,49 @@
> +From 34697694e8a93b325b18f25f7dcded55d6baeaf6 Mon Sep 17 00:00:00 2001
> +From: Arjun Shankar <arjun@redhat.com>
> +Date: Thu, 30 Nov 2017 13:31:45 +0100
> +Subject: [PATCH] Fix integer overflow in malloc when tcache is enabled [BZ
> + #22375]
> +
> +When the per-thread cache is enabled, __libc_malloc uses request2size (which
> +does not perform an overflow check) to calculate the chunk size from the
> +requested allocation size. This leads to an integer overflow causing malloc
> +to incorrectly return the last successfully allocated block when called with
> +a very large size argument (close to SIZE_MAX).
> +
> +This commit uses checked_request2size instead, removing the overflow.
> +---
> + ChangeLog       | 6 ++++++
> + malloc/malloc.c | 3 ++-
> + 2 files changed, 8 insertions(+), 1 deletion(-)
> +
> +diff --git a/ChangeLog b/ChangeLog
> +index b55ed22..888f9fb 100644
> +--- a/ChangeLog
> ++++ b/ChangeLog
> +@@ -1,3 +1,9 @@
> ++2017-11-30  Arjun Shankar  <arjun@redhat.com>
> ++
> ++	[BZ #22375]
> ++	* malloc/malloc.c (__libc_malloc): Use checked_request2size
> ++	instead of request2size.
> ++
> + 2017-08-02  Siddhesh Poyarekar  <siddhesh@sourceware.org>
> + 
> + 	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S
> +diff --git a/malloc/malloc.c b/malloc/malloc.c
> +index 79f0e9e..0c9e074 100644
> +--- a/malloc/malloc.c
> ++++ b/malloc/malloc.c
> +@@ -3050,7 +3050,8 @@ __libc_malloc (size_t bytes)
> +     return (*hook)(bytes, RETURN_ADDRESS (0));
> + #if USE_TCACHE
> +   /* int_free also calls request2size, be careful to not pad twice.  */
> +-  size_t tbytes = request2size (bytes);
> ++  size_t tbytes;
> ++  checked_request2size (bytes, tbytes);
> +   size_t tc_idx = csize2tidx (tbytes);
> + 
> +   MAYBE_INIT_TCACHE ();
> +-- 
> +2.7.4
> +
> diff --git a/meta/recipes-core/glibc/glibc_2.26.bb b/meta/recipes-core/glibc/glibc_2.26.bb
> index 135ec4f..d314316 100644
> --- a/meta/recipes-core/glibc/glibc_2.26.bb
> +++ b/meta/recipes-core/glibc/glibc_2.26.bb
> @@ -43,6 +43,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
>             file://0026-assert-Suppress-pedantic-warning-caused-by-statement.patch \
>             file://0027-glibc-reset-dl-load-write-lock-after-forking.patch \
>             file://0028-Bug-4578-add-ld.so-lock-while-fork.patch \
> +           file://0029-Fix-integer-overflow-in-malloc-when-tcache-is-enable.patch\
>  "
>  
>  NATIVESDKFIXES ?= ""



  parent reply	other threads:[~2017-12-30  4:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28  5:19 [rocko] [PATCH] glibc:CVE-2017-17426 Huang Qiyu
2017-12-28  5:34 ` ✗ patchtest: failure for glibc:CVE-2017-17426 (rev2) Patchwork
2017-12-30  4:29 ` akuster808 [this message]
2018-01-02  8:45   ` [rocko] [PATCH] glibc:CVE-2017-17426 Huang, Qiyu
2018-01-17  2:46 ` Huang, Qiyu

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=19404760-e3b8-aaf5-3ff8-4d22398cb4e4@gmail.com \
    --to=akuster808@gmail.com \
    --cc=huangqy.fnst@cn.fujitsu.com \
    --cc=openembedded-core@lists.openembedded.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