From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 6BF6E3858D37; Wed, 17 Apr 2024 20:04:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6BF6E3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713384256; bh=Yi6hvStbbUGRpkwkYYUW1q2Bq64TauQ0nmItXmFZfd4=; h=From:To:Subject:Date:From; b=nDHw5wQAyGPG0Y570DUkV68HzYiDQK6xIAhENasRZLgr6rKnXVCnZ4AgQYCvQGAwB EDcASNupF4RBxtXa/dCdZlb3nge+sZIQKcH15AO+lo8qxQLRtb0JBjpsrA3TqOkWLh R3Qu0JgCc8DDmKxh1AhamnTdCxGtpxdbVQaPHL6k= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] stdlib: Improve fortify with clang X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 0e53e7cdf50b92f007eff86a02252d9549d8ef2c X-Git-Newrev: d7101bde415a3b664fbcf012c3bbcecc6ab8b285 Message-Id: <20240417200416.6BF6E3858D37@sourceware.org> Date: Wed, 17 Apr 2024 20:04:16 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d7101bde415a3b664fbcf012c3bbcecc6ab8b285 commit d7101bde415a3b664fbcf012c3bbcecc6ab8b285 Author: Adhemerval Zanella Date: Tue Dec 5 10:36:15 2023 -0300 stdlib: Improve fortify with clang It improve fortify checks for realpath, ptsname_r, wctomb, mbstowcs, and wcstombs. The runtime and compile checks have similar coverage as with GCC. Checked on aarch64, armhf, x86_64, and i686. Diff: --- stdlib/bits/stdlib.h | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/bits/stdlib.h b/stdlib/bits/stdlib.h index 1557b862b1..9e31801e80 100644 --- a/stdlib/bits/stdlib.h +++ b/stdlib/bits/stdlib.h @@ -135,6 +135,7 @@ __NTH (mbstowcs (__fortify_clang_overload_arg (wchar_t *, __restrict, __dst), { if (__builtin_constant_p (__dst == NULL) && __dst == NULL) return __mbstowcs_nulldst (__dst, __src, __len); + else return __glibc_fortify_n (mbstowcs, __len, sizeof (wchar_t), __glibc_objsize (__dst), __dst, __src, __len);