From patchwork Mon Jan 22 13:45:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 764637 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1107471wrx; Mon, 22 Jan 2024 05:46:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHhMHJ+Kdt2PyMxSgpCZNv435nf5fXIUb/FJPybE8gRB+h0wy19v7OFqcTbq4pn288ytwWO X-Received: by 2002:ac8:5dce:0:b0:42a:2001:de05 with SMTP id e14-20020ac85dce000000b0042a2001de05mr7463078qtx.84.1705931216520; Mon, 22 Jan 2024 05:46:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705931216; cv=pass; d=google.com; s=arc-20160816; b=y7CzFRiD94bj6WtYnv40jAd2Qy37xkNe+KS8UTefPjJ8ktpRQD5cxTrp3GpuEccDfS Z9NilaT1HXMlSqAqmiWAhuWyd1bUbVFi9Mzk0o1JSkhwLg8ZopREfLLWOj7weKe6tCFy lZQmRsGdiyB0rEvriYkun/vCYGl4CXLzT2X0ICqA+DoIsub+sTd1c4LFqk9zthQK1Awr 9oRhTJPV8yvxJ0oYskasGfE53uDs95WW6AOZpYX/VHZEdkfE2gKAEUjrw31R+gmFfWiK pA72mSIg2W1wIU/bhxtrDbFYir2FxpJHF1Bvlf82FQSzXFD5qtrSJ4Lnyg1JzPgRnFR8 4lcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=jHLV73m/J8q9tzn097Vq0HV+K6GsNYFiXHqcnA8w2LU=; fh=6kII54P5UflNK177m6x4BH8jzdcCgRHrHfukE7nuSGU=; b=uJwO5X/xymPH3H6A5/IQOyF5fFNY63TAx4+OUfpvv3dmpq6yVHI4c2xmdyZPt7mKtW ixUbZrZGgUXL3lwKC74EpmjAgCnSl31ArtrSTr5OnusIjqc2ecXwBNPLkE/LaxcYr5qN pY3CHMQcyxNSEjFjVVGTXFgztww/Witznf0OCn92Vpdgca/ZN2Y7x7ELSf/r9onVz5Pl TvhNGNpqTiaSu4yvVb95TBvCu8/IUWF9TjTzDAaYnYGKJMhHaL3eP3KL+paV8RfOGAcA YlwUxLcDqvl+3U4mWh3NNAu5GWoxNoagF5XNzgOMewP+9SyYNUqMQjpSMW+PROa9G7H0 cfOQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gf1/oT3J"; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id f5-20020a05622a104500b0042a35dafb39si4185444qte.227.2024.01.22.05.46.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 05:46:56 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gf1/oT3J"; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 255EA3858401 for ; Mon, 22 Jan 2024 13:46:56 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id B13C23858414 for ; Mon, 22 Jan 2024 13:45:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B13C23858414 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B13C23858414 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::633 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705931129; cv=none; b=E7OhQVhljIrMW9Ipcqv0qKTzN5eEaoV+KOXjN+S8KWBdIGTLvNHaqecRMWxYmgK9EHteESEjgYofkzU+tKI6QnpoJSAF8gnyJZVCGvoaM5b4VWTfSv42uKQcp4FkDt7Rclgez5Fdlm+VIuje+AMQmU68aMIrh4ES7B4UROKFvv0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705931129; c=relaxed/simple; bh=lJ11lvOUyPeh4fm2Bd4bPuBz/3w6B6Hbfhu7GhEeUmI=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=E8g5VxWNhRaD+whoJf+TGvUpiw/Hd4ur0Pz8xvfRLuJDszi0jKTUikR/rHsODMN5visXda84As3PM+zBq2+E0/SvHeR8PdP0qYBejS34hrZ/2NFeAMuoj7uKLAqBGMCcv8fPIOD+uZ++Vj181hIf6F+VKSD7PkLb3l2Pto5ADMg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1d72f71f222so4454455ad.1 for ; Mon, 22 Jan 2024 05:45:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705931125; x=1706535925; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jHLV73m/J8q9tzn097Vq0HV+K6GsNYFiXHqcnA8w2LU=; b=gf1/oT3Japqn/rsc3SiuMcF7yjG1LrIo/NvTwwkthNdVGjVBYztYWxFHCqe2uIH1dg qSQMnDVZOgrzVECyf30ez2MTyJC+mXI3gZqypvHQUhBTn2BzbWBVsPF3XO+u0oC/m0r5 cDPzf7p/MgR8KH7s1Y/3qyBAW4JeG2/SdjqIweQ9k357EGPDLb6PkVGp2hRPU+4oOHhB IvhwXv7cmwzfkO4dhH+Y8pfX9Q3JfdN3u/ncXF553tI6heRKOzU3cFxmFf0UOhuaKqR2 t+er/2fmWshbyY0X0kg6CQbyTMA5uFOKmLpT6CBoxDHDRK0yeoKPO0J+iRX5vlCvHIeh OagA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705931125; x=1706535925; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jHLV73m/J8q9tzn097Vq0HV+K6GsNYFiXHqcnA8w2LU=; b=XUKERaA+0zB+F8qVzpCPAjCzvekF2g7BibDvCClgLjiRV5gLZ164dRXTwapXntKAHa QwWcsM+7mBCs2/8cBQRJfGHqOOWyUzqINxYotrVQkZbJNukYJog3VSLzm69NG7r9Ns/d lL+wMpC35r2g/wWle4LxFqyPsjAl+G8fq2EXrPzI2kk/MFRGGqdODvJyWyi9IfhqyMex my1HJEbceRtMKb1YMdOaGa1aumA8aoWMAvWBpapnDUXgrZ1hc4C5OHA5O1hYcv4jfCd/ uxaHrI5hVnMsGYe0yKjG/AOePzje56JeinKUeH4tH746kMWg9VityrF260+FoKJXU2qd ijYQ== X-Gm-Message-State: AOJu0YzR8OsS5Iaq63fMWlpiJMM+Mq1C3hrfbc4Xpufw20smt8zKjpHW BUdYKnB401UgVkK2RtmmRO63hJG7CPlJsmDgS8bwpGgM/Ylu2QisBxJZ2ljLpPReg9TCumIyv/r 6 X-Received: by 2002:a17:903:18e:b0:1d7:39f5:b2d3 with SMTP id z14-20020a170903018e00b001d739f5b2d3mr1447252plg.105.1705931125116; Mon, 22 Jan 2024 05:45:25 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c2:c10c:2beb:76b0:76a:1960]) by smtp.gmail.com with ESMTPSA id e5-20020a170902b78500b001d71b2d6019sm5654474pls.51.2024.01.22.05.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 05:45:24 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Andreas Schwab , Florian Weimer Subject: [PATCH] string: Disable stack protector for memset in early static initialization Date: Mon, 22 Jan 2024 10:45:20 -0300 Message-Id: <20240122134520.3381928-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patch=linaro.org@sourceware.org For ports that use the default memset, the compiler might generic early calls before the stack protector is initialized (for instance, riscv with -fstack-protector-all on _dl_aux_init). Checked on riscv64-linux-gnu-rv64imafdc-lp64d. Reviewed-by: Florian Weimer --- string/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/string/Makefile b/string/Makefile index 3ba77e1b2f..8f31fa49e6 100644 --- a/string/Makefile +++ b/string/Makefile @@ -270,6 +270,7 @@ CFLAGS-memcpy.c += $(no-stack-protector) CFLAGS-wordcopy.c += $(no-stack-protector) # Called during static initialization CFLAGS-strncmp.c += $(no-stack-protector) +CFLAGS-memset.c += $(no-stack-protector) CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes) CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)