From patchwork Tue Feb 4 15:24:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 1233390 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-109164-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha1 header.s=default header.b=YXjEr1W1; dkim-atps=neutral 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 48BpSm6b5SzB3xq for ; Wed, 5 Feb 2020 02:26:32 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding; q=dns; s=default; b=G9hB3JXY9BGF3e/X Fv7JY08CoWyNTtHSWGoFzA2TyOuAaF3bxfDVo4SElPERvb/kboWnNtqwfX1UGqOA 6LMscITNuHU+SH2PSSFT2Jsqb/NY8qTkQPugPAHO+Pokgdk/OQ5cP2ddfUBSRXIc 6RO5LAxuQMI7zE91cswOsak+2Uw= 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:from:to:subject:date:message-id:mime-version :content-transfer-encoding; s=default; bh=Abj5jFwAHZ7b+/BMcIWRNy M0vcU=; b=YXjEr1W1mQcuOQp2PxIfYl19LdFNq9polaRCh+8d9q4OAUpffnP/bh sf6gzyujFLG8ZU8CGFvAg2Qutu7xzW+rOSAhCZ619KBqwluikVDlXXo9VNYM8jDu dV1Asomo9eluF3ZICe6a0cZxFlnQMhppRVyvn+ECJjVCTKM9OhWD8= Received: (qmail 31492 invoked by alias); 4 Feb 2020 15:26:26 -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 31410 invoked by uid 89); 4 Feb 2020 15:26:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=3010, HContent-Transfer-Encoding:8bit X-HELO: mx0a-001b2d01.pphosted.com From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCH] ldbl-128ibm-compat: set PRINTF_CHK flag in {,v}sprintf_chk Date: Tue, 4 Feb 2020 09:24:44 -0600 Message-Id: <20200204152444.15633-1-murphyp@linux.vnet.ibm.com> MIME-Version: 1.0 This should be unconditionally set to match the common implementation, and fixes multiple test failures related to sprintf. Reviewed-by: Tulio Magno Quites Machado Filho --- sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c | 4 ++++ sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c index 207c1c62ad..f52e17fdc7 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c +++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sprintf_chk.c @@ -30,6 +30,10 @@ ___ieee128_sprintf_chk (char *s, int flag, size_t slen, if (flag > 0) mode |= PRINTF_FORTIFY; + /* Regardless of the value of flag, let __vsprintf_internal know that + this is a call from *printf_chk. */ + mode |= PRINTF_CHK; + if (slen == 0) __chk_fail (); diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c index 2c32735f3c..c6130b4f5f 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c +++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsprintf_chk.c @@ -26,6 +26,10 @@ ___ieee128_vsprintf_chk (char *string, int flag, size_t slen, if (flag > 0) mode |= PRINTF_FORTIFY; + /* Regardless of the value of flag, let __vsprintf_internal know that + this is a call from *printf_chk. */ + mode |= PRINTF_CHK; + if (slen == 0) __chk_fail ();