Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rbtree: use designated initializers

Prepare to mark sensitive kernel structures for randomization by making
sure they're using designated initializers. These were identified
during allyesconfig builds of x86, arm, and arm64, with most initializer
fixes extracted from grsecurity.

Link: http://lkml.kernel.org/r/20161217010253.GA140470@beast
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Jie Chen <fykcee1@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Kees Cook and committed by
Linus Torvalds
f231aebf 4f5901f5

+6 -2
+3 -1
include/linux/rbtree_augmented.h
··· 90 90 old->rbaugmented = rbcompute(old); \ 91 91 } \ 92 92 rbstatic const struct rb_augment_callbacks rbname = { \ 93 - rbname ## _propagate, rbname ## _copy, rbname ## _rotate \ 93 + .propagate = rbname ## _propagate, \ 94 + .copy = rbname ## _copy, \ 95 + .rotate = rbname ## _rotate \ 94 96 }; 95 97 96 98
+3 -1
lib/rbtree.c
··· 427 427 static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {} 428 428 429 429 static const struct rb_augment_callbacks dummy_callbacks = { 430 - dummy_propagate, dummy_copy, dummy_rotate 430 + .propagate = dummy_propagate, 431 + .copy = dummy_copy, 432 + .rotate = dummy_rotate 431 433 }; 432 434 433 435 void rb_insert_color(struct rb_node *node, struct rb_root *root)