mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Clang: avoid undefined behavior in llist iterators
@ 2016-09-23 13:22 Alexander Potapenko
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Potapenko @ 2016-09-23 13:22 UTC (permalink / raw)
  To: dvyukov, kcc, akpm, edumazet, mingo; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-23 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-23 13:22 [PATCH 0/2] Clang: avoid undefined behavior in llist iterators Alexander Potapenko
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

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®