From patchwork Thu Aug 3 11:46:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 130512 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp1089304vqx; Thu, 3 Aug 2023 04:48:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlE6MKPBTrFMDtL/6Ch6afJd3o342Fsho5+vF2OPa3dJNeuijKTyVzpodsd8QRB2Pe4pqv5h X-Received: by 2002:a05:6402:405:b0:522:86fc:c0cc with SMTP id q5-20020a056402040500b0052286fcc0ccmr6506662edv.35.1691063294076; Thu, 03 Aug 2023 04:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691063294; cv=none; d=google.com; s=arc-20160816; b=tDMMfs7+G7ktzEOoa9h1DPzYpdf/10Ru77ccAFvHYMLcst7rbQjAGpK3k3UGV2OQcg LFa2LTFdtlFjy89AdkLeMEmdlVcWz4oZJ1EInfk9Nj9K7CVWINX3MSi5pOplzbnoPC/I k2sJKNihp3zGMj9hxDQ1oE3OoCRY4RS1hVZg4WlWrH7j6Gou2cnRYFsft3JPbtmIRWA3 4ZD8rtwvcnp0hjw8Z4OkS5uIQsY0vF9i8bb8m8VEINMDZNr/GJBjh8vG15iEnQTn1YTe o3IbCJh5se+SMDzJ3RcHKc+iZBsLTbw+GNY/1Y3W1oFfbqet2Tr04j0eB6NAU3e/+ojf afdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:content-disposition:mime-version :message-id:subject:to:date:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=lI9sSjnow3mFtuAvK2hctjxkajNX8t3dBOSiza6nxgI=; fh=HNIqzTA9Dp00ovCAyCdXfuEvWDT00OlFxFRPLybXRis=; b=FHI2fEbx3H+bbY+ZLvNynvoPUaD1xMqY0k2SHYaQ74SSY8YgssOZdA3sfp9TliSstC FoiQe3fk6qASe7cjUp1XeDJFsTk7lPExEH6uMsX0FvKfuGOc43Z7m0f0rE0qcC7kDSot PxUNX0EVszx8F7umoiqM12Qdi+2rdmqhqb2HLFO8WBjpVt6wmfMKOH0RDuoKm7ET4UF9 U8G5WMW5TMDE8qfYlcXJJS43xnyeHRUcpVQHNzkuSIZzk3uFr00YkFAdtTrbr5T9vtM1 nCr453qKWwroRxsl16djZSOkNPkM7wGCYCXlTPPrOmpGczemsbStzoCef2ttx6wss6/U lctQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=iYWgwa6A; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id bf20-20020a0564021a5400b00522299aed58si689074edb.442.2023.08.03.04.48.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 04:48:14 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=iYWgwa6A; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3CAF6386D622 for ; Thu, 3 Aug 2023 11:46:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3CAF6386D622 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1691063212; bh=lI9sSjnow3mFtuAvK2hctjxkajNX8t3dBOSiza6nxgI=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=iYWgwa6A60XkKhS0BFDfB0DYgPka7bsIpvklVwUUjNiHGkIrx0mUlZeWDFBJzaKFB 0kSYZz/5GdtUm7ERGiuran1cc4+ZSyrxdBBrUJIShzYRn7ZM6fWymTfm5OLQgyq9Lh 8O3R7n8VWp200BIaqIFeVKbuZgKMtFNa5G7FTgew= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 358763851145 for ; Thu, 3 Aug 2023 11:46:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 358763851145 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-686f94328a4so611822b3a.0 for ; Thu, 03 Aug 2023 04:46:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691063203; x=1691668003; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lI9sSjnow3mFtuAvK2hctjxkajNX8t3dBOSiza6nxgI=; b=MqcmcR69Bn2FRv9GjbhYkCyhpiLC9otHyUByrEXo2zA5BgO4rOGh3jT/k/11CoYUSJ f0vmLzNnMDBz7isbG6y8Fh1vv3bnCP4dMSD8GHfNUP+MKCYIxcoLWO1J4XjjEjz7AFse 96iv8rCXXoQ1HDNjQ1hgMIR9XTb/p48BRz0JK/6Ow8OtCMBdEqNDwGzjkUJd8WSBSQ91 Pa5tjTvu8uW+TjQDeYy94a87Oj379l7d5GSCvpqYGd1+eZP/onwmlfvdgs8NvS/dt4tu LRl67KjoFaLUZ0H+7mmww2QOA8B2vYI3dG1L/+xN2uT8lxmLlR5PyjXzAkHorTUKfny0 toSA== X-Gm-Message-State: ABy/qLZB1PNvkQCYocHV2Gg/Ae5688KGPHZmaL3BhnvmVaKpYjv7JtvB 6Y7+CSS2PuUosyxlUT/1o41GBR4f0wM= X-Received: by 2002:a05:6a00:1883:b0:682:93ce:4825 with SMTP id x3-20020a056a00188300b0068293ce4825mr29135047pfh.3.1691063202731; Thu, 03 Aug 2023 04:46:42 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id v3-20020aa78083000000b00682a61fa525sm12985557pff.91.2023.08.03.04.46.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 04:46:42 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 1C78911427AD; Thu, 3 Aug 2023 21:16:40 +0930 (ACST) Date: Thu, 3 Aug 2023 21:16:40 +0930 To: binutils@sourceware.org Subject: arm: sanitizer stringop-overflow Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3034.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alan Modra via Binutils From: Alan Modra Reply-To: Alan Modra Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773208384718419419 X-GMAIL-MSGID: 1773208384718419419 In function ‘memset’, inlined from ‘create_unwind_entry’ at /home/alan/src/binutils-gdb/gas/config/tc-arm.c:27881:3: /usr/include/bits/string_fortified.h:59:10: error: ‘__builtin_memset’ specified size between 2147483652 and 4294967295 exceeds maximum object size 2147483647 [-Werror=stringop-overflow=] 59 | return __builtin___memset_chk (__dest, __ch, __len, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | __glibc_objsize0 (__dest)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ * config/tc-arm.c (create_unwind_entry): Return after bad size, and bad opcode count. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index c0f6215fbc1..f912fb234b6 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -27828,7 +27828,10 @@ create_unwind_entry (int have_data) if (unwind.personality_index == 0) { if (unwind.opcode_count > 3) - as_bad (_("too many unwind opcodes for personality routine 0")); + { + as_bad (_("too many unwind opcodes for personality routine 0")); + return 1; + } if (!have_data) { @@ -27869,7 +27872,10 @@ create_unwind_entry (int have_data) size = (size + 3) >> 2; if (size > 0xff) - as_bad (_("too many unwind opcodes")); + { + as_bad (_("too many unwind opcodes")); + return 1; + } frag_align (2, 0, 0); record_alignment (now_seg, 2);