Message ID | 20250425205618.360232-2-adhemerval.zanella@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp4160197wrs; Fri, 25 Apr 2025 14:02:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV915ZfHS+w+bLRgfRK1bOcITEi44pFY29v/kG76izXA+yNOHqLfPKwO5r3MRrSstm3gqA35Q==@linaro.org X-Google-Smtp-Source: AGHT+IGjvyN1khQVmRI4t05CgdETay+z48k+DebeThs8qm/mWlB+sv+A3dZVk+L3hoOuXqd/558j X-Received: by 2002:a05:6808:4493:b0:3f6:a9ea:eab0 with SMTP id 5614622812f47-401fd6ec530mr538964b6e.6.1745614937836; Fri, 25 Apr 2025 14:02:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1745614937; cv=pass; d=google.com; s=arc-20240605; b=c4637PUBfqV9eN10QifKKGyBMCe7OD98/vpKMXwbYj1iLU+nmZzyMc+NwHb3ufaavT N66ZvtvwcXxNM5Rojhwgv+LUASqukLTVIltl9qHQPxtuk5NubRdJ+lZLIj31qToRe5lE seNR4aw8jmOPPrQR5zyEWJtsglN9+THn5FyjfqrFnKTHZIqlA4w5G/Ii33yKn91qN+Br sDIard2aReu6vn7RTur2q5mx+HMe05l/oW/Leez0RpAkx2gLwc9nVcL8Ky2gVX8SlKhc IyvC8Pcszfb4g4E21VRrb4zNIGGu6ow9LF/J9Wf2U2di79qMvcIBU2ZLsB8/UnjTzVBa aCdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter:arc-filter:dmarc-filter :delivered-to:dkim-filter; bh=MSn2BWcS5xNZf3Lz/yyDyW+CTC/jPegyIGo7yub9MWE=; fh=G1NI73xfDcVophzg1+e/pmkwSVc7WWCXN7V/bl5G28k=; b=O1QYkRCVkQgpoOzV28TsG/372kKJEdOkPLcfXi8l/APf2isDYATn7oHCe+aU0UbvoG +GK8DmwQbgQp9u1CVJOWqkAmPZWXHP61p2YL8RZNl6KtgyhfsFgNAU+yHOyGTdlFI21W jn3UmIe2oGB/G/nT1qJf5PpvDlsFxcgjxXkoPn+Dc/3Abt6Rj4UASo6ndq9BKbz/DG6b tWx2ZA2vJFjFNz2+j8MgfP+Qz8T6tw6/pFkIYnSsVtg8rr84Jb8pqvteUAMDlDpGtHF3 w5gea3b6UzyTgfGhAI2aBI/mIelli42nqY7q0HXPvp/5RnfUFJcbRmXSWiIuPfp3BF/C xtwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qicIxw1E; 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: <libc-alpha-bounces~patch=linaro.org@sourceware.org> Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ada2fe7eead31-4d3d6bfcfedsi1229050137.269.2025.04.25.14.02.17 for <patch@linaro.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Apr 2025 14:02:17 -0700 (PDT) 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=qicIxw1E; 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 590C03858D3C for <patch@linaro.org>; Fri, 25 Apr 2025 21:02:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 590C03858D3C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=qicIxw1E X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id 7948E3858D20 for <libc-alpha@sourceware.org>; Fri, 25 Apr 2025 20:56:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7948E3858D20 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 7948E3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::530 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1745614585; cv=none; b=wcg5Dp8bVFX8clb8pWOvuIlY+dnKJVhBHxgmg9zF5UNacypIuvbDlcHs0Nw55ONgTtHjHatbpEz9qvCnmEvnk5B0iSPpDEPIcp7sDCv8oqM+phq8ZfOURLBxkwLqZ57CpH5sTO4cN81HKigQXB6wEXDLkzlqqX/hCUYoWeMOVr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1745614585; c=relaxed/simple; bh=qNHr5sSyUeNkn33kqd91JVDzD+fbrMhYg0SAoWAVRMA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=c/I9jUSjQXFYdugoewYt50FI3JL3ugKcbMBIcNijr4IJvfjjRjShxAUObzEdT5dlgpLYku92pV4nU/O8B8gOjTrCpx1Ql5MZMmBEKKuv6MMENgiqkjYhd+x07uiqMjoppS+MycSwKG3Pj6gZKDkfYx9RqKVY/5SJCqHpY3aWKvk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7948E3858D20 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-b13e0471a2dso2073041a12.2 for <libc-alpha@sourceware.org>; Fri, 25 Apr 2025 13:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745614584; x=1746219384; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MSn2BWcS5xNZf3Lz/yyDyW+CTC/jPegyIGo7yub9MWE=; b=qicIxw1EBvcvguKM1xVSmHWQuzT4NrrlKtcs78TS6rPUr/wXKHj+ZXtZgl05tosfEM uhCm8pB//6uiPLVxtsPK3u1bMbjkaNO0U28Fc+FykYkANNtgHRaq/hv65AroNVi9hU9T Pd5VgMarkb1LyY8Nlxygg7iPlP+0mut1ZlMO3lHknUs+1fmnfPkLSHM0vJd1guZ56Y4H isMtu/7KIV7FhH7ePSWXL1zQJ129FVX67Y9zPr4jMBc40rzoUPcCdAIffEKRG54xkwsl 1Y762piuCWD2Ul5bRagpDEf+i342Wd8M92ZVI6fpVGRmZImQhuNwdIYlYJ4Q8b7izRvn KxwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745614584; x=1746219384; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MSn2BWcS5xNZf3Lz/yyDyW+CTC/jPegyIGo7yub9MWE=; b=b7oUk8t8IdDdp7aygBlwddU0FCb12EKnPhJR+zYk4F0HF6wx1z1Ljv+ro51ejnPcQz YM/Fr0uCJ7Hho3rLNvODzfITx2VubJLCSorWWViL7sBrnNVDG2nWdUXsCot+2yJ+q5Zc FC9tgsMxWtLnPRmVspegTbofGgLw2Tl8n4ESXxlV0mrN8uCJAWuP46z18VDEnF8DnM5+ olZxIGBkJJSaBIHIOtEHQtXiF+57tuMXAjIddabviTbhG/frr/AYu9bO60qK7+NT0E9s KfXwtKqImtj7WtkrSPkAv0SKK95it8sIBfoie8FsUKWGra85V2sqXyZaRJ8r2Dm7rfgn zKAA== X-Gm-Message-State: AOJu0YxD7U89VR4jsWRLCr3usGDeFKeUm9iCM0ZzccHgcKno+aTOPuBb kblgT6CJ1sbek0y/JQaV+I+eOF62KDU8UYR/k/76KHBjqKZDHNz4rfL9g74big55/UjJlbeDKCU + X-Gm-Gg: ASbGncuvwRqk2G2jl4U1cen4Q4dDQra6WBF7WWTOEGW6BLU4VgOpmYiozyA2XJkNnmz TGW9dZlwgXGsyG4U8EKvY62Lqz6kwORG2q27o+paegm209RxjTlNzr1VfgZGoloUf8dI+nRuzrQ a4GMavKSgpoLB0wsE8RR0XBJWiw3Tw0yhxeD1/GPHijai1wmH38wnmlHiTtsxvMKgjQenGSvikZ KePRs7lj4KEkIsnGatL+HAKndl/gMKTXRa/R29Yu9RAiznsxKmUEHwfcrsxtcgxh+xqXVu6utoD L6BBYN4JsXqf8Mc/NW/I0u4Gr2F0OsIozfpI37k6LYn1Z6NzHcuCug== X-Received: by 2002:a17:90b:2f0f:b0:2eb:140d:f6df with SMTP id 98e67ed59e1d1-30a012ed038mr1373373a91.1.1745614584089; Fri, 25 Apr 2025 13:56:24 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:9bf1:37fb:44e3:5707:516b]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-309f782d47bsm2357188a91.37.2025.04.25.13.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Apr 2025 13:56:23 -0700 (PDT) From: Adhemerval Zanella <adhemerval.zanella@linaro.org> To: libc-alpha@sourceware.org Cc: Paul Zimmermann <Paul.Zimmermann@inria.fr> Subject: [PATCH 1/8] math: Fix UB on atanhf Date: Fri, 25 Apr 2025 17:54:22 -0300 Message-ID: <20250425205618.360232-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250425205618.360232-1-adhemerval.zanella@linaro.org> References: <20250425205618.360232-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Errors-To: libc-alpha-bounces~patch=linaro.org@sourceware.org |
Series | Fix UB in math implementations | expand |
diff --git a/sysdeps/ieee754/flt-32/e_atanhf.c b/sysdeps/ieee754/flt-32/e_atanhf.c index 5138408324..eeb1aae6a1 100644 --- a/sysdeps/ieee754/flt-32/e_atanhf.c +++ b/sysdeps/ieee754/flt-32/e_atanhf.c @@ -3,7 +3,7 @@ Copyright (c) 2023-2024 Alexei Sibidanov. The original version of this file was copied from the CORE-MATH -project (file src/binary32/acosh/acoshf.c, revision bc385c2). +project (file src/binary32/acosh/acoshf.c, revision 4d6192d2). Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -135,7 +135,7 @@ __ieee754_atanhf (float x) } double sgn = s[ux >> 31]; unsigned int e = ax >> 24; - unsigned int md = ((ux << 8) | 1 << 31) >> (126 - e); + unsigned int md = ((ux << 8) | 1U << 31) >> (126 - e); unsigned int mn = -md; int nz = __builtin_clz (mn) + 1; mn <<= nz;