From: Kees Cook <keescook@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: Kees Cook <keescook@chromium.org>, linux-hardening@vger.kernel.org
Subject: [PATCH] samples/seccomp: Avoid alias warning
Date: Fri, 10 Sep 2021 15:34:09 -0700 [thread overview]
Message-ID: <20210910223409.3225001-1-keescook@chromium.org> (raw)
Under GCC 4.9, fix the warning due to missing -fno-strict-aliasing:
samples/seccomp/user-trap.c:50:2: warning: dereferencing type-punned pointer will break strict-alias
ing rules [-Wstrict-aliasing]
samples/seccomp/user-trap.c:83:2: warning: dereferencing type-punned pointer will break strict-alias
ing rules [-Wstrict-aliasing]
Signed-off-by: Kees Cook <keescook@chromium.org>
---
samples/seccomp/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile
index c85ae0ed8342..a3a3ef20a8fc 100644
--- a/samples/seccomp/Makefile
+++ b/samples/seccomp/Makefile
@@ -3,4 +3,4 @@ userprogs-always-y += bpf-fancy dropper bpf-direct user-trap
bpf-fancy-objs := bpf-fancy.o bpf-helper.o
-userccflags += -I usr/include
+userccflags += -I usr/include -fno-strict-aliasing
--
2.30.2
reply other threads:[~2021-09-10 22:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210910223409.3225001-1-keescook@chromium.org \
--to=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).