From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36599 invoked by alias); 7 Oct 2016 04:12:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 36555 invoked by uid 89); 7 Oct 2016 04:12:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=Toolchain, c113, 0502, C113 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Oct 2016 04:12:30 +0000 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9749W3x128064 for ; Fri, 7 Oct 2016 00:12:29 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0a-001b2d01.pphosted.com with ESMTP id 25wu5g5gw2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 07 Oct 2016 00:12:28 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 6 Oct 2016 22:12:27 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 6 Oct 2016 22:12:25 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id EE91B3E4003F; Thu, 6 Oct 2016 22:12:24 -0600 (MDT) Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u974COPc10224006; Thu, 6 Oct 2016 21:12:24 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ABAF86A087; Thu, 6 Oct 2016 22:12:14 -0600 (MDT) Received: from ragesh3a (unknown [9.80.99.79]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id 2B99B6A07C; Thu, 6 Oct 2016 22:12:14 -0600 (MDT) Subject: [PATCH, RS6000, Committed] increase buf size in rs6000_elf_asm_out_{constructor,destructor} From: Aaron Sawdey To: gcc-patches List Cc: segher@kernel.crashing.org Date: Fri, 07 Oct 2016 04:12:00 -0000 Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16100704-0028-0000-0000-000005C2E35F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005865; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000186; SDB=6.00765314; UDB=6.00365677; IPR=6.00541160; BA=6.00004791; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012900; XFM=3.00000011; UTC=2016-10-07 04:12:26 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16100704-0029-0000-0000-00002FD6E0EB Message-Id: <1475813533.5970.13.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-07_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610070072 X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00444.txt.bz2 It seems we now have analysis that concludes these buffers may possibly overflow. This broke bootstrap on ppc64 BE. Bootstrap passed on ppc64 BE power7. Committing as pre-approved by Segher. 2016-10-06 Aaron Sawdey * config/rs6000/rs6000.c (rs6000_elf_asm_out_constructor) (rs6000_elf_asm_out_destructor): increase size of buf to avoid possible overflow. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 240846) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -34166,7 +34166,7 @@ rs6000_elf_asm_out_constructor (rtx symbol, int priority) { const char *section = ".ctors"; - char buf[16]; + char buf[18]; if (priority != DEFAULT_INIT_PRIORITY) { @@ -34197,7 +34197,7 @@ rs6000_elf_asm_out_destructor (rtx symbol, int priority) { const char *section = ".dtors"; - char buf[16]; + char buf[18]; if (priority != DEFAULT_INIT_PRIORITY) { -- Aaron Sawdey, Ph.D. acsawdey@linux.vnet.ibm.com 050-2/C113 (507) 253-7520 home: 507/263-0782 IBM Linux Technology Center - PPC Toolchain