From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D2044384CBA9; Thu, 15 Feb 2024 13:18:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2044384CBA9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708003081; bh=DQKAB/F0fyO8uP1nZvyl1Kf8Ryl7QE9kI89gSxs1cMo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gEQV8YBzOqxSSHF7MSgnHM1Ec/d+S5lIXiNKp291hgIY00jMY7Yn1VAkPHu1m7P7L 9o1GnIznb7SmvXcEGt5ZxSzXcFVz064UoKVJ+GXlM9zrGxasZtFWelML4e4mEJw7nb ZPHDQCH1t5sG7dtYngaKyt6UOorsnEww0s1VkwWE= From: "siddhesh at sourceware dot org" To: glibc-bugs@sourceware.org Subject: [Bug libc/31383] _FORTIFY_SOURCE=3 and __fortified_attr_access vs size of 0 and zero size types Date: Thu, 15 Feb 2024 13:17:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: siddhesh at sourceware dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31383 --- Comment #1 from Siddhesh Poyarekar --- ``` When no size-index argument is specified, the pointer argument must be eith= er null or point to a space that is suitably aligned and large for __at least = one object__ of the referenced type (this implies that a past-the-end pointer is not a valid argument). ``` Well technically, the pointer argument *is* suitably aligned and large for = 16 objects of 0 size, but the implication that it is hence not a past-the-end pointer is invalid. I'll drop the access attribute (since the additional v= alue from having it is not really significant enough) but IMO -Wstringop-overflow needs to be fixed to handle pointers to zero-sized structs, i.e. it needs to ignore them and not conjure up an access size of 1 out of nowhere. --=20 You are receiving this mail because: You are on the CC list for the bug.=