From patchwork Fri Oct 28 13:04:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 688385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t53rX6JYdz9snk for ; Sat, 29 Oct 2016 00:05:00 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=nGfKokZI; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= tgK1kqaHn51cbbnkbn9T0oOReiM583ydGN2DW9PII8rXLnTJqXcn1J/fYtnEf6Um X8Q0K8B5sOh5IAXBP4x/h7Rr+Papzbr3Kfsyx0Rrtcmo0ehlFrVJG7ix1iu9DdfD xjlOgVc4UqDcLg5rU4XjUkBwPCAqUOfQZyYKKr1GtB0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=IQb50p oNhMr9oYfyudqSDfNXEC0=; b=nGfKokZIXL9DEkCSzYIaklb7SFv3Dl34JRXHyV rDl2LImYYl6vPj1fJdKtBcE1lwFal2Xq4mTg7gqCiwsuD334N+RP1SOH9XK2DrwG pK+YI6mJWOtRQYNKkNVcwX4dUTDmxriM8zgCgb4mByrq0nKRXv0XUr6AlOJMZwAA +eKdY= Received: (qmail 112342 invoked by alias); 28 Oct 2016 13:04:53 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 112306 invoked by uid 89); 28 Oct 2016 13:04:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Date: Fri, 28 Oct 2016 15:04:49 +0200 To: libc-alpha@sourceware.org Subject: [PATCH] sysmalloc: Initialize previous size field of mmaped chunks User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20161028130449.BB0E9439942E0@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) With different encodings of the header, the previous zero initialization may be insufficient and produce an invalid encoding. 2016-10-27 Florian Weimer * malloc/malloc.c (sysmalloc): Initialize previous size field of mmaped chunks. diff --git a/malloc/malloc.c b/malloc/malloc.c index 186e174..72d22bd 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -2306,6 +2306,7 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av) else { p = (mchunkptr) mm; + set_prev_size (p, 0); set_head (p, size | IS_MMAPPED); }