Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 28 Dec 2020 20:26:56 -0500
From: Rich Felker <dalias@...c.org>
To: Shiz <hi@...z.me>
Cc: musl@...ts.openwall.com, darkkirb@...kkirb.be
Subject: Re: [PATCH] Add support for LLVM's Control Flow Integrity (V2)

On Mon, Dec 28, 2020 at 06:01:45PM +0100, Shiz wrote:
> Hi,
> 
> It seems to me guarding all of those with #ifdef __clang__ is not the optimal approach.
> What if another compilers decides to pick up the spec, or an older non-CFI
> Clang is used to compile? I think it's more logical to check the no_sanitize attribute
> with a functional test (like __has_attribute), and to just apply the used attribute
> unconditionally.

Regardless none of these changes belong in source files.

Assuming it actually can be made to work to begin with, the nocfi
stuff should be done on a file-granularity basis with per-target
CFLAGS += ...

The "used" attributes are working around some other problem, either a
bug in clang (sounds most likely) or lack of semantic usedness in musl
source, and should be fixed wherever the bug is not papered over.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.