From: Alexander Potapenko <glider@google.com>
To: dvyukov@google.com, kcc@google.com, akpm@linux-foundation.org,
edumazet@google.com, mingo@elte.hu
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] Clang: avoid undefined behavior in llist iterators
Date: Fri, 23 Sep 2016 15:22:56 +0200 [thread overview]
Message-ID: <1474636978-41435-1-git-send-email-glider@google.com> (raw)
This patch set fixes problems with pointer arithmetics overflow in
llist iterators, llist_for_each_entry() and llist_for_each_entry_safe().
Clang turns those macros into infinite loops, because they're operating
with "negative" pointers.
As a follow-up it may make sense to convert other uses of llist_entry()
to llist_entry_safe(), or even replace uses of container_of() with
container_of_safe().
Alexander Potapenko (2):
include/linux: provide a safe version of container_of()
llist: introduce llist_entry_safe()
include/linux/kernel.h | 15 +++++++++++++++
include/linux/llist.h | 26 +++++++++++++++++++-------
2 files changed, 34 insertions(+), 7 deletions(-)
--
2.8.0.rc3.226.g39d4020
next reply other threads:[~2016-09-23 13:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 13:22 Alexander Potapenko [this message]
2016-09-23 13:22 ` [PATCH 1/2] include/linux: provide a safe version of container_of() Alexander Potapenko
2016-09-23 13:22 ` [PATCH 2/2] llist: introduce llist_entry_safe() Alexander Potapenko
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=1474636978-41435-1-git-send-email-glider@google.com \
--to=glider@google.com \
--cc=akpm@linux-foundation.org \
--cc=dvyukov@google.com \
--cc=edumazet@google.com \
--cc=kcc@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
all inboxes | Powered by JetHome®