diff options
| author | Alexander Potapenko <glider@google.com> | 2017-07-19 20:27:30 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@google.com> | 2018-03-18 13:12:38 +0100 |
| commit | b6c49d2852dd45f78d13302d78a8a53ddc743ae1 (patch) | |
| tree | 50da34f97c82a496772f6ccb70a07069f1f029e1 /security/selinux/hooks.c | |
| parent | 230683f5daf63dbaa981739f54b6ddcaf84c0e3c (diff) | |
llist: clang: introduce member_address_is_nonnull()
Currently llist_for_each_entry() and llist_for_each_entry_safe() iterate
until &pos->member != NULL. But when building the kernel with Clang,
the compiler assumes &pos->member cannot be NULL if the member's offset
is greater than 0 (which would be equivalent to the object being
non-contiguous in memory). Therefore the loop condition is always true,
and the loops become infinite.
To work around this, introduce the member_address_is_nonnull() macro,
which casts object pointer to uintptr_t, thus letting the member pointer
to be NULL.
Signed-off-by: Alexander Potapenko <glider@google.com>
Tested-by: Sodagudi Prasad <psodagud@codeaurora.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit beaec533fc2701a28a4d667f67c9f59c6e4e0d13)
Reported-by: Jean-Baptiste Théou <jb@essential.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I90d5c5cfbbc6f847370f296975416a797dc067ee
Diffstat (limited to 'security/selinux/hooks.c')
0 files changed, 0 insertions, 0 deletions
