From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7E5253858D33; Wed, 12 Apr 2023 09:04:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E5253858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681290277; bh=IyNYLAHz5MctsLEnQoeUSO1M3/vHDuAYff4OamNQvic=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gw/I9LFJu4//5nRfdzFsRvejYvviVxAQkkMrNFpFsStjW1VKwIwWwWVPnbswV/UWP hWTEJPgwrsgro6DsscxgaAhPRNRYLYFfZ9lQlX9MT1KACHQEAW0tVJ5wmoVg4JEEzt qMRGuUoLjCZAOI2bEe3cFM5lH1rKxL4+KEy9T6Do= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/109446] Possible destination array overflow without diagnosis in memcpy Date: Wed, 12 Apr 2023 09:04:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 8.4.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109446 --- Comment #10 from Andrew Pinski --- (In reply to Richard Biener from comment #8) > (In reply to Jakub Jelinek from comment #7) > > (In reply to Richard Biener from comment #6) > > > not sure if we should prevent all of those transforms. But the quest= ion is > > > why ASAN doesn't instrument the generated aggregate copy? Maybe beca= use > > > in C/C++ you cannot write an aggregate array copy? > >=20 > > We do instrument those. But only instrument them by checking the first= and > > last byte > > of the copy, not all bytes in between (because that would be for inline > > checking too large - we'd need to emit inline a loop over those bytes). >=20 > OK, that's lack of an appropriate API then? But still the first and last > byte should be sufficient to detect the problem (but maybe I'm missing > something here). Maybe it just happens the end to be on the stack of the inner most function= so it just happens that it is an variable address still.=