All of lore.kernel.org
 help / color / mirror / Atom feed
* [kernel-hardening] [RFC 0/3] Add struct randomization plugin
@ 2016-05-05 17:21 Michael Leibowitz
  2016-05-05 17:21 ` [kernel-hardening] [RFC 1/3] Add struct randomizing plugin Michael Leibowitz
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Michael Leibowitz @ 2016-05-05 17:21 UTC (permalink / raw)
  To: spender, kernel-hardening, keescook, re.emese, pageexec; +Cc: michael.leibowitz

This patch set ports over grsecurity's structure randomization
feature.  The plugin is largely unchanged from grsecurity, with some
porting to go over Emese Revfy's v7 patch set for gcc plugin
infrastructure.  This is an RFC.

Although this set of changes does not directly make exploitation
harder, when a number of structures are randomized, it will make it
difficult to splat many relevant structures without knowing the exact
build of the kernel the target is using.  While for one structure,
there are limited number of guesses required, in aggregate, this can
be a large obstacle for exploitation.

Patch 3 is a grab bag that probably needs to be broken up, although
I'm not sure of the best way to do so.  Breaking by subsystem would
seem to make an unwieldy patch set.

Known TODO that is not addressed as part of this patch set:
  * tag security relevant structures for randomization
  * add checkpatch checking for non-C99 initialization
  * automated testing of randomization
  * better description and examples of exploits effectively mitigated
    by this feature

Tagging of structures to be randomized will come in subsequent series
of patches.

--

 arch/Kconfig                                    |  35 +
 arch/x86/include/asm/floppy.h                   |  20 +-
 arch/x86/include/asm/paravirt_types.h           |  18 +-
 drivers/acpi/acpica/hwxfsleep.c                 |  11 +-
 drivers/block/cciss.h                           |  30 +-
 drivers/gpu/drm/nouveau/nouveau_ttm.c           |  28 +-
 drivers/gpu/drm/ttm/ttm_bo_manager.c            |  10 +-
 drivers/gpu/drm/virtio/virtgpu_ttm.c            |  10 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   |  10 +-
 drivers/infiniband/hw/nes/nes_cm.c              |  22 +-
 drivers/isdn/gigaset/bas-gigaset.c              |  32 +-
 drivers/isdn/gigaset/ser-gigaset.c              |  32 +-
 drivers/isdn/gigaset/usb-gigaset.c              |  32 +-
 drivers/isdn/i4l/isdn_concap.c                  |   6 +-
 drivers/isdn/i4l/isdn_x25iface.c                |  16 +-
 drivers/media/pci/solo6x10/solo6x10-g723.c      |   2 +-
 drivers/net/ethernet/brocade/bna/bna_enet.c     |   8 +-
 drivers/net/wan/lmc/lmc_media.c                 |  97 +--
 drivers/scsi/bfa/bfa_fcs.c                      |  19 +-
 drivers/scsi/bfa/bfa_fcs_lport.c                |  29 +-
 drivers/scsi/bfa/bfa_modules.h                  |  12 +-
 drivers/scsi/hpsa.h                             |  40 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |   2 +-
 drivers/staging/lustre/lustre/libcfs/module.c   |  10 +-
 drivers/video/fbdev/matrox/matroxfb_DAC1064.c   |  10 +-
 drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |   5 +-
 fs/reiserfs/item_ops.c                          |  24 +-
 include/linux/compiler-gcc.h                    |   5 +
 include/linux/compiler.h                        |   9 +
 include/linux/rbtree_augmented.h                |   4 +-
 include/linux/vermagic.h                        |   9 +-
 kernel/module.c                                 |  27 +
 lib/rbtree.c                                    |   4 +-
 mm/page_alloc.c                                 |   2 +-
 net/atm/lec.c                                   |   6 +-
 net/atm/mpoa_caches.c                           |  41 +-
 net/vmw_vsock/vmci_transport_notify.c           |  30 +-
 net/vmw_vsock/vmci_transport_notify_qstate.c    |  30 +-
 scripts/Makefile.gcc-plugins                    |  11 +-
 scripts/gcc-plugins/.gitignore                  |   1 +
 scripts/gcc-plugins/Makefile                    |  12 +
 scripts/gcc-plugins/gen-random-seed.sh          |   8 +
 scripts/gcc-plugins/randomize_layout_plugin.c   | 935 ++++++++++++++++++++++++
 sound/synth/emux/emux_seq.c                     |  14 +-
 44 files changed, 1402 insertions(+), 316 deletions(-)

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

* [kernel-hardening] [RFC 1/3] Add struct randomizing plugin
  2016-05-05 17:21 [kernel-hardening] [RFC 0/3] Add struct randomization plugin Michael Leibowitz
@ 2016-05-05 17:21 ` Michael Leibowitz
  2016-05-05 21:00   ` [kernel-hardening] " Brad Spengler
  2016-05-05 17:21 ` [kernel-hardening] [RFC 2/3] Enable the RANDSTRUCT plugin Michael Leibowitz
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Michael Leibowitz @ 2016-05-05 17:21 UTC (permalink / raw)
  To: spender, kernel-hardening, keescook, re.emese, pageexec; +Cc: michael.leibowitz

This plugin randomizes the layout of certain structures at compile
time.  This introduces two defines __randomize_layout and
__no_randomize_layout.  Which, turn, tell the compiler to either try
to randomize or not to randomize the struct in question.  This also
requires struct initalization to use the C99 designated initalizer
form.

This feature is ported over from grsecurity.  This is largely
unchanged from the Original code written by the PaX Team and Spender.

Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
---
 scripts/Makefile.gcc-plugins                  |  11 +-
 scripts/gcc-plugins/.gitignore                |   2 +
 scripts/gcc-plugins/Makefile                  |  12 +
 scripts/gcc-plugins/gen-random-seed.sh        |   9 +
 scripts/gcc-plugins/randomize_layout_plugin.c | 935 ++++++++++++++++++++++++++
 5 files changed, 968 insertions(+), 1 deletion(-)
 create mode 100644 scripts/gcc-plugins/.gitignore
 create mode 100644 scripts/gcc-plugins/gen-random-seed.sh
 create mode 100644 scripts/gcc-plugins/randomize_layout_plugin.c

diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins
index 33ab13e..9438516 100644
--- a/scripts/Makefile.gcc-plugins
+++ b/scripts/Makefile.gcc-plugins
@@ -19,7 +19,16 @@ ifdef CONFIG_GCC_PLUGINS
     endif
   endif
 
-  GCC_PLUGINS_CFLAGS := $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y))
+
+  gcc-plugin-$(CONFIG_GCC_PLUGIN_RANDSTRUCT)            += randomize_layout_plugin.so
+  ifdef CONFIG_GCC_PLUGIN_RANDSTRUCT
+    RANDSTRUCT_PLUGIN_CFLAGS := -DRANDSTRUCT_PLUGIN
+    ifdef CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE
+      RANDSTRUCT_PLUGIN_CFLAGS += -fplugin-arg-randomize_layout_plugin-performance-mode
+    endif
+  endif
+
+  GCC_PLUGINS_CFLAGS := $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y)) $(RANDSTRUCT_PLUGIN_CFLAGS)
 
   ifeq ($(PLUGINCC),)
     ifneq ($(GCC_PLUGINS_CFLAGS),)
diff --git a/scripts/gcc-plugins/.gitignore b/scripts/gcc-plugins/.gitignore
new file mode 100644
index 0000000..be289ad
--- /dev/null
+++ b/scripts/gcc-plugins/.gitignore
@@ -0,0 +1,2 @@
+# Copyright (c) 2016, Intel Corporation.
+randomize_layout_seed.h
diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile
index 79164c1..2941ec3 100644
--- a/scripts/gcc-plugins/Makefile
+++ b/scripts/gcc-plugins/Makefile
@@ -17,8 +17,20 @@ $(HOSTLIBS)-$(CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) := cyc_complexity_plugin.so
 ifeq ($(CFLAGS_KCOV), -fplugin=$(objtree)/scripts/gcc-plugins/sancov_plugin.so)
   $(HOSTLIBS)-$(CONFIG_GCC_PLUGIN_SANCOV) += sancov_plugin.so
 endif
+$(HOSTLIBS)-$(CONFIG_GCC_PLUGIN_RANDSTRUCT) += randomize_layout_plugin.so
 
 always := $($(HOSTLIBS)-y)
 
 cyc_complexity_plugin-objs := cyc_complexity_plugin.o
 sancov_plugin-objs := sancov_plugin.o
+randomize_layout_plugin-objs := randomize_layout_plugin.o
+
+$(obj)/randomize_layout_plugin.o: $(objtree)/$(obj)/randomize_layout_seed.h
+
+quiet_cmd_create_randomize_layout_seed = GENSEED  $@
+      cmd_create_randomize_layout_seed = \
+	$(CONFIG_SHELL) $(srctree)/$(src)/gen-random-seed.sh $@ $(objtree)/include/generated/randomize_layout_hash.h
+$(objtree)/$(obj)/randomize_layout_seed.h: FORCE
+	$(call if_changed,create_randomize_layout_seed)
+
+targets += randomize_layout_seed.h randomize_layout_hash.h
diff --git a/scripts/gcc-plugins/gen-random-seed.sh b/scripts/gcc-plugins/gen-random-seed.sh
new file mode 100644
index 0000000..fdab8df
--- /dev/null
+++ b/scripts/gcc-plugins/gen-random-seed.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Copyright (c) 2016, Intel Corporation.
+
+if [ ! -f "$1" ]; then
+	SEED=`od -A n -t x8 -N 32 /dev/urandom | tr -d ' \n'`
+	echo "const char *randstruct_seed = \"$SEED\";" > "$1"
+	HASH=`echo -n "$SEED" | sha256sum | cut -d" " -f1 | tr -d ' \n'`
+	echo "#define RANDSTRUCT_HASHED_SEED \"$HASH\"" > "$2"
+fi
diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c
new file mode 100644
index 0000000..757ab6e
--- /dev/null
+++ b/scripts/gcc-plugins/randomize_layout_plugin.c
@@ -0,0 +1,935 @@
+/*
+ * Copyright (c) 2016, Intel Corporation.
+ *
+ * Copyright 2014,2015 by Open Source Security, Inc., Brad Spengler <spender@grsecurity.net>
+ *                   and PaX Team <pageexec@freemail.hu>
+ * Licensed under the GPL v2
+ *
+ * This code owes much to the PAX constify plugin
+ *
+ * Usage:
+ * $ # for 4.5/4.6/C based 4.7
+ * $ gcc -I`gcc -print-file-name=plugin`/include -I`gcc -print-file-name=plugin`/include/c-family -fPIC -shared -O2 -o randomize_layout_plugin.so randomize_layout_plugin.c
+ * $ # for C++ based 4.7/4.8+
+ * $ g++ -I`g++ -print-file-name=plugin`/include -I`g++ -print-file-name=plugin`/include/c-family -fPIC -shared -O2 -o randomize_layout_plugin.so randomize_layout_plugin.c
+ * $ gcc -fplugin=./randomize_layout_plugin.so test.c -O2
+ */
+
+#include "gcc-common.h"
+#include "randomize_layout_seed.h"
+
+#if BUILDING_GCC_MAJOR < 4 || (BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR < 6) || \
+   (BUILDING_GCC_MAJOR == 4 && BUILDING_GCC_MINOR == 6 && BUILDING_GCC_PATCHLEVEL < 4)
+#error "The RANDSTRUCT plugin requires GCC 4.6.4 or newer."
+#endif
+
+#define ORIG_TYPE_NAME(node) \
+	(TYPE_NAME(TYPE_MAIN_VARIANT(node)) != NULL_TREE ? \
+		((const unsigned char *)IDENTIFIER_POINTER(TYPE_NAME(TYPE_MAIN_VARIANT(node)))) : \
+		(const unsigned char *)"anonymous")
+
+int plugin_is_GPL_compatible;
+
+static int performance_mode;
+
+static struct plugin_info randomize_layout_plugin_info = {
+	.version	= "201402201816",
+	.help		= "disable\t\t\tdo not activate plugin\n"
+			  "performance-mode\tenable cacheline-aware layout randomization\n"
+};
+
+/* from old Linux dcache.h */
+static inline unsigned long
+partial_name_hash(unsigned long c, unsigned long prevhash)
+{
+	return (prevhash + (c << 4) + (c >> 4)) * 11;
+}
+static inline unsigned int
+name_hash(const unsigned char *name)
+{
+	unsigned long hash = 0;
+	unsigned int len = strlen((const char *)name);
+	while (len--)
+		hash = partial_name_hash(*name++, hash);
+	return (unsigned int)hash;
+}
+
+static tree handle_randomize_layout_attr(tree *node, tree name, tree args, int flags, bool *no_add_attrs)
+{
+	tree type;
+
+	*no_add_attrs = true;
+	if (TREE_CODE(*node) == FUNCTION_DECL) {
+		error("%qE attribute does not apply to functions (%qF)", name, *node);
+		return NULL_TREE;
+	}
+
+	if (TREE_CODE(*node) == PARM_DECL) {
+		error("%qE attribute does not apply to function parameters (%qD)", name, *node);
+		return NULL_TREE;
+	}
+
+	if (TREE_CODE(*node) == VAR_DECL) {
+		error("%qE attribute does not apply to variables (%qD)", name, *node);
+		return NULL_TREE;
+	}
+
+	if (TYPE_P(*node)) {
+		type = *node;
+	} else {
+		gcc_assert(TREE_CODE(*node) == TYPE_DECL);
+		type = TREE_TYPE(*node);
+	}
+
+	if (TREE_CODE(type) != RECORD_TYPE) {
+		error("%qE attribute used on %qT applies to struct types only", name, type);
+		return NULL_TREE;
+	}
+
+	if (lookup_attribute(IDENTIFIER_POINTER(name), TYPE_ATTRIBUTES(type))) {
+		error("%qE attribute is already applied to the type %qT", name, type);
+		return NULL_TREE;
+	}
+
+	*no_add_attrs = false;
+
+	return NULL_TREE;
+}
+
+/* set on complete types that we don't need to inspect further at all */
+static tree handle_randomize_considered_attr(tree *node, tree name, tree args, int flags, bool *no_add_attrs)
+{
+	*no_add_attrs = false;
+	return NULL_TREE;
+}
+
+/*
+ * set on types that we've performed a shuffle on, to prevent re-shuffling
+ * this does not preclude us from inspecting its fields for potential shuffles
+ */
+static tree handle_randomize_performed_attr(tree *node, tree name, tree args, int flags, bool *no_add_attrs)
+{
+	*no_add_attrs = false;
+	return NULL_TREE;
+}
+
+/*
+ * 64bit variant of Bob Jenkins' public domain PRNG
+ * 256 bits of internal state
+ */
+
+typedef unsigned long long u64;
+
+typedef struct ranctx { u64 a; u64 b; u64 c; u64 d; } ranctx;
+
+#define rot(x,k) (((x)<<(k))|((x)>>(64-(k))))
+static u64 ranval(ranctx *x) {
+	u64 e = x->a - rot(x->b, 7);
+	x->a = x->b ^ rot(x->c, 13);
+	x->b = x->c + rot(x->d, 37);
+	x->c = x->d + e;
+	x->d = e + x->a;
+	return x->d;
+}
+
+static void raninit(ranctx *x, u64 *seed) {
+	int i;
+
+	x->a = seed[0];
+	x->b = seed[1];
+	x->c = seed[2];
+	x->d = seed[3];
+
+	for (i=0; i < 30; ++i)
+		(void)ranval(x);
+}
+
+static u64 shuffle_seed[4];
+
+struct partition_group {
+	tree tree_start;
+	unsigned long start;
+	unsigned long length;
+};
+
+static void partition_struct(tree *fields, unsigned long length, struct partition_group *size_groups, unsigned long *num_groups)
+{
+	unsigned long i;
+	unsigned long accum_size = 0;
+	unsigned long accum_length = 0;
+	unsigned long group_idx = 0;
+
+	gcc_assert(length < INT_MAX);
+
+	memset(size_groups, 0, sizeof(struct partition_group) * length);
+
+	for (i = 0; i < length; i++) {
+		if (size_groups[group_idx].tree_start == NULL_TREE) {
+			size_groups[group_idx].tree_start = fields[i];
+			size_groups[group_idx].start = i;
+			accum_length = 0;
+			accum_size = 0;
+		}
+		accum_size += (unsigned long)int_size_in_bytes(TREE_TYPE(fields[i]));
+		accum_length++;
+		if (accum_size >= 64) {
+			size_groups[group_idx].length = accum_length;
+			accum_length = 0;
+			group_idx++;
+		}
+	}
+
+	if (size_groups[group_idx].tree_start != NULL_TREE &&
+		!size_groups[group_idx].length) {
+		size_groups[group_idx].length = accum_length;
+		group_idx++;
+	}
+
+	*num_groups = group_idx;
+}
+
+static void performance_shuffle(tree *newtree, unsigned long length, ranctx *prng_state)
+{
+	unsigned long i, x;
+	struct partition_group size_group[length];
+	unsigned long num_groups = 0;
+	unsigned long randnum;
+
+	partition_struct(newtree, length, (struct partition_group *)&size_group, &num_groups);
+	for (i = num_groups - 1; i > 0; i--) {
+		struct partition_group tmp;
+		randnum = ranval(prng_state) % (i + 1);
+		tmp = size_group[i];
+		size_group[i] = size_group[randnum];
+		size_group[randnum] = tmp;
+	}
+
+	for (x = 0; x < num_groups; x++) {
+		for (i = size_group[x].start + size_group[x].length - 1; i > size_group[x].start; i--) {
+			tree tmp;
+			if (DECL_BIT_FIELD_TYPE(newtree[i]))
+				continue;
+			randnum = ranval(prng_state) % (i + 1);
+			/* we could handle this case differently if desired */
+			if (DECL_BIT_FIELD_TYPE(newtree[randnum]))
+				continue;
+			tmp = newtree[i];
+			newtree[i] = newtree[randnum];
+			newtree[randnum] = tmp;
+		}
+	}
+}
+
+static void full_shuffle(tree *newtree, unsigned long length, ranctx *prng_state)
+{
+	unsigned long i, randnum;
+
+	for (i = length - 1; i > 0; i--) {
+		tree tmp;
+		randnum = ranval(prng_state) % (i + 1);
+		tmp = newtree[i];
+		newtree[i] = newtree[randnum];
+		newtree[randnum] = tmp;
+	}
+}
+
+/* modern in-place Fisher-Yates shuffle */
+static void shuffle(const_tree type, tree *newtree, unsigned long length)
+{
+	unsigned long i;
+	u64 seed[4];
+	ranctx prng_state;
+	const unsigned char *structname;
+
+	if (length == 0)
+		return;
+
+	gcc_assert(TREE_CODE(type) == RECORD_TYPE);
+
+	structname = ORIG_TYPE_NAME(type);
+
+#ifdef __DEBUG_PLUGIN
+	fprintf(stderr, "Shuffling struct %s %p\n", (const char *)structname, type);
+#ifdef __DEBUG_VERBOSE
+	debug_tree((tree)type);
+#endif
+#endif
+
+	for (i = 0; i < 4; i++) {
+		seed[i] = shuffle_seed[i];
+		seed[i] ^= name_hash(structname);
+	}
+
+	raninit(&prng_state, (u64 *)&seed);
+
+	if (performance_mode)
+		performance_shuffle(newtree, length, &prng_state);
+	else
+		full_shuffle(newtree, length, &prng_state);
+}
+
+static bool is_flexible_array(const_tree field)
+{
+	const_tree fieldtype;
+	const_tree typesize;
+	const_tree elemtype;
+	const_tree elemsize;
+
+	fieldtype = TREE_TYPE(field);
+	typesize = TYPE_SIZE(fieldtype);
+
+	if (TREE_CODE(fieldtype) != ARRAY_TYPE)
+		return false;
+
+	elemtype = TREE_TYPE(fieldtype);
+	elemsize = TYPE_SIZE(elemtype);
+
+	/* size of type is represented in bits */
+
+	if (typesize == NULL_TREE && TYPE_DOMAIN(fieldtype) != NULL_TREE &&
+	    TYPE_MAX_VALUE(TYPE_DOMAIN(fieldtype)) == NULL_TREE)
+		return true;
+
+	if (typesize != NULL_TREE &&
+	    (TREE_CONSTANT(typesize) && (!tree_to_uhwi(typesize) ||
+	     tree_to_uhwi(typesize) == tree_to_uhwi(elemsize))))
+		return true;
+
+	return false;
+}
+
+static int relayout_struct(tree type)
+{
+	unsigned long num_fields = (unsigned long)list_length(TYPE_FIELDS(type));
+	unsigned long shuffle_length = num_fields;
+	tree field;
+	tree newtree[num_fields];
+	unsigned long i;
+	tree list;
+	tree variant;
+	tree main_variant;
+	expanded_location xloc;
+	bool has_flexarray = false;
+
+	if (TYPE_FIELDS(type) == NULL_TREE)
+		return 0;
+
+	if (num_fields < 2)
+		return 0;
+
+	gcc_assert(TREE_CODE(type) == RECORD_TYPE);
+
+	gcc_assert(num_fields < INT_MAX);
+
+	if (lookup_attribute("randomize_performed", TYPE_ATTRIBUTES(type)) ||
+	    lookup_attribute("no_randomize_layout", TYPE_ATTRIBUTES(TYPE_MAIN_VARIANT(type))))
+		return 0;
+
+	/* Workaround for 3rd-party VirtualBox source that we can't modify ourselves */
+	if (!strcmp((const char *)ORIG_TYPE_NAME(type), "INTNETTRUNKFACTORY") ||
+	    !strcmp((const char *)ORIG_TYPE_NAME(type), "RAWPCIFACTORY"))
+		return 0;
+
+	/* throw out any structs in uapi */
+	xloc = expand_location(DECL_SOURCE_LOCATION(TYPE_FIELDS(type)));
+
+	if (strstr(xloc.file, "/uapi/"))
+		error(G_("attempted to randomize userland API struct %s"), ORIG_TYPE_NAME(type));
+
+	for (field = TYPE_FIELDS(type), i = 0; field; field = TREE_CHAIN(field), i++) {
+		gcc_assert(TREE_CODE(field) == FIELD_DECL);
+		newtree[i] = field;
+	}
+
+	/*
+	 * enforce that we don't randomize the layout of the last
+	 * element of a struct if it's a 0 or 1-length array
+	 * or a proper flexible array
+	 */
+	if (is_flexible_array(newtree[num_fields - 1])) {
+		has_flexarray = true;
+		shuffle_length--;
+	}
+
+	shuffle(type, (tree *)newtree, shuffle_length);
+
+	/*
+	 * set up a bogus anonymous struct field designed to error out on unnamed struct initializers
+	 * as gcc provides no other way to detect such code
+	 */
+	list = make_node(FIELD_DECL);
+	TREE_CHAIN(list) = newtree[0];
+	TREE_TYPE(list) = void_type_node;
+	DECL_SIZE(list) = bitsize_zero_node;
+	DECL_NONADDRESSABLE_P(list) = 1;
+	DECL_FIELD_BIT_OFFSET(list) = bitsize_zero_node;
+	DECL_SIZE_UNIT(list) = size_zero_node;
+	DECL_FIELD_OFFSET(list) = size_zero_node;
+	DECL_CONTEXT(list) = type;
+
+	for (i = 0; i < num_fields - 1; i++)
+		TREE_CHAIN(newtree[i]) = newtree[i+1];
+	TREE_CHAIN(newtree[num_fields - 1]) = NULL_TREE;
+
+	main_variant = TYPE_MAIN_VARIANT(type);
+	for (variant = main_variant; variant; variant = TYPE_NEXT_VARIANT(variant)) {
+		TYPE_FIELDS(variant) = list;
+		TYPE_ATTRIBUTES(variant) = copy_list(TYPE_ATTRIBUTES(variant));
+		TYPE_ATTRIBUTES(variant) = tree_cons(get_identifier("randomize_performed"), NULL_TREE, TYPE_ATTRIBUTES(variant));
+		if (has_flexarray)
+			TYPE_ATTRIBUTES(type) = tree_cons(get_identifier("has_flexarray"), NULL_TREE, TYPE_ATTRIBUTES(type));
+	}
+
+	/*
+	 * force a re-layout of the main variant
+	 * the TYPE_SIZE for all variants will be recomputed
+	 * by finalize_type_size()
+	 */
+	TYPE_SIZE(main_variant) = NULL_TREE;
+	layout_type(main_variant);
+	gcc_assert(TYPE_SIZE(main_variant) != NULL_TREE);
+
+	return 1;
+}
+
+static const_tree get_field_type(const_tree field)
+{
+	return strip_array_types(TREE_TYPE(field));
+}
+
+static bool is_fptr(const_tree fieldtype)
+{
+	if (TREE_CODE(fieldtype) != POINTER_TYPE)
+		return false;
+
+	return TREE_CODE(TREE_TYPE(fieldtype)) == FUNCTION_TYPE;
+}
+
+static int is_pure_ops_struct(const_tree node)
+{
+	const_tree field;
+
+	gcc_assert(TREE_CODE(node) == RECORD_TYPE || TREE_CODE(node) == UNION_TYPE);
+
+	for (field = TYPE_FIELDS(node); field; field = TREE_CHAIN(field)) {
+		const_tree fieldtype = get_field_type(field);
+		enum tree_code code = TREE_CODE(fieldtype);
+
+		if (node == fieldtype)
+			continue;
+
+		if (!is_fptr(fieldtype))
+			return 0;
+
+		if (code != RECORD_TYPE && code != UNION_TYPE)
+			continue;
+
+		if (!is_pure_ops_struct(fieldtype))
+			return 0;
+	}
+
+	return 1;
+}
+
+static void randomize_type(tree type)
+{
+	tree variant;
+
+	gcc_assert(TREE_CODE(type) == RECORD_TYPE);
+
+	if (lookup_attribute("randomize_considered", TYPE_ATTRIBUTES(type)))
+		return;
+
+	if (lookup_attribute("randomize_layout", TYPE_ATTRIBUTES(TYPE_MAIN_VARIANT(type))) || is_pure_ops_struct(type))
+		relayout_struct(type);
+
+	for (variant = TYPE_MAIN_VARIANT(type); variant; variant = TYPE_NEXT_VARIANT(variant)) {
+		TYPE_ATTRIBUTES(type) = copy_list(TYPE_ATTRIBUTES(type));
+		TYPE_ATTRIBUTES(type) = tree_cons(get_identifier("randomize_considered"), NULL_TREE, TYPE_ATTRIBUTES(type));
+	}
+#ifdef __DEBUG_PLUGIN
+	fprintf(stderr, "Marking randomize_considered on struct %s\n", ORIG_TYPE_NAME(type));
+#ifdef __DEBUG_VERBOSE
+	debug_tree(type);
+#endif
+#endif
+}
+
+static void update_decl_size(tree decl)
+{
+	tree lastval, lastidx, field, init, type, flexsize;
+	unsigned HOST_WIDE_INT len;
+
+	type = TREE_TYPE(decl);
+
+	if (!lookup_attribute("has_flexarray", TYPE_ATTRIBUTES(type)))
+		return;
+
+	init = DECL_INITIAL(decl);
+	if (init == NULL_TREE || init == error_mark_node)
+		return;
+
+	if (TREE_CODE(init) != CONSTRUCTOR)
+		return;
+
+	len = CONSTRUCTOR_NELTS(init);
+	if (!len)
+		return;
+
+	lastval = CONSTRUCTOR_ELT(init, CONSTRUCTOR_NELTS(init) - 1)->value;
+	lastidx = CONSTRUCTOR_ELT(init, CONSTRUCTOR_NELTS(init) - 1)->index;
+
+	for (field = TYPE_FIELDS(TREE_TYPE(decl)); TREE_CHAIN(field); field = TREE_CHAIN(field))
+		;
+
+	if (lastidx != field)
+		return;
+
+	if (TREE_CODE(lastval) != STRING_CST) {
+		error("Only string constants are supported as initializers "
+			"for randomized structures with flexible arrays");
+		return;
+	}
+
+	flexsize = bitsize_int(TREE_STRING_LENGTH(lastval) *
+			tree_to_uhwi(TYPE_SIZE(TREE_TYPE(TREE_TYPE(lastval)))));
+
+	DECL_SIZE(decl) = size_binop(PLUS_EXPR, TYPE_SIZE(type), flexsize);
+
+	return;
+}
+
+
+static void randomize_layout_finish_decl(void *event_data, void *data)
+{
+	tree decl = (tree)event_data;
+	tree type;
+
+	if (decl == NULL_TREE || decl == error_mark_node)
+		return;
+
+	type = TREE_TYPE(decl);
+
+	if (TREE_CODE(decl) != VAR_DECL)
+		return;
+
+	if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE)
+		return;
+
+	if (!lookup_attribute("randomize_performed", TYPE_ATTRIBUTES(type)))
+		return;
+
+	DECL_SIZE(decl) = 0;
+	DECL_SIZE_UNIT(decl) = 0;
+	DECL_ALIGN(decl) = 0;
+	DECL_MODE (decl) = VOIDmode;
+	SET_DECL_RTL(decl, 0);
+	update_decl_size(decl);
+	layout_decl(decl, 0);
+}
+
+static void finish_type(void *event_data, void *data)
+{
+	tree type = (tree)event_data;
+
+	if (type == NULL_TREE || type == error_mark_node)
+		return;
+
+	if (TREE_CODE(type) != RECORD_TYPE)
+		return;
+
+	if (TYPE_FIELDS(type) == NULL_TREE)
+		return;
+
+	if (lookup_attribute("randomize_considered", TYPE_ATTRIBUTES(type)))
+		return;
+
+#ifdef __DEBUG_PLUGIN
+	fprintf(stderr, "Calling randomize_type on %s\n", ORIG_TYPE_NAME(type));
+#endif
+#ifdef __DEBUG_VERBOSE
+	debug_tree(type);
+#endif
+	randomize_type(type);
+
+	return;
+}
+
+static struct attribute_spec randomize_layout_attr = {
+	.name		= "randomize_layout",
+	/* related to args */
+	.min_length	= 0,
+	.max_length	= 0,
+	.decl_required	= false,
+	/* need type declaration */
+	.type_required	= true,
+	.function_type_required = false,
+	.handler		= handle_randomize_layout_attr,
+#if BUILDING_GCC_VERSION >= 4007
+	.affects_type_identity  = true
+#endif
+};
+
+static struct attribute_spec no_randomize_layout_attr = {
+	.name		= "no_randomize_layout",
+	/* related to args */
+	.min_length	= 0,
+	.max_length	= 0,
+	.decl_required	= false,
+	/* need type declaration */
+	.type_required	= true,
+	.function_type_required = false,
+	.handler		= handle_randomize_layout_attr,
+#if BUILDING_GCC_VERSION >= 4007
+	.affects_type_identity  = true
+#endif
+};
+
+static struct attribute_spec randomize_considered_attr = {
+	.name		= "randomize_considered",
+	/* related to args */
+	.min_length	= 0,
+	.max_length	= 0,
+	.decl_required	= false,
+	/* need type declaration */
+	.type_required	= true,
+	.function_type_required = false,
+	.handler		= handle_randomize_considered_attr,
+#if BUILDING_GCC_VERSION >= 4007
+	.affects_type_identity  = false
+#endif
+};
+
+static struct attribute_spec randomize_performed_attr = {
+	.name		= "randomize_performed",
+	/* related to args */
+	.min_length	= 0,
+	.max_length	= 0,
+	.decl_required	= false,
+	/* need type declaration */
+	.type_required	= true,
+	.function_type_required = false,
+	.handler		= handle_randomize_performed_attr,
+#if BUILDING_GCC_VERSION >= 4007
+	.affects_type_identity  = false
+#endif
+};
+
+static void register_attributes(void *event_data, void *data)
+{
+	register_attribute(&randomize_layout_attr);
+	register_attribute(&no_randomize_layout_attr);
+	register_attribute(&randomize_considered_attr);
+	register_attribute(&randomize_performed_attr);
+}
+
+static void check_bad_casts_in_constructor(tree var, tree init)
+{
+	unsigned HOST_WIDE_INT idx;
+	tree field, val;
+	tree field_type, val_type;
+
+	FOR_EACH_CONSTRUCTOR_ELT(CONSTRUCTOR_ELTS(init), idx, field, val) {
+		if (TREE_CODE(val) == CONSTRUCTOR) {
+			check_bad_casts_in_constructor(var, val);
+			continue;
+		}
+
+		/* pipacs' plugin creates franken-arrays that differ from those produced by
+		   normal code which all have valid 'field' trees. work around this */
+		if (field == NULL_TREE)
+			continue;
+		field_type = TREE_TYPE(field);
+		val_type = TREE_TYPE(val);
+
+		if (TREE_CODE(field_type) != POINTER_TYPE || TREE_CODE(val_type) != POINTER_TYPE)
+			continue;
+
+		if (field_type == val_type)
+			continue;
+
+		field_type = TYPE_MAIN_VARIANT(strip_array_types(TYPE_MAIN_VARIANT(TREE_TYPE(field_type))));
+		val_type = TYPE_MAIN_VARIANT(strip_array_types(TYPE_MAIN_VARIANT(TREE_TYPE(val_type))));
+
+		if (field_type == void_type_node)
+			continue;
+		if (field_type == val_type)
+			continue;
+		if (TREE_CODE(val_type) != RECORD_TYPE)
+			continue;
+
+		if (!lookup_attribute("randomize_performed", TYPE_ATTRIBUTES(val_type)))
+			continue;
+		inform(DECL_SOURCE_LOCATION(var), "found mismatched struct pointer types: %qT and %qT\n", TYPE_MAIN_VARIANT(field_type), TYPE_MAIN_VARIANT(val_type));
+	}
+}
+
+static void check_global_variables(void *event_data, void *data)
+{
+	struct varpool_node *node;
+	tree init;
+
+	FOR_EACH_VARIABLE(node) {
+		tree var = NODE_DECL(node);
+		init = DECL_INITIAL(var);
+		if (init == NULL_TREE)
+			continue;
+
+		if (TREE_CODE(init) != CONSTRUCTOR)
+			continue;
+
+		check_bad_casts_in_constructor(var, init);
+	}
+}
+
+static bool dominated_by_is_err(const_tree rhs, basic_block bb)
+{
+	basic_block dom;
+	gimple dom_stmt;
+	gimple call_stmt;
+	const_tree dom_lhs;
+	const_tree poss_is_err_cond;
+	const_tree poss_is_err_func;
+	const_tree is_err_arg;
+
+	dom = get_immediate_dominator(CDI_DOMINATORS, bb);
+	if (!dom)
+		return false;
+
+	dom_stmt = last_stmt(dom);
+	if (!dom_stmt)
+		return false;
+
+	if (gimple_code(dom_stmt) != GIMPLE_COND)
+		return false;
+
+	if (gimple_cond_code(dom_stmt) != NE_EXPR)
+		return false;
+
+	if (!integer_zerop(gimple_cond_rhs(dom_stmt)))
+		return false;
+
+	poss_is_err_cond = gimple_cond_lhs(dom_stmt);
+
+	if (TREE_CODE(poss_is_err_cond) != SSA_NAME)
+		return false;
+
+	call_stmt = SSA_NAME_DEF_STMT(poss_is_err_cond);
+
+	if (gimple_code(call_stmt) != GIMPLE_CALL)
+		return false;
+
+	dom_lhs = gimple_get_lhs(call_stmt);
+	poss_is_err_func = gimple_call_fndecl(call_stmt);
+	if (!poss_is_err_func)
+		return false;
+	if (dom_lhs != poss_is_err_cond)
+		return false;
+	if (strcmp(DECL_NAME_POINTER(poss_is_err_func), "IS_ERR"))
+		return false;
+
+	is_err_arg = gimple_call_arg(call_stmt, 0);
+	if (!is_err_arg)
+		return false;
+
+	if (is_err_arg != rhs)
+		return false;
+
+	return true;
+}
+
+static void handle_local_var_initializers(void)
+{
+	tree var;
+	unsigned int i;
+
+	FOR_EACH_LOCAL_DECL(cfun, i, var) {
+		tree init = DECL_INITIAL(var);
+		if (!init)
+			continue;
+		if (TREE_CODE(init) != CONSTRUCTOR)
+			continue;
+		check_bad_casts_in_constructor(var, init);
+	}
+}
+
+/*
+ * iterate over all statements to find "bad" casts:
+ * those where the address of the start of a structure is cast
+ * to a pointer of a structure of a different type, or a
+ * structure pointer type is cast to a different structure pointer type
+ */
+static unsigned int find_bad_casts_execute(void)
+{
+	basic_block bb;
+
+	handle_local_var_initializers();
+
+	FOR_EACH_BB_FN(bb, cfun) {
+		gimple_stmt_iterator gsi;
+
+		for (gsi = gsi_start_bb(bb); !gsi_end_p(gsi); gsi_next(&gsi)) {
+			gimple stmt;
+			const_tree lhs;
+			const_tree lhs_type;
+			const_tree rhs1;
+			const_tree rhs_type;
+			const_tree ptr_lhs_type;
+			const_tree ptr_rhs_type;
+			const_tree op0;
+			const_tree op0_type;
+			enum tree_code rhs_code;
+
+			stmt = gsi_stmt(gsi);
+
+#ifdef __DEBUG_PLUGIN
+#ifdef __DEBUG_VERBOSE
+			debug_gimple_stmt(stmt);
+			debug_tree(gimple_get_lhs(stmt));
+#endif
+#endif
+
+			if (gimple_code(stmt) != GIMPLE_ASSIGN)
+				continue;
+
+#ifdef __DEBUG_PLUGIN
+#ifdef __DEBUG_VERBOSE
+			debug_tree(gimple_assign_rhs1(stmt));
+#endif
+#endif
+
+			rhs_code = gimple_assign_rhs_code(stmt);
+
+			if (rhs_code != ADDR_EXPR && rhs_code != SSA_NAME)
+				continue;
+
+			lhs = gimple_get_lhs(stmt);
+			lhs_type = TREE_TYPE(lhs);
+			rhs1 = gimple_assign_rhs1(stmt);
+			rhs_type = TREE_TYPE(rhs1);
+
+			if (TREE_CODE(rhs_type) != POINTER_TYPE ||
+			    TREE_CODE(lhs_type) != POINTER_TYPE)
+				continue;
+
+			ptr_lhs_type = TYPE_MAIN_VARIANT(strip_array_types(TYPE_MAIN_VARIANT(TREE_TYPE(lhs_type))));
+			ptr_rhs_type = TYPE_MAIN_VARIANT(strip_array_types(TYPE_MAIN_VARIANT(TREE_TYPE(rhs_type))));
+
+			if (ptr_rhs_type == void_type_node)
+				continue;
+
+			if (ptr_lhs_type == void_type_node)
+				continue;
+
+			if (dominated_by_is_err(rhs1, bb))
+				continue;
+
+			if (TREE_CODE(ptr_rhs_type) != RECORD_TYPE) {
+#ifndef __DEBUG_PLUGIN
+				if (lookup_attribute("randomize_performed", TYPE_ATTRIBUTES(ptr_lhs_type)))
+#endif
+				inform(gimple_location(stmt), "found mismatched struct pointer types: %qT and %qT\n", ptr_lhs_type, ptr_rhs_type);
+				continue;
+			}
+
+			if (rhs_code == SSA_NAME && ptr_lhs_type == ptr_rhs_type)
+				continue;
+
+			if (rhs_code == ADDR_EXPR) {
+				op0 = TREE_OPERAND(rhs1, 0);
+
+				if (op0 == NULL_TREE)
+					continue;
+
+				if (TREE_CODE(op0) != VAR_DECL)
+					continue;
+
+				op0_type = TYPE_MAIN_VARIANT(strip_array_types(TYPE_MAIN_VARIANT(TREE_TYPE(op0))));
+				if (op0_type == ptr_lhs_type)
+					continue;
+
+#ifndef __DEBUG_PLUGIN
+				if (lookup_attribute("randomize_performed", TYPE_ATTRIBUTES(op0_type)))
+#endif
+				inform(gimple_location(stmt), "found mismatched struct pointer types: %qT and %qT\n", ptr_lhs_type, op0_type);
+			} else {
+				const_tree ssa_name_var = SSA_NAME_VAR(rhs1);
+				/* skip bogus type casts introduced by container_of */
+				if (ssa_name_var != NULL_TREE && DECL_NAME(ssa_name_var) &&
+				    !strcmp((const char *)DECL_NAME_POINTER(ssa_name_var), "__mptr"))
+					continue;
+#ifndef __DEBUG_PLUGIN
+				if (lookup_attribute("randomize_performed", TYPE_ATTRIBUTES(ptr_rhs_type)))
+#endif
+				inform(gimple_location(stmt), "found mismatched struct pointer types: %qT and %qT\n", ptr_lhs_type, ptr_rhs_type);
+			}
+
+		}
+	}
+	return 0;
+}
+
+#define PASS_NAME find_bad_casts
+#define NO_GATE
+#define TODO_FLAGS_FINISH TODO_dump_func
+#include "gcc-generate-gimple-pass.h"
+
+int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version)
+{
+	int i;
+	const char * const plugin_name = plugin_info->base_name;
+	const int argc = plugin_info->argc;
+	const struct plugin_argument * const argv = plugin_info->argv;
+	bool enable = true;
+	int obtained_seed = 0;
+	struct register_pass_info find_bad_casts_pass_info;
+
+	find_bad_casts_pass_info.pass			= make_find_bad_casts_pass();
+	find_bad_casts_pass_info.reference_pass_name	= "ssa";
+	find_bad_casts_pass_info.ref_pass_instance_number	= 1;
+	find_bad_casts_pass_info.pos_op			= PASS_POS_INSERT_AFTER;
+
+	if (!plugin_default_version_check(version, &gcc_version)) {
+		error(G_("incompatible gcc/plugin versions"));
+		return 1;
+	}
+
+	if (strncmp(lang_hooks.name, "GNU C", 5) && !strncmp(lang_hooks.name, "GNU C+", 6)) {
+		inform(UNKNOWN_LOCATION, G_("%s supports C only, not %s"), plugin_name, lang_hooks.name);
+		enable = false;
+	}
+
+	for (i = 0; i < argc; ++i) {
+		if (!strcmp(argv[i].key, "disable")) {
+			enable = false;
+			continue;
+		}
+		if (!strcmp(argv[i].key, "performance-mode")) {
+			performance_mode = 1;
+			continue;
+		}
+		error(G_("unknown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
+	}
+
+	if (strlen(randstruct_seed) != 64) {
+		error(G_("invalid seed value supplied for %s plugin"), plugin_name);
+		return 1;
+	}
+	obtained_seed = sscanf(randstruct_seed, "%016llx%016llx%016llx%016llx",
+		&shuffle_seed[0], &shuffle_seed[1], &shuffle_seed[2], &shuffle_seed[3]);
+	if (obtained_seed != 4) {
+		error(G_("Invalid seed supplied for %s plugin"), plugin_name);
+		return 1;
+	}
+
+	register_callback(plugin_name, PLUGIN_INFO, NULL, &randomize_layout_plugin_info);
+	if (enable) {
+		register_callback(plugin_name, PLUGIN_ALL_IPA_PASSES_START, check_global_variables, NULL);
+		register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &find_bad_casts_pass_info);
+		register_callback(plugin_name, PLUGIN_FINISH_TYPE, finish_type, NULL);
+		register_callback(plugin_name, PLUGIN_FINISH_DECL, randomize_layout_finish_decl, NULL);
+	}
+	register_callback(plugin_name, PLUGIN_ATTRIBUTES, register_attributes, NULL);
+
+	return 0;
+}
-- 
1.9.1

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

* [kernel-hardening] [RFC 2/3] Enable the RANDSTRUCT plugin
  2016-05-05 17:21 [kernel-hardening] [RFC 0/3] Add struct randomization plugin Michael Leibowitz
  2016-05-05 17:21 ` [kernel-hardening] [RFC 1/3] Add struct randomizing plugin Michael Leibowitz
@ 2016-05-05 17:21 ` Michael Leibowitz
  2016-05-05 18:15   ` [kernel-hardening] " Kees Cook
  2016-05-05 17:21 ` [kernel-hardening] [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs Michael Leibowitz
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Michael Leibowitz @ 2016-05-05 17:21 UTC (permalink / raw)
  To: spender, kernel-hardening, keescook, re.emese, pageexec; +Cc: michael.leibowitz

These are config changes necessary to configure/enable the
structure layout randomizing gcc plugin

This feature is ported over from grsecurity.  This is largely
unchanged from the Original code written by the PaX Team and Spender.

Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
---
 arch/Kconfig                 | 43 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/compiler-gcc.h |  5 +++++
 include/linux/compiler.h     |  9 +++++++++
 include/linux/vermagic.h     |  9 ++++++++-
 kernel/module.c              | 27 +++++++++++++++++++++++++++
 5 files changed, 92 insertions(+), 1 deletion(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index 8af17ae..c3955a2 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -389,6 +389,49 @@ config GCC_PLUGIN_SANCOV
 	  gcc-4.5 on). It is based on the commit "Add fuzzing coverage support"
 	  by Dmitry Vyukov <dvyukov@google.com>.
 
+config GCC_PLUGIN_RANDSTRUCT
+	bool "Randomize layout of sensitive kernel structures"
+	default n
+	depends on GCC_PLUGINS
+	select MODVERSIONS if MODULES
+	help
+
+	  If you say Y here, the layouts of a number of sensitive kernel
+	  structures and all structures composed entirely of function pointers
+	  (aka "ops" structs) will be randomized at compile-time.  This can make
+	  exploitation that targets these structures more difficult by either
+	  requiring an additional information leak vulnerability, or knowing the
+	  pricise build that the target is running.
+
+	  Enabling this feature will have a performance impact, slightly
+	  increase memory usage, and prevent the use of forensic tools like
+	  Volatility against the system (unless the kernel source tree isn't
+	  cleaned after kernel installation).
+
+	  Additionally, enabling this feature causes modules compiled with one
+	  random seed to have gibberish names when loaded by a kernel with a
+	  different random seed.
+
+	  The seed used for compilation is located at
+	  scripts/gcc-plugins/randomize_layout_seed.h.  It remains after a make
+	  clean to allow for external modules to be compiled with the existing
+	  seed and will be removed by a make mrproper or make distclean.
+
+	  Note that the implementation requires gcc 4.6.4. or newer.  You may need
+	  to install the supporting headers explicitly in addition to the normal
+	  gcc package.
+
+config GCC_PLUGIN_RANDSTRUCT_PERFORMANCE
+	bool "Use cacheline-aware structure randomization"
+	default n
+	depends on GCC_PLUGIN_RANDSTRUCT
+	help
+	  If you say Y here, the RANDSTRUCT randomization will make a best effort
+	  at restricting randomization to cacheline-sized groups of elements.  It
+	  will further not randomize bitfields in structures.  This reduces the
+	  performance hit of RANDSTRUCT at the cost of weakened randomization.
+
+
 config HAVE_CC_STACKPROTECTOR
 	bool
 	help
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 22ab246..7bfa763 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -201,6 +201,11 @@
 /* Mark a function definition as prohibited from being cloned. */
 #define __noclone	__attribute__((__noclone__))
 
+#ifdef RANDSTRUCT_PLUGIN
+#define __randomize_layout __attribute__((randomize_layout))
+#define __no_randomize_layout __attribute__((no_randomize_layout))
+#endif
+
 #endif /* GCC_VERSION >= 40500 */
 
 #if GCC_VERSION >= 40600
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 48f5aab..8d0776e 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -416,6 +416,15 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
 # define __attribute_const__	/* unimplemented */
 #endif
 
+#ifndef __randomize_layout
+# define __randomize_layout
+#endif
+
+#ifndef __no_randomize_layout
+# define __no_randomize_layout
+#endif
+
+
 /*
  * Tell gcc if a function is cold. The compiler will assume any path
  * directly leading to the call is unlikely.
diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h
index 6f8fbcf..af6c03f 100644
--- a/include/linux/vermagic.h
+++ b/include/linux/vermagic.h
@@ -24,10 +24,17 @@
 #ifndef MODULE_ARCH_VERMAGIC
 #define MODULE_ARCH_VERMAGIC ""
 #endif
+#ifdef RANDSTRUCT_PLUGIN
+#include <generated/randomize_layout_hash.h>
+#define MODULE_RANDSTRUCT_PLUGIN "RANDSTRUCT_PLUGIN_" RANDSTRUCT_HASHED_SEED
+#else
+#define MODULE_RANDSTRUCT_PLUGIN
+#endif
 
 #define VERMAGIC_STRING 						\
 	UTS_RELEASE " "							\
 	MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT 			\
 	MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS	\
-	MODULE_ARCH_VERMAGIC
+	MODULE_ARCH_VERMAGIC						\
+	MODULE_RANDSTRUCT_PLUGIN
 
diff --git a/kernel/module.c b/kernel/module.c
index 794ebe8..74cf098 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1296,12 +1296,31 @@ static int check_version(Elf_Shdr *sechdrs,
 		goto bad_version;
 	}
 
+#ifdef CONFIG_GCC_PLUGIN_RANDSTRUCT
+	/*
+	 * avoid potentially printing jibberish on attempted load
+	 * of a module randomized with a different seed
+	 */
+	pr_warn("no symbol version for %s\n", symname);
+#else
+	pr_warn("%s: no symbol version for %s\n", mod->name, symname);
+#endif
+
 	pr_warn("%s: no symbol version for %s\n", mod->name, symname);
 	return 0;
 
 bad_version:
+#ifdef CONFIG_GCC_PLUGIN_RANDSTRUCT
+	/*
+	 * avoid potentially printing jibberish on attempted load
+	 * of a module randomized with a different seed
+	 */
+	pr_warn("attempted module disagrees about version of symbol %s\n",
+		symname);
+#else
 	pr_warn("%s: disagrees about version of symbol %s\n",
 	       mod->name, symname);
+#endif
 	return 0;
 }
 
@@ -2835,7 +2854,15 @@ static struct module *setup_load_info(struct load_info *info, int flags)
 	mod = (void *)info->sechdrs[info->index.mod].sh_addr;
 
 	if (info->index.sym == 0) {
+#ifdef CONFIG_GCC_PLUGIN_RANDSTRUCT
+		/*
+		 * avoid potentially printing jibberish on attempted load
+		 * of a module randomized with a different seed
+		 */
+		pr_warn("module has no symbols (stripped?)\n");
+#else
 		pr_warn("%s: module has no symbols (stripped?)\n", mod->name);
+#endif
 		return ERR_PTR(-ENOEXEC);
 	}
 
-- 
1.9.1

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

* [kernel-hardening] [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs
  2016-05-05 17:21 [kernel-hardening] [RFC 0/3] Add struct randomization plugin Michael Leibowitz
  2016-05-05 17:21 ` [kernel-hardening] [RFC 1/3] Add struct randomizing plugin Michael Leibowitz
  2016-05-05 17:21 ` [kernel-hardening] [RFC 2/3] Enable the RANDSTRUCT plugin Michael Leibowitz
@ 2016-05-05 17:21 ` Michael Leibowitz
  2016-05-05 18:17   ` [kernel-hardening] " Kees Cook
  2016-05-05 18:26 ` [kernel-hardening] Re: [RFC 0/3] Add struct randomization plugin Kees Cook
  2016-10-07 15:40 ` [kernel-hardening] " David Sterba
  4 siblings, 1 reply; 21+ messages in thread
From: Michael Leibowitz @ 2016-05-05 17:21 UTC (permalink / raw)
  To: spender, kernel-hardening, keescook, re.emese, pageexec; +Cc: michael.leibowitz

Due to randomization of structs, the in order struct intialization
style is replaced with explicit field style.

struct foo_t my_foo = {
       one,
       two,
       three
};

becomes

struct foo_t my_foo = {
       .one = one,
       .two = two,
       .three = three
};

Additionally, tag paravirt related structures to explicitly not be
randomized, as the structure layout is important.

This feature is ported over from grsecurity.  This is largely
unchanged from the Original code written by the PaX Team and Spender.

Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
---
 arch/x86/include/asm/floppy.h                   | 20 ++---
 arch/x86/include/asm/paravirt_types.h           | 18 +++--
 drivers/acpi/acpica/hwxfsleep.c                 | 11 +--
 drivers/block/cciss.h                           | 30 ++++----
 drivers/gpu/drm/nouveau/nouveau_ttm.c           | 28 +++----
 drivers/gpu/drm/ttm/ttm_bo_manager.c            | 10 +--
 drivers/gpu/drm/virtio/virtgpu_ttm.c            | 10 +--
 drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   | 10 +--
 drivers/infiniband/hw/nes/nes_cm.c              | 22 +++---
 drivers/isdn/gigaset/bas-gigaset.c              | 32 ++++----
 drivers/isdn/gigaset/ser-gigaset.c              | 32 ++++----
 drivers/isdn/gigaset/usb-gigaset.c              | 32 ++++----
 drivers/isdn/i4l/isdn_concap.c                  |  6 +-
 drivers/isdn/i4l/isdn_x25iface.c                | 16 ++--
 drivers/media/pci/solo6x10/solo6x10-g723.c      |  2 +-
 drivers/net/ethernet/brocade/bna/bna_enet.c     |  8 +-
 drivers/net/wan/lmc/lmc_media.c                 | 97 +++++++++++++------------
 drivers/scsi/bfa/bfa_fcs.c                      | 19 ++++-
 drivers/scsi/bfa/bfa_fcs_lport.c                | 29 +++++---
 drivers/scsi/bfa/bfa_modules.h                  | 12 +--
 drivers/scsi/hpsa.h                             | 40 +++++-----
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |  2 +-
 drivers/staging/lustre/lustre/libcfs/module.c   | 10 +--
 drivers/video/fbdev/matrox/matroxfb_DAC1064.c   | 10 ++-
 drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |  5 +-
 fs/reiserfs/item_ops.c                          | 24 +++---
 include/linux/rbtree_augmented.h                |  4 +-
 lib/rbtree.c                                    |  4 +-
 mm/page_alloc.c                                 |  2 +-
 net/atm/lec.c                                   |  6 +-
 net/atm/mpoa_caches.c                           | 41 +++++------
 net/vmw_vsock/vmci_transport_notify.c           | 30 ++++----
 net/vmw_vsock/vmci_transport_notify_qstate.c    | 30 ++++----
 sound/synth/emux/emux_seq.c                     | 14 ++--
 34 files changed, 352 insertions(+), 314 deletions(-)

diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
index 1c7eefe..d0e4702 100644
--- a/arch/x86/include/asm/floppy.h
+++ b/arch/x86/include/asm/floppy.h
@@ -229,18 +229,18 @@ static struct fd_routine_l {
 	int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
 } fd_routine[] = {
 	{
-		request_dma,
-		free_dma,
-		get_dma_residue,
-		dma_mem_alloc,
-		hard_dma_setup
+		._request_dma = request_dma,
+		._free_dma = free_dma,
+		._get_dma_residue = get_dma_residue,
+		._dma_mem_alloc = dma_mem_alloc,
+		._dma_setup = hard_dma_setup
 	},
 	{
-		vdma_request_dma,
-		vdma_nop,
-		vdma_get_dma_residue,
-		vdma_mem_alloc,
-		vdma_dma_setup
+		._request_dma = vdma_request_dma,
+		._free_dma = vdma_nop,
+		._get_dma_residue = vdma_get_dma_residue,
+		._dma_mem_alloc = vdma_mem_alloc,
+		._dma_setup = vdma_dma_setup
 	}
 };
 
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index 77db561..927c396 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -89,7 +89,7 @@ struct pv_init_ops {
 	 */
 	unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
 			  unsigned long addr, unsigned len);
-};
+} __no_randomize_layout;
 
 
 struct pv_lazy_ops {
@@ -97,12 +97,12 @@ struct pv_lazy_ops {
 	void (*enter)(void);
 	void (*leave)(void);
 	void (*flush)(void);
-};
+} __no_randomize_layout;
 
 struct pv_time_ops {
 	unsigned long long (*sched_clock)(void);
 	unsigned long long (*steal_clock)(int cpu);
-};
+} __no_randomize_layout;
 
 struct pv_cpu_ops {
 	/* hooks for various privileged instructions */
@@ -178,7 +178,7 @@ struct pv_cpu_ops {
 
 	void (*start_context_switch)(struct task_struct *prev);
 	void (*end_context_switch)(struct task_struct *next);
-};
+} __no_randomize_layout;
 
 struct pv_irq_ops {
 	/*
@@ -201,7 +201,7 @@ struct pv_irq_ops {
 #ifdef CONFIG_X86_64
 	void (*adjust_exception_frame)(void);
 #endif
-};
+} __no_randomize_layout;
 
 struct pv_mmu_ops {
 	unsigned long (*read_cr2)(void);
@@ -296,7 +296,7 @@ struct pv_mmu_ops {
 	   an mfn.  We can tell which is which from the index. */
 	void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
 			   phys_addr_t phys, pgprot_t flags);
-};
+} __no_randomize_layout;
 
 struct arch_spinlock;
 #ifdef CONFIG_SMP
@@ -322,7 +322,9 @@ struct pv_lock_ops {
 
 /* This contains all the paravirt structures: we get a convenient
  * number for each function using the offset which we use to indicate
- * what to patch. */
+ * what to patch.
+ * shouldn't be randomized due to the "NEAT TRICK" in paravirt.c
+ */
 struct paravirt_patch_template {
 	struct pv_init_ops pv_init_ops;
 	struct pv_time_ops pv_time_ops;
@@ -330,7 +332,7 @@ struct paravirt_patch_template {
 	struct pv_irq_ops pv_irq_ops;
 	struct pv_mmu_ops pv_mmu_ops;
 	struct pv_lock_ops pv_lock_ops;
-};
+} __no_randomize_layout;
 
 extern struct pv_info pv_info;
 extern struct pv_init_ops pv_init_ops;
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index f76e0ea..4b83315 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
 /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
 
 static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
-	{ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
-	 acpi_hw_extended_sleep},
-	{ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
-	 acpi_hw_extended_wake_prep},
-	{ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake}
+	{.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
+	 .extended_function = acpi_hw_extended_sleep},
+	{.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
+	 .extended_function = acpi_hw_extended_wake_prep},
+	{.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake),
+	 .extended_function = acpi_hw_extended_wake}
 };
 
 /*
diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
index 7fda30e..428766d 100644
--- a/drivers/block/cciss.h
+++ b/drivers/block/cciss.h
@@ -402,27 +402,27 @@ static bool SA5_performant_intr_pending(ctlr_info_t *h)
 }
 
 static struct access_method SA5_access = {
-	SA5_submit_command,
-	SA5_intr_mask,
-	SA5_fifo_full,
-	SA5_intr_pending,
-	SA5_completed,
+	.submit_command = SA5_submit_command,
+	.set_intr_mask = SA5_intr_mask,
+	.fifo_full = SA5_fifo_full,
+	.intr_pending = SA5_intr_pending,
+	.command_completed = SA5_completed,
 };
 
 static struct access_method SA5B_access = {
-        SA5_submit_command,
-        SA5B_intr_mask,
-        SA5_fifo_full,
-        SA5B_intr_pending,
-        SA5_completed,
+	.submit_command = SA5_submit_command,
+	.set_intr_mask = SA5B_intr_mask,
+	.fifo_full = SA5_fifo_full,
+	.intr_pending = SA5B_intr_pending,
+	.command_completed = SA5_completed,
 };
 
 static struct access_method SA5_performant_access = {
-	SA5_submit_command,
-	SA5_performant_intr_mask,
-	SA5_fifo_full,
-	SA5_performant_intr_pending,
-	SA5_performant_completed,
+	.submit_command = SA5_submit_command,
+	.set_intr_mask = SA5_performant_intr_mask,
+	.fifo_full = SA5_fifo_full,
+	.intr_pending = SA5_performant_intr_pending,
+	.command_completed = SA5_performant_completed,
 };
 
 struct board_type {
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index d2e7d20..7bbe51f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
 }
 
 const struct ttm_mem_type_manager_func nouveau_vram_manager = {
-	nouveau_vram_manager_init,
-	nouveau_vram_manager_fini,
-	nouveau_vram_manager_new,
-	nouveau_vram_manager_del,
+	.init = nouveau_vram_manager_init,
+	.takedown = nouveau_vram_manager_fini,
+	.get_node = nouveau_vram_manager_new,
+	.put_node = nouveau_vram_manager_del,
 };
 
 static int
@@ -183,11 +183,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
 }
 
 const struct ttm_mem_type_manager_func nouveau_gart_manager = {
-	nouveau_gart_manager_init,
-	nouveau_gart_manager_fini,
-	nouveau_gart_manager_new,
-	nouveau_gart_manager_del,
-	nouveau_gart_manager_debug
+	.init = nouveau_gart_manager_init,
+	.takedown = nouveau_gart_manager_fini,
+	.get_node = nouveau_gart_manager_new,
+	.put_node = nouveau_gart_manager_del,
+	.debug = nouveau_gart_manager_debug
 };
 
 /*XXX*/
@@ -256,11 +256,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
 }
 
 const struct ttm_mem_type_manager_func nv04_gart_manager = {
-	nv04_gart_manager_init,
-	nv04_gart_manager_fini,
-	nv04_gart_manager_new,
-	nv04_gart_manager_del,
-	nv04_gart_manager_debug
+	.init = nv04_gart_manager_init,
+	.takedown = nv04_gart_manager_fini,
+	.get_node = nv04_gart_manager_new,
+	.put_node = nv04_gart_manager_del,
+	.debug = nv04_gart_manager_debug
 };
 
 int
diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
index aa0bd05..aea6a01 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
@@ -148,10 +148,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
 }
 
 const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
-	ttm_bo_man_init,
-	ttm_bo_man_takedown,
-	ttm_bo_man_get_node,
-	ttm_bo_man_put_node,
-	ttm_bo_man_debug
+	.init = ttm_bo_man_init,
+	.takedown = ttm_bo_man_takedown,
+	.get_node = ttm_bo_man_get_node,
+	.put_node = ttm_bo_man_put_node,
+	.debug = ttm_bo_man_debug
 };
 EXPORT_SYMBOL(ttm_bo_manager_func);
diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
index 9fd924c..e5ec4ef 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
@@ -198,11 +198,11 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
 }
 
 static const struct ttm_mem_type_manager_func virtio_gpu_bo_manager_func = {
-	ttm_bo_man_init,
-	ttm_bo_man_takedown,
-	ttm_bo_man_get_node,
-	ttm_bo_man_put_node,
-	ttm_bo_man_debug
+	.init = ttm_bo_man_init,
+	.takedown = ttm_bo_man_takedown,
+	.get_node = ttm_bo_man_get_node,
+	.put_node = ttm_bo_man_put_node,
+	.debug = ttm_bo_man_debug
 };
 
 static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
index 170b61b..fec7348 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
@@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
 }
 
 const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
-	vmw_gmrid_man_init,
-	vmw_gmrid_man_takedown,
-	vmw_gmrid_man_get_node,
-	vmw_gmrid_man_put_node,
-	vmw_gmrid_man_debug
+	.init = vmw_gmrid_man_init,
+	.takedown = vmw_gmrid_man_takedown,
+	.get_node = vmw_gmrid_man_get_node,
+	.put_node = vmw_gmrid_man_put_node,
+	.debug = vmw_gmrid_man_debug
 };
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index cb9f0f2..8b1f654 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -135,17 +135,17 @@ static void record_ird_ord(struct nes_cm_node *, u16, u16);
 /* instance of function pointers for client API */
 /* set address of this instance to cm_core->cm_ops at cm_core alloc */
 static const struct nes_cm_ops nes_cm_api = {
-	mini_cm_accelerated,
-	mini_cm_listen,
-	mini_cm_del_listen,
-	mini_cm_connect,
-	mini_cm_close,
-	mini_cm_accept,
-	mini_cm_reject,
-	mini_cm_recv_pkt,
-	mini_cm_dealloc_core,
-	mini_cm_get,
-	mini_cm_set
+	.accelerated = mini_cm_accelerated,
+	.listen = mini_cm_listen,
+	.stop_listener = mini_cm_del_listen,
+	.connect = mini_cm_connect,
+	.close = mini_cm_close,
+	.accept = mini_cm_accept,
+	.reject = mini_cm_reject,
+	.recv_pkt = mini_cm_recv_pkt,
+	.destroy_cm_core = mini_cm_dealloc_core,
+	.get = mini_cm_get,
+	.set = mini_cm_set
 };
 
 static struct nes_cm_core *g_cm_core;
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
index aecec6d..11e13c5 100644
--- a/drivers/isdn/gigaset/bas-gigaset.c
+++ b/drivers/isdn/gigaset/bas-gigaset.c
@@ -2565,22 +2565,22 @@ static int gigaset_post_reset(struct usb_interface *intf)
 
 
 static const struct gigaset_ops gigops = {
-	gigaset_write_cmd,
-	gigaset_write_room,
-	gigaset_chars_in_buffer,
-	gigaset_brkchars,
-	gigaset_init_bchannel,
-	gigaset_close_bchannel,
-	gigaset_initbcshw,
-	gigaset_freebcshw,
-	gigaset_reinitbcshw,
-	gigaset_initcshw,
-	gigaset_freecshw,
-	gigaset_set_modem_ctrl,
-	gigaset_baud_rate,
-	gigaset_set_line_ctrl,
-	gigaset_isoc_send_skb,
-	gigaset_isoc_input,
+	.write_cmd = gigaset_write_cmd,
+	.write_room = gigaset_write_room,
+	.chars_in_buffer = gigaset_chars_in_buffer,
+	.brkchars = gigaset_brkchars,
+	.init_bchannel = gigaset_init_bchannel,
+	.close_bchannel = gigaset_close_bchannel,
+	.initbcshw = gigaset_initbcshw,
+	.freebcshw = gigaset_freebcshw,
+	.reinitbcshw = gigaset_reinitbcshw,
+	.initcshw = gigaset_initcshw,
+	.freecshw = gigaset_freecshw,
+	.set_modem_ctrl = gigaset_set_modem_ctrl,
+	.baud_rate = gigaset_baud_rate,
+	.set_line_ctrl = gigaset_set_line_ctrl,
+	.send_skb = gigaset_isoc_send_skb,
+	.handle_input = gigaset_isoc_input,
 };
 
 /* bas_gigaset_init
diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
index d1f8ab9..c0412f2 100644
--- a/drivers/isdn/gigaset/ser-gigaset.c
+++ b/drivers/isdn/gigaset/ser-gigaset.c
@@ -445,22 +445,22 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
 }
 
 static const struct gigaset_ops ops = {
-	gigaset_write_cmd,
-	gigaset_write_room,
-	gigaset_chars_in_buffer,
-	gigaset_brkchars,
-	gigaset_init_bchannel,
-	gigaset_close_bchannel,
-	gigaset_initbcshw,
-	gigaset_freebcshw,
-	gigaset_reinitbcshw,
-	gigaset_initcshw,
-	gigaset_freecshw,
-	gigaset_set_modem_ctrl,
-	gigaset_baud_rate,
-	gigaset_set_line_ctrl,
-	gigaset_m10x_send_skb,	/* asyncdata.c */
-	gigaset_m10x_input,	/* asyncdata.c */
+	.write_cmd = gigaset_write_cmd,
+	.write_room = gigaset_write_room,
+	.chars_in_buffer = gigaset_chars_in_buffer,
+	.brkchars = gigaset_brkchars,
+	.init_bchannel = gigaset_init_bchannel,
+	.close_bchannel = gigaset_close_bchannel,
+	.initbcshw = gigaset_initbcshw,
+	.freebcshw = gigaset_freebcshw,
+	.reinitbcshw = gigaset_reinitbcshw,
+	.initcshw = gigaset_initcshw,
+	.freecshw = gigaset_freecshw,
+	.set_modem_ctrl = gigaset_set_modem_ctrl,
+	.baud_rate = gigaset_baud_rate,
+	.set_line_ctrl = gigaset_set_line_ctrl,
+	.send_skb = gigaset_m10x_send_skb,	/* asyncdata.c */
+	.handle_input = gigaset_m10x_input,	/* asyncdata.c */
 };
 
 
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
index 5f306e2..eade36d 100644
--- a/drivers/isdn/gigaset/usb-gigaset.c
+++ b/drivers/isdn/gigaset/usb-gigaset.c
@@ -862,22 +862,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
 }
 
 static const struct gigaset_ops ops = {
-	gigaset_write_cmd,
-	gigaset_write_room,
-	gigaset_chars_in_buffer,
-	gigaset_brkchars,
-	gigaset_init_bchannel,
-	gigaset_close_bchannel,
-	gigaset_initbcshw,
-	gigaset_freebcshw,
-	gigaset_reinitbcshw,
-	gigaset_initcshw,
-	gigaset_freecshw,
-	gigaset_set_modem_ctrl,
-	gigaset_baud_rate,
-	gigaset_set_line_ctrl,
-	gigaset_m10x_send_skb,
-	gigaset_m10x_input,
+	.write_cmd = gigaset_write_cmd,
+	.write_room = gigaset_write_room,
+	.chars_in_buffer = gigaset_chars_in_buffer,
+	.brkchars = gigaset_brkchars,
+	.init_bchannel = gigaset_init_bchannel,
+	.close_bchannel = gigaset_close_bchannel,
+	.initbcshw = gigaset_initbcshw,
+	.freebcshw = gigaset_freebcshw,
+	.reinitbcshw = gigaset_reinitbcshw,
+	.initcshw = gigaset_initcshw,
+	.freecshw = gigaset_freecshw,
+	.set_modem_ctrl = gigaset_set_modem_ctrl,
+	.baud_rate = gigaset_baud_rate,
+	.set_line_ctrl = gigaset_set_line_ctrl,
+	.send_skb = gigaset_m10x_send_skb,
+	.handle_input = gigaset_m10x_input,
 };
 
 /*
diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
index 91d5730..336523e 100644
--- a/drivers/isdn/i4l/isdn_concap.c
+++ b/drivers/isdn/i4l/isdn_concap.c
@@ -80,9 +80,9 @@ static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
 }
 
 struct concap_device_ops isdn_concap_reliable_dl_dops = {
-	&isdn_concap_dl_data_req,
-	&isdn_concap_dl_connect_req,
-	&isdn_concap_dl_disconn_req
+	.data_req = &isdn_concap_dl_data_req,
+	.connect_req = &isdn_concap_dl_connect_req,
+	.disconn_req = &isdn_concap_dl_disconn_req
 };
 
 /* The following should better go into a dedicated source file such that
diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
index e2d4e58..40cd045 100644
--- a/drivers/isdn/i4l/isdn_x25iface.c
+++ b/drivers/isdn/i4l/isdn_x25iface.c
@@ -53,14 +53,14 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *);
 
 
 static struct concap_proto_ops ix25_pops = {
-	&isdn_x25iface_proto_new,
-	&isdn_x25iface_proto_del,
-	&isdn_x25iface_proto_restart,
-	&isdn_x25iface_proto_close,
-	&isdn_x25iface_xmit,
-	&isdn_x25iface_receive,
-	&isdn_x25iface_connect_ind,
-	&isdn_x25iface_disconn_ind
+	.proto_new = &isdn_x25iface_proto_new,
+	.proto_del = &isdn_x25iface_proto_del,
+	.restart = &isdn_x25iface_proto_restart,
+	.close = &isdn_x25iface_proto_close,
+	.encap_and_xmit = &isdn_x25iface_xmit,
+	.data_ind = &isdn_x25iface_receive,
+	.connect_ind = &isdn_x25iface_connect_ind,
+	.disconn_ind = &isdn_x25iface_disconn_ind
 };
 
 /* error message helper function */
diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
index 4a37a1c..7e82dfd 100644
--- a/drivers/media/pci/solo6x10/solo6x10-g723.c
+++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
@@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
 
 int solo_g723_init(struct solo_dev *solo_dev)
 {
-	static struct snd_device_ops ops = { NULL };
+	static struct snd_device_ops ops = { };
 	struct snd_card *card;
 	struct snd_kcontrol_new kctl;
 	char name[32];
diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c
index 4e5c387..bba8173 100644
--- a/drivers/net/ethernet/brocade/bna/bna_enet.c
+++ b/drivers/net/ethernet/brocade/bna/bna_enet.c
@@ -1676,10 +1676,10 @@ bna_cb_ioceth_reset(void *arg)
 }
 
 static struct bfa_ioc_cbfn bna_ioceth_cbfn = {
-	bna_cb_ioceth_enable,
-	bna_cb_ioceth_disable,
-	bna_cb_ioceth_hbfail,
-	bna_cb_ioceth_reset
+	.enable_cbfn = bna_cb_ioceth_enable,
+	.disable_cbfn = bna_cb_ioceth_disable,
+	.hbfail_cbfn = bna_cb_ioceth_hbfail,
+	.reset_cbfn = bna_cb_ioceth_reset
 };
 
 static void bna_attr_init(struct bna_ioceth *ioceth)
diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
index 5920c99..ff2e4a5 100644
--- a/drivers/net/wan/lmc/lmc_media.c
+++ b/drivers/net/wan/lmc/lmc_media.c
@@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int);
 static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
 
 lmc_media_t lmc_ds3_media = {
-  lmc_ds3_init,			/* special media init stuff */
-  lmc_ds3_default,		/* reset to default state */
-  lmc_ds3_set_status,		/* reset status to state provided */
-  lmc_dummy_set_1,		/* set clock source */
-  lmc_dummy_set2_1,		/* set line speed */
-  lmc_ds3_set_100ft,		/* set cable length */
-  lmc_ds3_set_scram,		/* set scrambler */
-  lmc_ds3_get_link_status,	/* get link status */
-  lmc_dummy_set_1,		/* set link status */
-  lmc_ds3_set_crc_length,	/* set CRC length */
-  lmc_dummy_set_1,		/* set T1 or E1 circuit type */
-  lmc_ds3_watchdog
+  .init = lmc_ds3_init,				/* special media init stuff */
+  .defaults = lmc_ds3_default,			/* reset to default state */
+  .set_status = lmc_ds3_set_status,		/* reset status to state provided */
+  .set_clock_source = lmc_dummy_set_1,		/* set clock source */
+  .set_speed = lmc_dummy_set2_1,		/* set line speed */
+  .set_cable_length = lmc_ds3_set_100ft,	/* set cable length */
+  .set_scrambler = lmc_ds3_set_scram,		/* set scrambler */
+  .get_link_status = lmc_ds3_get_link_status,	/* get link status */
+  .set_link_status = lmc_dummy_set_1,		/* set link status */
+  .set_crc_length = lmc_ds3_set_crc_length,	/* set CRC length */
+  .set_circuit_type = lmc_dummy_set_1,		/* set T1 or E1 circuit type */
+  .watchdog = lmc_ds3_watchdog
 };
 
 lmc_media_t lmc_hssi_media = {
-  lmc_hssi_init,		/* special media init stuff */
-  lmc_hssi_default,		/* reset to default state */
-  lmc_hssi_set_status,		/* reset status to state provided */
-  lmc_hssi_set_clock,		/* set clock source */
-  lmc_dummy_set2_1,		/* set line speed */
-  lmc_dummy_set_1,		/* set cable length */
-  lmc_dummy_set_1,		/* set scrambler */
-  lmc_hssi_get_link_status,	/* get link status */
-  lmc_hssi_set_link_status,	/* set link status */
-  lmc_hssi_set_crc_length,	/* set CRC length */
-  lmc_dummy_set_1,		/* set T1 or E1 circuit type */
-  lmc_hssi_watchdog
+  .init = lmc_hssi_init,			/* special media init stuff */
+  .defaults = lmc_hssi_default,			/* reset to default state */
+  .set_status = lmc_hssi_set_status,		/* reset status to state provided */
+  .set_clock_source = lmc_hssi_set_clock,	/* set clock source */
+  .set_speed = lmc_dummy_set2_1,		/* set line speed */
+  .set_cable_length = lmc_dummy_set_1,		/* set cable length */
+  .set_scrambler = lmc_dummy_set_1,		/* set scrambler */
+  .get_link_status = lmc_hssi_get_link_status,	/* get link status */
+  .set_link_status = lmc_hssi_set_link_status,	/* set link status */
+  .set_crc_length = lmc_hssi_set_crc_length,	/* set CRC length */
+  .set_circuit_type = lmc_dummy_set_1,		/* set T1 or E1 circuit type */
+  .watchdog = lmc_hssi_watchdog
 };
 
-lmc_media_t lmc_ssi_media = { lmc_ssi_init,	/* special media init stuff */
-  lmc_ssi_default,		/* reset to default state */
-  lmc_ssi_set_status,		/* reset status to state provided */
-  lmc_ssi_set_clock,		/* set clock source */
-  lmc_ssi_set_speed,		/* set line speed */
-  lmc_dummy_set_1,		/* set cable length */
-  lmc_dummy_set_1,		/* set scrambler */
-  lmc_ssi_get_link_status,	/* get link status */
-  lmc_ssi_set_link_status,	/* set link status */
-  lmc_ssi_set_crc_length,	/* set CRC length */
-  lmc_dummy_set_1,		/* set T1 or E1 circuit type */
-  lmc_ssi_watchdog
+lmc_media_t lmc_ssi_media = {
+  .init = lmc_ssi_init,				/* special media init stuff */
+  .defaults = lmc_ssi_default,			/* reset to default state */
+  .set_status = lmc_ssi_set_status,		/* reset status to state provided */
+  .set_clock_source = lmc_ssi_set_clock,	/* set clock source */
+  .set_speed = lmc_ssi_set_speed,		/* set line speed */
+  .set_cable_length = lmc_dummy_set_1,		/* set cable length */
+  .set_scrambler = lmc_dummy_set_1,		/* set scrambler */
+  .get_link_status = lmc_ssi_get_link_status,	/* get link status */
+  .set_link_status = lmc_ssi_set_link_status,	/* set link status */
+  .set_crc_length = lmc_ssi_set_crc_length,	/* set CRC length */
+  .set_circuit_type = lmc_dummy_set_1,		/* set T1 or E1 circuit type */
+  .watchdog = lmc_ssi_watchdog
 };
 
 lmc_media_t lmc_t1_media = {
-  lmc_t1_init,			/* special media init stuff */
-  lmc_t1_default,		/* reset to default state */
-  lmc_t1_set_status,		/* reset status to state provided */
-  lmc_t1_set_clock,		/* set clock source */
-  lmc_dummy_set2_1,		/* set line speed */
-  lmc_dummy_set_1,		/* set cable length */
-  lmc_dummy_set_1,		/* set scrambler */
-  lmc_t1_get_link_status,	/* get link status */
-  lmc_dummy_set_1,		/* set link status */
-  lmc_t1_set_crc_length,	/* set CRC length */
-  lmc_t1_set_circuit_type,	/* set T1 or E1 circuit type */
-  lmc_t1_watchdog
+  .init = lmc_t1_init,				/* special media init stuff */
+  .defaults = lmc_t1_default,			/* reset to default state */
+  .set_status = lmc_t1_set_status,		/* reset status to state provided */
+  .set_clock_source = lmc_t1_set_clock,		/* set clock source */
+  .set_speed = lmc_dummy_set2_1,		/* set line speed */
+  .set_cable_length = lmc_dummy_set_1,		/* set cable length */
+  .set_scrambler = lmc_dummy_set_1,		/* set scrambler */
+  .get_link_status = lmc_t1_get_link_status,	/* get link status */
+  .set_link_status = lmc_dummy_set_1,		/* set link status */
+  .set_crc_length = lmc_t1_set_crc_length,	/* set CRC length */
+  .set_circuit_type = lmc_t1_set_circuit_type,	/* set T1 or E1 circuit type */
+  .watchdog = lmc_t1_watchdog
 };
 
 static void
diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
index 1e7e139..c2031dd 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -39,10 +39,21 @@ struct bfa_fcs_mod_s {
 #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
 
 static struct bfa_fcs_mod_s fcs_modules[] = {
-	{ bfa_fcs_port_attach, NULL, NULL },
-	{ bfa_fcs_uf_attach, NULL, NULL },
-	{ bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
-	  bfa_fcs_fabric_modexit },
+	{
+		.attach = bfa_fcs_port_attach,
+		.modinit = NULL,
+		.modexit = NULL
+	},
+	{
+		.attach = bfa_fcs_uf_attach,
+		.modinit = NULL,
+		.modexit = NULL
+	},
+	{
+		.attach = bfa_fcs_fabric_attach,
+		.modinit = bfa_fcs_fabric_modinit,
+		.modexit = bfa_fcs_fabric_modexit
+	},
 };
 
 /*
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index 7733ad5..e5edbce 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -90,15 +90,26 @@ static struct {
 	void		(*offline) (struct bfa_fcs_lport_s *port);
 } __port_action[] = {
 	{
-	bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
-			bfa_fcs_lport_unknown_offline}, {
-	bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
-			bfa_fcs_lport_fab_offline}, {
-	bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
-			bfa_fcs_lport_n2n_offline}, {
-	bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
-			bfa_fcs_lport_loop_offline},
-	};
+		.init = bfa_fcs_lport_unknown_init,
+		.online = bfa_fcs_lport_unknown_online,
+		.offline = bfa_fcs_lport_unknown_offline
+	},
+	{
+		.init = bfa_fcs_lport_fab_init,
+		.online = bfa_fcs_lport_fab_online,
+		.offline = bfa_fcs_lport_fab_offline
+	},
+	{
+		.init = bfa_fcs_lport_n2n_init,
+		.online = bfa_fcs_lport_n2n_online,
+		.offline = bfa_fcs_lport_n2n_offline
+	},
+	{
+		.init = bfa_fcs_lport_loop_init,
+		.online = bfa_fcs_lport_loop_online,
+		.offline = bfa_fcs_lport_loop_offline
+	},
+};
 
 /*
  *  fcs_port_sm FCS logical port state machine
diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
index 53135f2..640621b 100644
--- a/drivers/scsi/bfa/bfa_modules.h
+++ b/drivers/scsi/bfa/bfa_modules.h
@@ -79,12 +79,12 @@ enum {
 									\
 	extern struct bfa_module_s hal_mod_ ## __mod;			\
 	struct bfa_module_s hal_mod_ ## __mod = {			\
-		bfa_ ## __mod ## _meminfo,				\
-		bfa_ ## __mod ## _attach,				\
-		bfa_ ## __mod ## _detach,				\
-		bfa_ ## __mod ## _start,				\
-		bfa_ ## __mod ## _stop,					\
-		bfa_ ## __mod ## _iocdisable,				\
+		.meminfo = bfa_ ## __mod ## _meminfo,			\
+		.attach = bfa_ ## __mod ## _attach,			\
+		.detach = bfa_ ## __mod ## _detach,			\
+		.start = bfa_ ## __mod ## _start,			\
+		.stop = bfa_ ## __mod ## _stop,				\
+		.iocdisable = bfa_ ## __mod ## _iocdisable,		\
 	}
 
 #define BFA_CACHELINE_SZ	(256)
diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
index fdd39fc..b734478 100644
--- a/drivers/scsi/hpsa.h
+++ b/drivers/scsi/hpsa.h
@@ -577,38 +577,38 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
 }
 
 static struct access_method SA5_access = {
-	SA5_submit_command,
-	SA5_intr_mask,
-	SA5_intr_pending,
-	SA5_completed,
+	.submit_command = SA5_submit_command,
+	.set_intr_mask = SA5_intr_mask,
+	.intr_pending = SA5_intr_pending,
+	.command_completed = SA5_completed,
 };
 
 static struct access_method SA5_ioaccel_mode1_access = {
-	SA5_submit_command,
-	SA5_performant_intr_mask,
-	SA5_ioaccel_mode1_intr_pending,
-	SA5_ioaccel_mode1_completed,
+	.submit_command = SA5_submit_command,
+	.set_intr_mask = SA5_performant_intr_mask,
+	.intr_pending = SA5_ioaccel_mode1_intr_pending,
+	.command_completed = SA5_ioaccel_mode1_completed,
 };
 
 static struct access_method SA5_ioaccel_mode2_access = {
-	SA5_submit_command_ioaccel2,
-	SA5_performant_intr_mask,
-	SA5_performant_intr_pending,
-	SA5_performant_completed,
+	.submit_command = SA5_submit_command_ioaccel2,
+	.set_intr_mask = SA5_performant_intr_mask,
+	.intr_pending = SA5_performant_intr_pending,
+	.command_completed = SA5_performant_completed,
 };
 
 static struct access_method SA5_performant_access = {
-	SA5_submit_command,
-	SA5_performant_intr_mask,
-	SA5_performant_intr_pending,
-	SA5_performant_completed,
+	.submit_command = SA5_submit_command,
+	.set_intr_mask = SA5_performant_intr_mask,
+	.intr_pending = SA5_performant_intr_pending,
+	.command_completed = SA5_performant_completed,
 };
 
 static struct access_method SA5_performant_access_no_read = {
-	SA5_submit_command_no_read,
-	SA5_performant_intr_mask,
-	SA5_performant_intr_pending,
-	SA5_performant_completed,
+	.submit_command = SA5_submit_command_no_read,
+	.set_intr_mask = SA5_performant_intr_mask,
+	.intr_pending = SA5_performant_intr_pending,
+	.command_completed = SA5_performant_completed,
 };
 
 struct board_type {
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
index 4310154..605d035 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
@@ -147,7 +147,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
 	int added = (mode == LCK_NL);
 	int overlaps = 0;
 	int splitted = 0;
-	const struct ldlm_callback_suite null_cbs = { NULL };
+	const struct ldlm_callback_suite null_cbs = { };
 
 	CDEBUG(D_DLMTRACE,
 	       "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
index 329d78c..9756f9e 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -322,11 +322,11 @@ out:
 }
 
 struct cfs_psdev_ops libcfs_psdev_ops = {
-	libcfs_psdev_open,
-	libcfs_psdev_release,
-	NULL,
-	NULL,
-	libcfs_ioctl
+	.p_open = libcfs_psdev_open,
+	.p_close = libcfs_psdev_release,
+	.p_read = NULL,
+	.p_write = NULL,
+	.p_ioctl = libcfs_ioctl
 };
 
 static int proc_call_handler(void *data, int write, loff_t *ppos,
diff --git a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
index a01147f..5d896f8 100644
--- a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
+++ b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
@@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo)
 
 #ifdef CONFIG_FB_MATROX_MYSTIQUE
 struct matrox_switch matrox_mystique = {
-	MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore,
+	.preinit = MGA1064_preinit,
+	.reset = MGA1064_reset,
+	.init = MGA1064_init,
+	.restore = MGA1064_restore,
 };
 EXPORT_SYMBOL(matrox_mystique);
 #endif
 
 #ifdef CONFIG_FB_MATROX_G
 struct matrox_switch matrox_G100 = {
-	MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore,
+	.preinit = MGAG100_preinit,
+	.reset = MGAG100_reset,
+	.init = MGAG100_init,
+	.restore = MGAG100_restore,
 };
 EXPORT_SYMBOL(matrox_G100);
 #endif
diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
index 195ad7c..09743fc 100644
--- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
+++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
@@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo)
 }
 
 struct matrox_switch matrox_millennium = {
-	Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore
+	.preinit = Ti3026_preinit,
+	.reset = Ti3026_reset,
+	.init = Ti3026_init,
+	.restore = Ti3026_restore
 };
 EXPORT_SYMBOL(matrox_millennium);
 #endif
diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
index aca73dd..e3c558d 100644
--- a/fs/reiserfs/item_ops.c
+++ b/fs/reiserfs/item_ops.c
@@ -724,18 +724,18 @@ static void errcatch_print_vi(struct virtual_item *vi)
 }
 
 static struct item_operations errcatch_ops = {
-	errcatch_bytes_number,
-	errcatch_decrement_key,
-	errcatch_is_left_mergeable,
-	errcatch_print_item,
-	errcatch_check_item,
-
-	errcatch_create_vi,
-	errcatch_check_left,
-	errcatch_check_right,
-	errcatch_part_size,
-	errcatch_unit_num,
-	errcatch_print_vi
+	.bytes_number = errcatch_bytes_number,
+	.decrement_key = errcatch_decrement_key,
+	.is_left_mergeable = errcatch_is_left_mergeable,
+	.print_item = errcatch_print_item,
+	.check_item = errcatch_check_item,
+
+	.create_vi = errcatch_create_vi,
+	.check_left = errcatch_check_left,
+	.check_right = errcatch_check_right,
+	.part_size = errcatch_part_size,
+	.unit_num = errcatch_unit_num,
+	.print_vi = errcatch_print_vi
 };
 
 #if ! (TYPE_STAT_DATA == 0 && TYPE_INDIRECT == 1 && TYPE_DIRECT == 2 && TYPE_DIRENTRY == 3)
diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
index 14d7b83..a1edf56 100644
--- a/include/linux/rbtree_augmented.h
+++ b/include/linux/rbtree_augmented.h
@@ -90,7 +90,9 @@ rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new)	\
 	old->rbaugmented = rbcompute(old);				\
 }									\
 rbstatic const struct rb_augment_callbacks rbname = {			\
-	rbname ## _propagate, rbname ## _copy, rbname ## _rotate	\
+	.propagate = rbname ## _propagate,				\
+	.copy = rbname ## _copy,					\
+	.rotate = rbname ## _rotate					\
 };
 
 
diff --git a/lib/rbtree.c b/lib/rbtree.c
index 1356454..70ce6c6 100644
--- a/lib/rbtree.c
+++ b/lib/rbtree.c
@@ -412,7 +412,9 @@ static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {}
 static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {}
 
 static const struct rb_augment_callbacks dummy_callbacks = {
-	dummy_propagate, dummy_copy, dummy_rotate
+	.propagate = dummy_propagate,
+	.copy = dummy_copy,
+	.rotate = dummy_rotate
 };
 
 void rb_insert_color(struct rb_node *node, struct rb_root *root)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 838ca8bb..7432a90 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -561,7 +561,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page,
 		__mod_zone_freepage_state(zone, (1 << order), migratetype);
 }
 #else
-struct page_ext_operations debug_guardpage_ops = { NULL, };
+struct page_ext_operations debug_guardpage_ops = { .need = NULL, .init = NULL };
 static inline void set_page_guard(struct zone *zone, struct page *page,
 				unsigned int order, int migratetype) {}
 static inline void clear_page_guard(struct zone *zone, struct page *page,
diff --git a/net/atm/lec.c b/net/atm/lec.c
index cd3b379..977a3c9 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
 }
 
 static struct lane2_ops lane2_ops = {
-	lane2_resolve,		/* resolve,             spec 3.1.3 */
-	lane2_associate_req,	/* associate_req,       spec 3.1.4 */
-	NULL			/* associate indicator, spec 3.1.5 */
+	.resolve = lane2_resolve,
+	.associate_req = lane2_associate_req,
+	.associate_indicator = NULL
 };
 
 static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
index 9e60e74..637c96e 100644
--- a/net/atm/mpoa_caches.c
+++ b/net/atm/mpoa_caches.c
@@ -535,30 +535,29 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
 
 
 static const struct in_cache_ops ingress_ops = {
-	in_cache_add_entry,               /* add_entry       */
-	in_cache_get,                     /* get             */
-	in_cache_get_with_mask,           /* get_with_mask   */
-	in_cache_get_by_vcc,              /* get_by_vcc      */
-	in_cache_put,                     /* put             */
-	in_cache_remove_entry,            /* remove_entry    */
-	cache_hit,                        /* cache_hit       */
-	clear_count_and_expired,          /* clear_count     */
-	check_resolving_entries,          /* check_resolving */
-	refresh_entries,                  /* refresh         */
-	in_destroy_cache                  /* destroy_cache   */
+	.add_entry = in_cache_add_entry,
+	.get = in_cache_get,
+	.get_with_mask = in_cache_get_with_mask,
+	.get_by_vcc = in_cache_get_by_vcc,
+	.put = in_cache_put,
+	.remove_entry = in_cache_remove_entry,
+	.cache_hit = cache_hit,
+	.clear_count = clear_count_and_expired,
+	.check_resolving = check_resolving_entries,
+	.refresh = refresh_entries,
 };
 
 static const struct eg_cache_ops egress_ops = {
-	eg_cache_add_entry,               /* add_entry        */
-	eg_cache_get_by_cache_id,         /* get_by_cache_id  */
-	eg_cache_get_by_tag,              /* get_by_tag       */
-	eg_cache_get_by_vcc,              /* get_by_vcc       */
-	eg_cache_get_by_src_ip,           /* get_by_src_ip    */
-	eg_cache_put,                     /* put              */
-	eg_cache_remove_entry,            /* remove_entry     */
-	update_eg_cache_entry,            /* update           */
-	clear_expired,                    /* clear_expired    */
-	eg_destroy_cache                  /* destroy_cache    */
+	.add_entry = eg_cache_add_entry,
+	.get_by_cache_id = eg_cache_get_by_cache_id,
+	.get_by_tag = eg_cache_get_by_tag,
+	.get_by_vcc = eg_cache_get_by_vcc,
+	.get_by_src_ip = eg_cache_get_by_src_ip,
+	.put = eg_cache_put,
+	.remove_entry = eg_cache_remove_entry,
+	.update = update_eg_cache_entry,
+	.clear_expired = clear_expired,
+	.destroy_cache = eg_destroy_cache
 };
 
 
diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
index fd8cf02..1406db4 100644
--- a/net/vmw_vsock/vmci_transport_notify.c
+++ b/net/vmw_vsock/vmci_transport_notify.c
@@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
 
 /* Socket control packet based operations. */
 const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
-	vmci_transport_notify_pkt_socket_init,
-	vmci_transport_notify_pkt_socket_destruct,
-	vmci_transport_notify_pkt_poll_in,
-	vmci_transport_notify_pkt_poll_out,
-	vmci_transport_notify_pkt_handle_pkt,
-	vmci_transport_notify_pkt_recv_init,
-	vmci_transport_notify_pkt_recv_pre_block,
-	vmci_transport_notify_pkt_recv_pre_dequeue,
-	vmci_transport_notify_pkt_recv_post_dequeue,
-	vmci_transport_notify_pkt_send_init,
-	vmci_transport_notify_pkt_send_pre_block,
-	vmci_transport_notify_pkt_send_pre_enqueue,
-	vmci_transport_notify_pkt_send_post_enqueue,
-	vmci_transport_notify_pkt_process_request,
-	vmci_transport_notify_pkt_process_negotiate,
+	.socket_init = vmci_transport_notify_pkt_socket_init,
+	.socket_destruct = vmci_transport_notify_pkt_socket_destruct,
+	.poll_in = vmci_transport_notify_pkt_poll_in,
+	.poll_out = vmci_transport_notify_pkt_poll_out,
+	.handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
+	.recv_init = vmci_transport_notify_pkt_recv_init,
+	.recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
+	.recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
+	.recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
+	.send_init = vmci_transport_notify_pkt_send_init,
+	.send_pre_block = vmci_transport_notify_pkt_send_pre_block,
+	.send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
+	.send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
+	.process_request = vmci_transport_notify_pkt_process_request,
+	.process_negotiate = vmci_transport_notify_pkt_process_negotiate,
 };
diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
index 21e591d..f3a0afc 100644
--- a/net/vmw_vsock/vmci_transport_notify_qstate.c
+++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
@@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue(
 
 /* Socket always on control packet based operations. */
 const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
-	vmci_transport_notify_pkt_socket_init,
-	vmci_transport_notify_pkt_socket_destruct,
-	vmci_transport_notify_pkt_poll_in,
-	vmci_transport_notify_pkt_poll_out,
-	vmci_transport_notify_pkt_handle_pkt,
-	vmci_transport_notify_pkt_recv_init,
-	vmci_transport_notify_pkt_recv_pre_block,
-	vmci_transport_notify_pkt_recv_pre_dequeue,
-	vmci_transport_notify_pkt_recv_post_dequeue,
-	vmci_transport_notify_pkt_send_init,
-	vmci_transport_notify_pkt_send_pre_block,
-	vmci_transport_notify_pkt_send_pre_enqueue,
-	vmci_transport_notify_pkt_send_post_enqueue,
-	vmci_transport_notify_pkt_process_request,
-	vmci_transport_notify_pkt_process_negotiate,
+	.socket_init = vmci_transport_notify_pkt_socket_init,
+	.socket_destruct = vmci_transport_notify_pkt_socket_destruct,
+	.poll_in = vmci_transport_notify_pkt_poll_in,
+	.poll_out = vmci_transport_notify_pkt_poll_out,
+	.handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
+	.recv_init = vmci_transport_notify_pkt_recv_init,
+	.recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
+	.recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
+	.recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
+	.send_init = vmci_transport_notify_pkt_send_init,
+	.send_pre_block = vmci_transport_notify_pkt_send_pre_block,
+	.send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
+	.send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
+	.process_request = vmci_transport_notify_pkt_process_request,
+	.process_negotiate = vmci_transport_notify_pkt_process_negotiate,
 };
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
index a020920..55579f6 100644
--- a/sound/synth/emux/emux_seq.c
+++ b/sound/synth/emux/emux_seq.c
@@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
  * MIDI emulation operators
  */
 static struct snd_midi_op emux_ops = {
-	snd_emux_note_on,
-	snd_emux_note_off,
-	snd_emux_key_press,
-	snd_emux_terminate_note,
-	snd_emux_control,
-	snd_emux_nrpn,
-	snd_emux_sysex,
+	.note_on = snd_emux_note_on,
+	.note_off = snd_emux_note_off,
+	.key_press = snd_emux_key_press,
+	.note_terminate = snd_emux_terminate_note,
+	.control = snd_emux_control,
+	.nrpn = snd_emux_nrpn,
+	.sysex = snd_emux_sysex,
 };
 
 
-- 
1.9.1

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

* [kernel-hardening] Re: [RFC 2/3] Enable the RANDSTRUCT plugin
  2016-05-05 17:21 ` [kernel-hardening] [RFC 2/3] Enable the RANDSTRUCT plugin Michael Leibowitz
@ 2016-05-05 18:15   ` Kees Cook
  0 siblings, 0 replies; 21+ messages in thread
From: Kees Cook @ 2016-05-05 18:15 UTC (permalink / raw)
  To: Michael Leibowitz; +Cc: Brad Spengler, kernel-hardening, Emese Revfy, PaX Team

On Thu, May 5, 2016 at 10:21 AM, Michael Leibowitz
<michael.leibowitz@intel.com> wrote:
> These are config changes necessary to configure/enable the
> structure layout randomizing gcc plugin
>
> This feature is ported over from grsecurity.  This is largely
> unchanged from the Original code written by the PaX Team and Spender.
>
> Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
> ---
>  arch/Kconfig                 | 43 +++++++++++++++++++++++++++++++++++++++++++
>  include/linux/compiler-gcc.h |  5 +++++
>  include/linux/compiler.h     |  9 +++++++++
>  include/linux/vermagic.h     |  9 ++++++++-
>  kernel/module.c              | 27 +++++++++++++++++++++++++++
>  5 files changed, 92 insertions(+), 1 deletion(-)
>
> diff --git a/arch/Kconfig b/arch/Kconfig
> index 8af17ae..c3955a2 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -389,6 +389,49 @@ config GCC_PLUGIN_SANCOV
>           gcc-4.5 on). It is based on the commit "Add fuzzing coverage support"
>           by Dmitry Vyukov <dvyukov@google.com>.
>
> +config GCC_PLUGIN_RANDSTRUCT
> +       bool "Randomize layout of sensitive kernel structures"
> +       default n
> +       depends on GCC_PLUGINS
> +       select MODVERSIONS if MODULES
> +       help
> +
> +         If you say Y here, the layouts of a number of sensitive kernel
> +         structures and all structures composed entirely of function pointers
> +         (aka "ops" structs) will be randomized at compile-time.  This can make
> +         exploitation that targets these structures more difficult by either
> +         requiring an additional information leak vulnerability, or knowing the
> +         pricise build that the target is running.
> +
> +         Enabling this feature will have a performance impact, slightly
> +         increase memory usage, and prevent the use of forensic tools like
> +         Volatility against the system (unless the kernel source tree isn't
> +         cleaned after kernel installation).
> +
> +         Additionally, enabling this feature causes modules compiled with one
> +         random seed to have gibberish names when loaded by a kernel with a
> +         different random seed.

I think this paragraph can be dropped, since the module name is
avoided in the code below.

> +
> +         The seed used for compilation is located at
> +         scripts/gcc-plugins/randomize_layout_seed.h.  It remains after a make
> +         clean to allow for external modules to be compiled with the existing
> +         seed and will be removed by a make mrproper or make distclean.
> +
> +         Note that the implementation requires gcc 4.6.4. or newer.  You may need
> +         to install the supporting headers explicitly in addition to the normal
> +         gcc package.

Does this use headers not already detected by the gcc plugin infrastructure?

> +
> +config GCC_PLUGIN_RANDSTRUCT_PERFORMANCE
> +       bool "Use cacheline-aware structure randomization"
> +       default n
> +       depends on GCC_PLUGIN_RANDSTRUCT
> +       help
> +         If you say Y here, the RANDSTRUCT randomization will make a best effort
> +         at restricting randomization to cacheline-sized groups of elements.  It
> +         will further not randomize bitfields in structures.  This reduces the
> +         performance hit of RANDSTRUCT at the cost of weakened randomization.
> +
> +
>  config HAVE_CC_STACKPROTECTOR
>         bool
>         help
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index 22ab246..7bfa763 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -201,6 +201,11 @@
>  /* Mark a function definition as prohibited from being cloned. */
>  #define __noclone      __attribute__((__noclone__))
>
> +#ifdef RANDSTRUCT_PLUGIN
> +#define __randomize_layout __attribute__((randomize_layout))
> +#define __no_randomize_layout __attribute__((no_randomize_layout))
> +#endif
> +
>  #endif /* GCC_VERSION >= 40500 */
>
>  #if GCC_VERSION >= 40600
> diff --git a/include/linux/compiler.h b/include/linux/compiler.h
> index 48f5aab..8d0776e 100644
> --- a/include/linux/compiler.h
> +++ b/include/linux/compiler.h
> @@ -416,6 +416,15 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
>  # define __attribute_const__   /* unimplemented */
>  #endif
>
> +#ifndef __randomize_layout
> +# define __randomize_layout
> +#endif
> +
> +#ifndef __no_randomize_layout
> +# define __no_randomize_layout
> +#endif
> +
> +
>  /*
>   * Tell gcc if a function is cold. The compiler will assume any path
>   * directly leading to the call is unlikely.
> diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h
> index 6f8fbcf..af6c03f 100644
> --- a/include/linux/vermagic.h
> +++ b/include/linux/vermagic.h
> @@ -24,10 +24,17 @@
>  #ifndef MODULE_ARCH_VERMAGIC
>  #define MODULE_ARCH_VERMAGIC ""
>  #endif
> +#ifdef RANDSTRUCT_PLUGIN
> +#include <generated/randomize_layout_hash.h>
> +#define MODULE_RANDSTRUCT_PLUGIN "RANDSTRUCT_PLUGIN_" RANDSTRUCT_HASHED_SEED
> +#else
> +#define MODULE_RANDSTRUCT_PLUGIN
> +#endif
>
>  #define VERMAGIC_STRING                                                \
>         UTS_RELEASE " "                                                 \
>         MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT                     \
>         MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS       \
> -       MODULE_ARCH_VERMAGIC
> +       MODULE_ARCH_VERMAGIC                                            \
> +       MODULE_RANDSTRUCT_PLUGIN
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 794ebe8..74cf098 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -1296,12 +1296,31 @@ static int check_version(Elf_Shdr *sechdrs,
>                 goto bad_version;
>         }
>
> +#ifdef CONFIG_GCC_PLUGIN_RANDSTRUCT
> +       /*
> +        * avoid potentially printing jibberish on attempted load
> +        * of a module randomized with a different seed
> +        */
> +       pr_warn("no symbol version for %s\n", symname);
> +#else
> +       pr_warn("%s: no symbol version for %s\n", mod->name, symname);
> +#endif
> +
>         pr_warn("%s: no symbol version for %s\n", mod->name, symname);

I think this pr_warn needs to be removed (it looks to have moved
inside the define).

I wonder if the module filename can be propagated in some other way
besides mod->name?

>         return 0;
>
>  bad_version:
> +#ifdef CONFIG_GCC_PLUGIN_RANDSTRUCT
> +       /*
> +        * avoid potentially printing jibberish on attempted load
> +        * of a module randomized with a different seed
> +        */
> +       pr_warn("attempted module disagrees about version of symbol %s\n",
> +               symname);
> +#else
>         pr_warn("%s: disagrees about version of symbol %s\n",
>                mod->name, symname);
> +#endif
>         return 0;
>  }
>
> @@ -2835,7 +2854,15 @@ static struct module *setup_load_info(struct load_info *info, int flags)
>         mod = (void *)info->sechdrs[info->index.mod].sh_addr;
>
>         if (info->index.sym == 0) {
> +#ifdef CONFIG_GCC_PLUGIN_RANDSTRUCT
> +               /*
> +                * avoid potentially printing jibberish on attempted load
> +                * of a module randomized with a different seed
> +                */
> +               pr_warn("module has no symbols (stripped?)\n");
> +#else
>                 pr_warn("%s: module has no symbols (stripped?)\n", mod->name);
> +#endif
>                 return ERR_PTR(-ENOEXEC);
>         }
>
> --
> 1.9.1
>



-- 
Kees Cook
Chrome OS & Brillo Security

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

* [kernel-hardening] Re: [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs
  2016-05-05 17:21 ` [kernel-hardening] [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs Michael Leibowitz
@ 2016-05-05 18:17   ` Kees Cook
  2016-05-05 19:46     ` Julia Lawall
                       ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Kees Cook @ 2016-05-05 18:17 UTC (permalink / raw)
  To: Michael Leibowitz, Julia Lawall
  Cc: Brad Spengler, kernel-hardening, Emese Revfy, PaX Team

On Thu, May 5, 2016 at 10:21 AM, Michael Leibowitz
<michael.leibowitz@intel.com> wrote:
> Due to randomization of structs, the in order struct intialization
> style is replaced with explicit field style.
>
> struct foo_t my_foo = {
>        one,
>        two,
>        three
> };
>
> becomes
>
> struct foo_t my_foo = {
>        .one = one,
>        .two = two,
>        .three = three
> };

Can a coccinelle script be written to do this also? It might be useful
to keep that around.

>
> Additionally, tag paravirt related structures to explicitly not be
> randomized, as the structure layout is important.

This might need to be split out? It's logically separate. Also, I
think this needs to come before the plugin, since the plugin isn't
usable until this patch is in place.

-Kees

>
> This feature is ported over from grsecurity.  This is largely
> unchanged from the Original code written by the PaX Team and Spender.
>
> Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
> ---
>  arch/x86/include/asm/floppy.h                   | 20 ++---
>  arch/x86/include/asm/paravirt_types.h           | 18 +++--
>  drivers/acpi/acpica/hwxfsleep.c                 | 11 +--
>  drivers/block/cciss.h                           | 30 ++++----
>  drivers/gpu/drm/nouveau/nouveau_ttm.c           | 28 +++----
>  drivers/gpu/drm/ttm/ttm_bo_manager.c            | 10 +--
>  drivers/gpu/drm/virtio/virtgpu_ttm.c            | 10 +--
>  drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   | 10 +--
>  drivers/infiniband/hw/nes/nes_cm.c              | 22 +++---
>  drivers/isdn/gigaset/bas-gigaset.c              | 32 ++++----
>  drivers/isdn/gigaset/ser-gigaset.c              | 32 ++++----
>  drivers/isdn/gigaset/usb-gigaset.c              | 32 ++++----
>  drivers/isdn/i4l/isdn_concap.c                  |  6 +-
>  drivers/isdn/i4l/isdn_x25iface.c                | 16 ++--
>  drivers/media/pci/solo6x10/solo6x10-g723.c      |  2 +-
>  drivers/net/ethernet/brocade/bna/bna_enet.c     |  8 +-
>  drivers/net/wan/lmc/lmc_media.c                 | 97 +++++++++++++------------
>  drivers/scsi/bfa/bfa_fcs.c                      | 19 ++++-
>  drivers/scsi/bfa/bfa_fcs_lport.c                | 29 +++++---
>  drivers/scsi/bfa/bfa_modules.h                  | 12 +--
>  drivers/scsi/hpsa.h                             | 40 +++++-----
>  drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |  2 +-
>  drivers/staging/lustre/lustre/libcfs/module.c   | 10 +--
>  drivers/video/fbdev/matrox/matroxfb_DAC1064.c   | 10 ++-
>  drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |  5 +-
>  fs/reiserfs/item_ops.c                          | 24 +++---
>  include/linux/rbtree_augmented.h                |  4 +-
>  lib/rbtree.c                                    |  4 +-
>  mm/page_alloc.c                                 |  2 +-
>  net/atm/lec.c                                   |  6 +-
>  net/atm/mpoa_caches.c                           | 41 +++++------
>  net/vmw_vsock/vmci_transport_notify.c           | 30 ++++----
>  net/vmw_vsock/vmci_transport_notify_qstate.c    | 30 ++++----
>  sound/synth/emux/emux_seq.c                     | 14 ++--
>  34 files changed, 352 insertions(+), 314 deletions(-)
>
> diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
> index 1c7eefe..d0e4702 100644
> --- a/arch/x86/include/asm/floppy.h
> +++ b/arch/x86/include/asm/floppy.h
> @@ -229,18 +229,18 @@ static struct fd_routine_l {
>         int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
>  } fd_routine[] = {
>         {
> -               request_dma,
> -               free_dma,
> -               get_dma_residue,
> -               dma_mem_alloc,
> -               hard_dma_setup
> +               ._request_dma = request_dma,
> +               ._free_dma = free_dma,
> +               ._get_dma_residue = get_dma_residue,
> +               ._dma_mem_alloc = dma_mem_alloc,
> +               ._dma_setup = hard_dma_setup
>         },
>         {
> -               vdma_request_dma,
> -               vdma_nop,
> -               vdma_get_dma_residue,
> -               vdma_mem_alloc,
> -               vdma_dma_setup
> +               ._request_dma = vdma_request_dma,
> +               ._free_dma = vdma_nop,
> +               ._get_dma_residue = vdma_get_dma_residue,
> +               ._dma_mem_alloc = vdma_mem_alloc,
> +               ._dma_setup = vdma_dma_setup
>         }
>  };
>
> diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
> index 77db561..927c396 100644
> --- a/arch/x86/include/asm/paravirt_types.h
> +++ b/arch/x86/include/asm/paravirt_types.h
> @@ -89,7 +89,7 @@ struct pv_init_ops {
>          */
>         unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
>                           unsigned long addr, unsigned len);
> -};
> +} __no_randomize_layout;
>
>
>  struct pv_lazy_ops {
> @@ -97,12 +97,12 @@ struct pv_lazy_ops {
>         void (*enter)(void);
>         void (*leave)(void);
>         void (*flush)(void);
> -};
> +} __no_randomize_layout;
>
>  struct pv_time_ops {
>         unsigned long long (*sched_clock)(void);
>         unsigned long long (*steal_clock)(int cpu);
> -};
> +} __no_randomize_layout;
>
>  struct pv_cpu_ops {
>         /* hooks for various privileged instructions */
> @@ -178,7 +178,7 @@ struct pv_cpu_ops {
>
>         void (*start_context_switch)(struct task_struct *prev);
>         void (*end_context_switch)(struct task_struct *next);
> -};
> +} __no_randomize_layout;
>
>  struct pv_irq_ops {
>         /*
> @@ -201,7 +201,7 @@ struct pv_irq_ops {
>  #ifdef CONFIG_X86_64
>         void (*adjust_exception_frame)(void);
>  #endif
> -};
> +} __no_randomize_layout;
>
>  struct pv_mmu_ops {
>         unsigned long (*read_cr2)(void);
> @@ -296,7 +296,7 @@ struct pv_mmu_ops {
>            an mfn.  We can tell which is which from the index. */
>         void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
>                            phys_addr_t phys, pgprot_t flags);
> -};
> +} __no_randomize_layout;
>
>  struct arch_spinlock;
>  #ifdef CONFIG_SMP
> @@ -322,7 +322,9 @@ struct pv_lock_ops {
>
>  /* This contains all the paravirt structures: we get a convenient
>   * number for each function using the offset which we use to indicate
> - * what to patch. */
> + * what to patch.
> + * shouldn't be randomized due to the "NEAT TRICK" in paravirt.c
> + */
>  struct paravirt_patch_template {
>         struct pv_init_ops pv_init_ops;
>         struct pv_time_ops pv_time_ops;
> @@ -330,7 +332,7 @@ struct paravirt_patch_template {
>         struct pv_irq_ops pv_irq_ops;
>         struct pv_mmu_ops pv_mmu_ops;
>         struct pv_lock_ops pv_lock_ops;
> -};
> +} __no_randomize_layout;
>
>  extern struct pv_info pv_info;
>  extern struct pv_init_ops pv_init_ops;
> diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
> index f76e0ea..4b83315 100644
> --- a/drivers/acpi/acpica/hwxfsleep.c
> +++ b/drivers/acpi/acpica/hwxfsleep.c
> @@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
>  /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
>
>  static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
> -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
> -        acpi_hw_extended_sleep},
> -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
> -        acpi_hw_extended_wake_prep},
> -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake}
> +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
> +        .extended_function = acpi_hw_extended_sleep},
> +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
> +        .extended_function = acpi_hw_extended_wake_prep},
> +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake),
> +        .extended_function = acpi_hw_extended_wake}
>  };
>
>  /*
> diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
> index 7fda30e..428766d 100644
> --- a/drivers/block/cciss.h
> +++ b/drivers/block/cciss.h
> @@ -402,27 +402,27 @@ static bool SA5_performant_intr_pending(ctlr_info_t *h)
>  }
>
>  static struct access_method SA5_access = {
> -       SA5_submit_command,
> -       SA5_intr_mask,
> -       SA5_fifo_full,
> -       SA5_intr_pending,
> -       SA5_completed,
> +       .submit_command = SA5_submit_command,
> +       .set_intr_mask = SA5_intr_mask,
> +       .fifo_full = SA5_fifo_full,
> +       .intr_pending = SA5_intr_pending,
> +       .command_completed = SA5_completed,
>  };
>
>  static struct access_method SA5B_access = {
> -        SA5_submit_command,
> -        SA5B_intr_mask,
> -        SA5_fifo_full,
> -        SA5B_intr_pending,
> -        SA5_completed,
> +       .submit_command = SA5_submit_command,
> +       .set_intr_mask = SA5B_intr_mask,
> +       .fifo_full = SA5_fifo_full,
> +       .intr_pending = SA5B_intr_pending,
> +       .command_completed = SA5_completed,
>  };
>
>  static struct access_method SA5_performant_access = {
> -       SA5_submit_command,
> -       SA5_performant_intr_mask,
> -       SA5_fifo_full,
> -       SA5_performant_intr_pending,
> -       SA5_performant_completed,
> +       .submit_command = SA5_submit_command,
> +       .set_intr_mask = SA5_performant_intr_mask,
> +       .fifo_full = SA5_fifo_full,
> +       .intr_pending = SA5_performant_intr_pending,
> +       .command_completed = SA5_performant_completed,
>  };
>
>  struct board_type {
> diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> index d2e7d20..7bbe51f 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> @@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
>  }
>
>  const struct ttm_mem_type_manager_func nouveau_vram_manager = {
> -       nouveau_vram_manager_init,
> -       nouveau_vram_manager_fini,
> -       nouveau_vram_manager_new,
> -       nouveau_vram_manager_del,
> +       .init = nouveau_vram_manager_init,
> +       .takedown = nouveau_vram_manager_fini,
> +       .get_node = nouveau_vram_manager_new,
> +       .put_node = nouveau_vram_manager_del,
>  };
>
>  static int
> @@ -183,11 +183,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
>  }
>
>  const struct ttm_mem_type_manager_func nouveau_gart_manager = {
> -       nouveau_gart_manager_init,
> -       nouveau_gart_manager_fini,
> -       nouveau_gart_manager_new,
> -       nouveau_gart_manager_del,
> -       nouveau_gart_manager_debug
> +       .init = nouveau_gart_manager_init,
> +       .takedown = nouveau_gart_manager_fini,
> +       .get_node = nouveau_gart_manager_new,
> +       .put_node = nouveau_gart_manager_del,
> +       .debug = nouveau_gart_manager_debug
>  };
>
>  /*XXX*/
> @@ -256,11 +256,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
>  }
>
>  const struct ttm_mem_type_manager_func nv04_gart_manager = {
> -       nv04_gart_manager_init,
> -       nv04_gart_manager_fini,
> -       nv04_gart_manager_new,
> -       nv04_gart_manager_del,
> -       nv04_gart_manager_debug
> +       .init = nv04_gart_manager_init,
> +       .takedown = nv04_gart_manager_fini,
> +       .get_node = nv04_gart_manager_new,
> +       .put_node = nv04_gart_manager_del,
> +       .debug = nv04_gart_manager_debug
>  };
>
>  int
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
> index aa0bd05..aea6a01 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
> @@ -148,10 +148,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
>  }
>
>  const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
> -       ttm_bo_man_init,
> -       ttm_bo_man_takedown,
> -       ttm_bo_man_get_node,
> -       ttm_bo_man_put_node,
> -       ttm_bo_man_debug
> +       .init = ttm_bo_man_init,
> +       .takedown = ttm_bo_man_takedown,
> +       .get_node = ttm_bo_man_get_node,
> +       .put_node = ttm_bo_man_put_node,
> +       .debug = ttm_bo_man_debug
>  };
>  EXPORT_SYMBOL(ttm_bo_manager_func);
> diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
> index 9fd924c..e5ec4ef 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
> @@ -198,11 +198,11 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
>  }
>
>  static const struct ttm_mem_type_manager_func virtio_gpu_bo_manager_func = {
> -       ttm_bo_man_init,
> -       ttm_bo_man_takedown,
> -       ttm_bo_man_get_node,
> -       ttm_bo_man_put_node,
> -       ttm_bo_man_debug
> +       .init = ttm_bo_man_init,
> +       .takedown = ttm_bo_man_takedown,
> +       .get_node = ttm_bo_man_get_node,
> +       .put_node = ttm_bo_man_put_node,
> +       .debug = ttm_bo_man_debug
>  };
>
>  static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> index 170b61b..fec7348 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> @@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
>  }
>
>  const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
> -       vmw_gmrid_man_init,
> -       vmw_gmrid_man_takedown,
> -       vmw_gmrid_man_get_node,
> -       vmw_gmrid_man_put_node,
> -       vmw_gmrid_man_debug
> +       .init = vmw_gmrid_man_init,
> +       .takedown = vmw_gmrid_man_takedown,
> +       .get_node = vmw_gmrid_man_get_node,
> +       .put_node = vmw_gmrid_man_put_node,
> +       .debug = vmw_gmrid_man_debug
>  };
> diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
> index cb9f0f2..8b1f654 100644
> --- a/drivers/infiniband/hw/nes/nes_cm.c
> +++ b/drivers/infiniband/hw/nes/nes_cm.c
> @@ -135,17 +135,17 @@ static void record_ird_ord(struct nes_cm_node *, u16, u16);
>  /* instance of function pointers for client API */
>  /* set address of this instance to cm_core->cm_ops at cm_core alloc */
>  static const struct nes_cm_ops nes_cm_api = {
> -       mini_cm_accelerated,
> -       mini_cm_listen,
> -       mini_cm_del_listen,
> -       mini_cm_connect,
> -       mini_cm_close,
> -       mini_cm_accept,
> -       mini_cm_reject,
> -       mini_cm_recv_pkt,
> -       mini_cm_dealloc_core,
> -       mini_cm_get,
> -       mini_cm_set
> +       .accelerated = mini_cm_accelerated,
> +       .listen = mini_cm_listen,
> +       .stop_listener = mini_cm_del_listen,
> +       .connect = mini_cm_connect,
> +       .close = mini_cm_close,
> +       .accept = mini_cm_accept,
> +       .reject = mini_cm_reject,
> +       .recv_pkt = mini_cm_recv_pkt,
> +       .destroy_cm_core = mini_cm_dealloc_core,
> +       .get = mini_cm_get,
> +       .set = mini_cm_set
>  };
>
>  static struct nes_cm_core *g_cm_core;
> diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
> index aecec6d..11e13c5 100644
> --- a/drivers/isdn/gigaset/bas-gigaset.c
> +++ b/drivers/isdn/gigaset/bas-gigaset.c
> @@ -2565,22 +2565,22 @@ static int gigaset_post_reset(struct usb_interface *intf)
>
>
>  static const struct gigaset_ops gigops = {
> -       gigaset_write_cmd,
> -       gigaset_write_room,
> -       gigaset_chars_in_buffer,
> -       gigaset_brkchars,
> -       gigaset_init_bchannel,
> -       gigaset_close_bchannel,
> -       gigaset_initbcshw,
> -       gigaset_freebcshw,
> -       gigaset_reinitbcshw,
> -       gigaset_initcshw,
> -       gigaset_freecshw,
> -       gigaset_set_modem_ctrl,
> -       gigaset_baud_rate,
> -       gigaset_set_line_ctrl,
> -       gigaset_isoc_send_skb,
> -       gigaset_isoc_input,
> +       .write_cmd = gigaset_write_cmd,
> +       .write_room = gigaset_write_room,
> +       .chars_in_buffer = gigaset_chars_in_buffer,
> +       .brkchars = gigaset_brkchars,
> +       .init_bchannel = gigaset_init_bchannel,
> +       .close_bchannel = gigaset_close_bchannel,
> +       .initbcshw = gigaset_initbcshw,
> +       .freebcshw = gigaset_freebcshw,
> +       .reinitbcshw = gigaset_reinitbcshw,
> +       .initcshw = gigaset_initcshw,
> +       .freecshw = gigaset_freecshw,
> +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> +       .baud_rate = gigaset_baud_rate,
> +       .set_line_ctrl = gigaset_set_line_ctrl,
> +       .send_skb = gigaset_isoc_send_skb,
> +       .handle_input = gigaset_isoc_input,
>  };
>
>  /* bas_gigaset_init
> diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
> index d1f8ab9..c0412f2 100644
> --- a/drivers/isdn/gigaset/ser-gigaset.c
> +++ b/drivers/isdn/gigaset/ser-gigaset.c
> @@ -445,22 +445,22 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
>  }
>
>  static const struct gigaset_ops ops = {
> -       gigaset_write_cmd,
> -       gigaset_write_room,
> -       gigaset_chars_in_buffer,
> -       gigaset_brkchars,
> -       gigaset_init_bchannel,
> -       gigaset_close_bchannel,
> -       gigaset_initbcshw,
> -       gigaset_freebcshw,
> -       gigaset_reinitbcshw,
> -       gigaset_initcshw,
> -       gigaset_freecshw,
> -       gigaset_set_modem_ctrl,
> -       gigaset_baud_rate,
> -       gigaset_set_line_ctrl,
> -       gigaset_m10x_send_skb,  /* asyncdata.c */
> -       gigaset_m10x_input,     /* asyncdata.c */
> +       .write_cmd = gigaset_write_cmd,
> +       .write_room = gigaset_write_room,
> +       .chars_in_buffer = gigaset_chars_in_buffer,
> +       .brkchars = gigaset_brkchars,
> +       .init_bchannel = gigaset_init_bchannel,
> +       .close_bchannel = gigaset_close_bchannel,
> +       .initbcshw = gigaset_initbcshw,
> +       .freebcshw = gigaset_freebcshw,
> +       .reinitbcshw = gigaset_reinitbcshw,
> +       .initcshw = gigaset_initcshw,
> +       .freecshw = gigaset_freecshw,
> +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> +       .baud_rate = gigaset_baud_rate,
> +       .set_line_ctrl = gigaset_set_line_ctrl,
> +       .send_skb = gigaset_m10x_send_skb,      /* asyncdata.c */
> +       .handle_input = gigaset_m10x_input,     /* asyncdata.c */
>  };
>
>
> diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
> index 5f306e2..eade36d 100644
> --- a/drivers/isdn/gigaset/usb-gigaset.c
> +++ b/drivers/isdn/gigaset/usb-gigaset.c
> @@ -862,22 +862,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
>  }
>
>  static const struct gigaset_ops ops = {
> -       gigaset_write_cmd,
> -       gigaset_write_room,
> -       gigaset_chars_in_buffer,
> -       gigaset_brkchars,
> -       gigaset_init_bchannel,
> -       gigaset_close_bchannel,
> -       gigaset_initbcshw,
> -       gigaset_freebcshw,
> -       gigaset_reinitbcshw,
> -       gigaset_initcshw,
> -       gigaset_freecshw,
> -       gigaset_set_modem_ctrl,
> -       gigaset_baud_rate,
> -       gigaset_set_line_ctrl,
> -       gigaset_m10x_send_skb,
> -       gigaset_m10x_input,
> +       .write_cmd = gigaset_write_cmd,
> +       .write_room = gigaset_write_room,
> +       .chars_in_buffer = gigaset_chars_in_buffer,
> +       .brkchars = gigaset_brkchars,
> +       .init_bchannel = gigaset_init_bchannel,
> +       .close_bchannel = gigaset_close_bchannel,
> +       .initbcshw = gigaset_initbcshw,
> +       .freebcshw = gigaset_freebcshw,
> +       .reinitbcshw = gigaset_reinitbcshw,
> +       .initcshw = gigaset_initcshw,
> +       .freecshw = gigaset_freecshw,
> +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> +       .baud_rate = gigaset_baud_rate,
> +       .set_line_ctrl = gigaset_set_line_ctrl,
> +       .send_skb = gigaset_m10x_send_skb,
> +       .handle_input = gigaset_m10x_input,
>  };
>
>  /*
> diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
> index 91d5730..336523e 100644
> --- a/drivers/isdn/i4l/isdn_concap.c
> +++ b/drivers/isdn/i4l/isdn_concap.c
> @@ -80,9 +80,9 @@ static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
>  }
>
>  struct concap_device_ops isdn_concap_reliable_dl_dops = {
> -       &isdn_concap_dl_data_req,
> -       &isdn_concap_dl_connect_req,
> -       &isdn_concap_dl_disconn_req
> +       .data_req = &isdn_concap_dl_data_req,
> +       .connect_req = &isdn_concap_dl_connect_req,
> +       .disconn_req = &isdn_concap_dl_disconn_req
>  };
>
>  /* The following should better go into a dedicated source file such that
> diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
> index e2d4e58..40cd045 100644
> --- a/drivers/isdn/i4l/isdn_x25iface.c
> +++ b/drivers/isdn/i4l/isdn_x25iface.c
> @@ -53,14 +53,14 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *);
>
>
>  static struct concap_proto_ops ix25_pops = {
> -       &isdn_x25iface_proto_new,
> -       &isdn_x25iface_proto_del,
> -       &isdn_x25iface_proto_restart,
> -       &isdn_x25iface_proto_close,
> -       &isdn_x25iface_xmit,
> -       &isdn_x25iface_receive,
> -       &isdn_x25iface_connect_ind,
> -       &isdn_x25iface_disconn_ind
> +       .proto_new = &isdn_x25iface_proto_new,
> +       .proto_del = &isdn_x25iface_proto_del,
> +       .restart = &isdn_x25iface_proto_restart,
> +       .close = &isdn_x25iface_proto_close,
> +       .encap_and_xmit = &isdn_x25iface_xmit,
> +       .data_ind = &isdn_x25iface_receive,
> +       .connect_ind = &isdn_x25iface_connect_ind,
> +       .disconn_ind = &isdn_x25iface_disconn_ind
>  };
>
>  /* error message helper function */
> diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
> index 4a37a1c..7e82dfd 100644
> --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> @@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
>
>  int solo_g723_init(struct solo_dev *solo_dev)
>  {
> -       static struct snd_device_ops ops = { NULL };
> +       static struct snd_device_ops ops = { };
>         struct snd_card *card;
>         struct snd_kcontrol_new kctl;
>         char name[32];
> diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c
> index 4e5c387..bba8173 100644
> --- a/drivers/net/ethernet/brocade/bna/bna_enet.c
> +++ b/drivers/net/ethernet/brocade/bna/bna_enet.c
> @@ -1676,10 +1676,10 @@ bna_cb_ioceth_reset(void *arg)
>  }
>
>  static struct bfa_ioc_cbfn bna_ioceth_cbfn = {
> -       bna_cb_ioceth_enable,
> -       bna_cb_ioceth_disable,
> -       bna_cb_ioceth_hbfail,
> -       bna_cb_ioceth_reset
> +       .enable_cbfn = bna_cb_ioceth_enable,
> +       .disable_cbfn = bna_cb_ioceth_disable,
> +       .hbfail_cbfn = bna_cb_ioceth_hbfail,
> +       .reset_cbfn = bna_cb_ioceth_reset
>  };
>
>  static void bna_attr_init(struct bna_ioceth *ioceth)
> diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
> index 5920c99..ff2e4a5 100644
> --- a/drivers/net/wan/lmc/lmc_media.c
> +++ b/drivers/net/wan/lmc/lmc_media.c
> @@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int);
>  static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
>
>  lmc_media_t lmc_ds3_media = {
> -  lmc_ds3_init,                        /* special media init stuff */
> -  lmc_ds3_default,             /* reset to default state */
> -  lmc_ds3_set_status,          /* reset status to state provided */
> -  lmc_dummy_set_1,             /* set clock source */
> -  lmc_dummy_set2_1,            /* set line speed */
> -  lmc_ds3_set_100ft,           /* set cable length */
> -  lmc_ds3_set_scram,           /* set scrambler */
> -  lmc_ds3_get_link_status,     /* get link status */
> -  lmc_dummy_set_1,             /* set link status */
> -  lmc_ds3_set_crc_length,      /* set CRC length */
> -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> -  lmc_ds3_watchdog
> +  .init = lmc_ds3_init,                                /* special media init stuff */
> +  .defaults = lmc_ds3_default,                 /* reset to default state */
> +  .set_status = lmc_ds3_set_status,            /* reset status to state provided */
> +  .set_clock_source = lmc_dummy_set_1,         /* set clock source */
> +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> +  .set_cable_length = lmc_ds3_set_100ft,       /* set cable length */
> +  .set_scrambler = lmc_ds3_set_scram,          /* set scrambler */
> +  .get_link_status = lmc_ds3_get_link_status,  /* get link status */
> +  .set_link_status = lmc_dummy_set_1,          /* set link status */
> +  .set_crc_length = lmc_ds3_set_crc_length,    /* set CRC length */
> +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> +  .watchdog = lmc_ds3_watchdog
>  };
>
>  lmc_media_t lmc_hssi_media = {
> -  lmc_hssi_init,               /* special media init stuff */
> -  lmc_hssi_default,            /* reset to default state */
> -  lmc_hssi_set_status,         /* reset status to state provided */
> -  lmc_hssi_set_clock,          /* set clock source */
> -  lmc_dummy_set2_1,            /* set line speed */
> -  lmc_dummy_set_1,             /* set cable length */
> -  lmc_dummy_set_1,             /* set scrambler */
> -  lmc_hssi_get_link_status,    /* get link status */
> -  lmc_hssi_set_link_status,    /* set link status */
> -  lmc_hssi_set_crc_length,     /* set CRC length */
> -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> -  lmc_hssi_watchdog
> +  .init = lmc_hssi_init,                       /* special media init stuff */
> +  .defaults = lmc_hssi_default,                        /* reset to default state */
> +  .set_status = lmc_hssi_set_status,           /* reset status to state provided */
> +  .set_clock_source = lmc_hssi_set_clock,      /* set clock source */
> +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> +  .get_link_status = lmc_hssi_get_link_status, /* get link status */
> +  .set_link_status = lmc_hssi_set_link_status, /* set link status */
> +  .set_crc_length = lmc_hssi_set_crc_length,   /* set CRC length */
> +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> +  .watchdog = lmc_hssi_watchdog
>  };
>
> -lmc_media_t lmc_ssi_media = { lmc_ssi_init,    /* special media init stuff */
> -  lmc_ssi_default,             /* reset to default state */
> -  lmc_ssi_set_status,          /* reset status to state provided */
> -  lmc_ssi_set_clock,           /* set clock source */
> -  lmc_ssi_set_speed,           /* set line speed */
> -  lmc_dummy_set_1,             /* set cable length */
> -  lmc_dummy_set_1,             /* set scrambler */
> -  lmc_ssi_get_link_status,     /* get link status */
> -  lmc_ssi_set_link_status,     /* set link status */
> -  lmc_ssi_set_crc_length,      /* set CRC length */
> -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> -  lmc_ssi_watchdog
> +lmc_media_t lmc_ssi_media = {
> +  .init = lmc_ssi_init,                                /* special media init stuff */
> +  .defaults = lmc_ssi_default,                 /* reset to default state */
> +  .set_status = lmc_ssi_set_status,            /* reset status to state provided */
> +  .set_clock_source = lmc_ssi_set_clock,       /* set clock source */
> +  .set_speed = lmc_ssi_set_speed,              /* set line speed */
> +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> +  .get_link_status = lmc_ssi_get_link_status,  /* get link status */
> +  .set_link_status = lmc_ssi_set_link_status,  /* set link status */
> +  .set_crc_length = lmc_ssi_set_crc_length,    /* set CRC length */
> +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> +  .watchdog = lmc_ssi_watchdog
>  };
>
>  lmc_media_t lmc_t1_media = {
> -  lmc_t1_init,                 /* special media init stuff */
> -  lmc_t1_default,              /* reset to default state */
> -  lmc_t1_set_status,           /* reset status to state provided */
> -  lmc_t1_set_clock,            /* set clock source */
> -  lmc_dummy_set2_1,            /* set line speed */
> -  lmc_dummy_set_1,             /* set cable length */
> -  lmc_dummy_set_1,             /* set scrambler */
> -  lmc_t1_get_link_status,      /* get link status */
> -  lmc_dummy_set_1,             /* set link status */
> -  lmc_t1_set_crc_length,       /* set CRC length */
> -  lmc_t1_set_circuit_type,     /* set T1 or E1 circuit type */
> -  lmc_t1_watchdog
> +  .init = lmc_t1_init,                         /* special media init stuff */
> +  .defaults = lmc_t1_default,                  /* reset to default state */
> +  .set_status = lmc_t1_set_status,             /* reset status to state provided */
> +  .set_clock_source = lmc_t1_set_clock,                /* set clock source */
> +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> +  .get_link_status = lmc_t1_get_link_status,   /* get link status */
> +  .set_link_status = lmc_dummy_set_1,          /* set link status */
> +  .set_crc_length = lmc_t1_set_crc_length,     /* set CRC length */
> +  .set_circuit_type = lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
> +  .watchdog = lmc_t1_watchdog
>  };
>
>  static void
> diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
> index 1e7e139..c2031dd 100644
> --- a/drivers/scsi/bfa/bfa_fcs.c
> +++ b/drivers/scsi/bfa/bfa_fcs.c
> @@ -39,10 +39,21 @@ struct bfa_fcs_mod_s {
>  #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
>
>  static struct bfa_fcs_mod_s fcs_modules[] = {
> -       { bfa_fcs_port_attach, NULL, NULL },
> -       { bfa_fcs_uf_attach, NULL, NULL },
> -       { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
> -         bfa_fcs_fabric_modexit },
> +       {
> +               .attach = bfa_fcs_port_attach,
> +               .modinit = NULL,
> +               .modexit = NULL
> +       },
> +       {
> +               .attach = bfa_fcs_uf_attach,
> +               .modinit = NULL,
> +               .modexit = NULL
> +       },
> +       {
> +               .attach = bfa_fcs_fabric_attach,
> +               .modinit = bfa_fcs_fabric_modinit,
> +               .modexit = bfa_fcs_fabric_modexit
> +       },
>  };
>
>  /*
> diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
> index 7733ad5..e5edbce 100644
> --- a/drivers/scsi/bfa/bfa_fcs_lport.c
> +++ b/drivers/scsi/bfa/bfa_fcs_lport.c
> @@ -90,15 +90,26 @@ static struct {
>         void            (*offline) (struct bfa_fcs_lport_s *port);
>  } __port_action[] = {
>         {
> -       bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
> -                       bfa_fcs_lport_unknown_offline}, {
> -       bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
> -                       bfa_fcs_lport_fab_offline}, {
> -       bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
> -                       bfa_fcs_lport_n2n_offline}, {
> -       bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
> -                       bfa_fcs_lport_loop_offline},
> -       };
> +               .init = bfa_fcs_lport_unknown_init,
> +               .online = bfa_fcs_lport_unknown_online,
> +               .offline = bfa_fcs_lport_unknown_offline
> +       },
> +       {
> +               .init = bfa_fcs_lport_fab_init,
> +               .online = bfa_fcs_lport_fab_online,
> +               .offline = bfa_fcs_lport_fab_offline
> +       },
> +       {
> +               .init = bfa_fcs_lport_n2n_init,
> +               .online = bfa_fcs_lport_n2n_online,
> +               .offline = bfa_fcs_lport_n2n_offline
> +       },
> +       {
> +               .init = bfa_fcs_lport_loop_init,
> +               .online = bfa_fcs_lport_loop_online,
> +               .offline = bfa_fcs_lport_loop_offline
> +       },
> +};
>
>  /*
>   *  fcs_port_sm FCS logical port state machine
> diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
> index 53135f2..640621b 100644
> --- a/drivers/scsi/bfa/bfa_modules.h
> +++ b/drivers/scsi/bfa/bfa_modules.h
> @@ -79,12 +79,12 @@ enum {
>                                                                         \
>         extern struct bfa_module_s hal_mod_ ## __mod;                   \
>         struct bfa_module_s hal_mod_ ## __mod = {                       \
> -               bfa_ ## __mod ## _meminfo,                              \
> -               bfa_ ## __mod ## _attach,                               \
> -               bfa_ ## __mod ## _detach,                               \
> -               bfa_ ## __mod ## _start,                                \
> -               bfa_ ## __mod ## _stop,                                 \
> -               bfa_ ## __mod ## _iocdisable,                           \
> +               .meminfo = bfa_ ## __mod ## _meminfo,                   \
> +               .attach = bfa_ ## __mod ## _attach,                     \
> +               .detach = bfa_ ## __mod ## _detach,                     \
> +               .start = bfa_ ## __mod ## _start,                       \
> +               .stop = bfa_ ## __mod ## _stop,                         \
> +               .iocdisable = bfa_ ## __mod ## _iocdisable,             \
>         }
>
>  #define BFA_CACHELINE_SZ       (256)
> diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
> index fdd39fc..b734478 100644
> --- a/drivers/scsi/hpsa.h
> +++ b/drivers/scsi/hpsa.h
> @@ -577,38 +577,38 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
>  }
>
>  static struct access_method SA5_access = {
> -       SA5_submit_command,
> -       SA5_intr_mask,
> -       SA5_intr_pending,
> -       SA5_completed,
> +       .submit_command = SA5_submit_command,
> +       .set_intr_mask = SA5_intr_mask,
> +       .intr_pending = SA5_intr_pending,
> +       .command_completed = SA5_completed,
>  };
>
>  static struct access_method SA5_ioaccel_mode1_access = {
> -       SA5_submit_command,
> -       SA5_performant_intr_mask,
> -       SA5_ioaccel_mode1_intr_pending,
> -       SA5_ioaccel_mode1_completed,
> +       .submit_command = SA5_submit_command,
> +       .set_intr_mask = SA5_performant_intr_mask,
> +       .intr_pending = SA5_ioaccel_mode1_intr_pending,
> +       .command_completed = SA5_ioaccel_mode1_completed,
>  };
>
>  static struct access_method SA5_ioaccel_mode2_access = {
> -       SA5_submit_command_ioaccel2,
> -       SA5_performant_intr_mask,
> -       SA5_performant_intr_pending,
> -       SA5_performant_completed,
> +       .submit_command = SA5_submit_command_ioaccel2,
> +       .set_intr_mask = SA5_performant_intr_mask,
> +       .intr_pending = SA5_performant_intr_pending,
> +       .command_completed = SA5_performant_completed,
>  };
>
>  static struct access_method SA5_performant_access = {
> -       SA5_submit_command,
> -       SA5_performant_intr_mask,
> -       SA5_performant_intr_pending,
> -       SA5_performant_completed,
> +       .submit_command = SA5_submit_command,
> +       .set_intr_mask = SA5_performant_intr_mask,
> +       .intr_pending = SA5_performant_intr_pending,
> +       .command_completed = SA5_performant_completed,
>  };
>
>  static struct access_method SA5_performant_access_no_read = {
> -       SA5_submit_command_no_read,
> -       SA5_performant_intr_mask,
> -       SA5_performant_intr_pending,
> -       SA5_performant_completed,
> +       .submit_command = SA5_submit_command_no_read,
> +       .set_intr_mask = SA5_performant_intr_mask,
> +       .intr_pending = SA5_performant_intr_pending,
> +       .command_completed = SA5_performant_completed,
>  };
>
>  struct board_type {
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> index 4310154..605d035 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> @@ -147,7 +147,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
>         int added = (mode == LCK_NL);
>         int overlaps = 0;
>         int splitted = 0;
> -       const struct ldlm_callback_suite null_cbs = { NULL };
> +       const struct ldlm_callback_suite null_cbs = { };
>
>         CDEBUG(D_DLMTRACE,
>                "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
> diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
> index 329d78c..9756f9e 100644
> --- a/drivers/staging/lustre/lustre/libcfs/module.c
> +++ b/drivers/staging/lustre/lustre/libcfs/module.c
> @@ -322,11 +322,11 @@ out:
>  }
>
>  struct cfs_psdev_ops libcfs_psdev_ops = {
> -       libcfs_psdev_open,
> -       libcfs_psdev_release,
> -       NULL,
> -       NULL,
> -       libcfs_ioctl
> +       .p_open = libcfs_psdev_open,
> +       .p_close = libcfs_psdev_release,
> +       .p_read = NULL,
> +       .p_write = NULL,
> +       .p_ioctl = libcfs_ioctl
>  };
>
>  static int proc_call_handler(void *data, int write, loff_t *ppos,
> diff --git a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> index a01147f..5d896f8 100644
> --- a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> +++ b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> @@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo)
>
>  #ifdef CONFIG_FB_MATROX_MYSTIQUE
>  struct matrox_switch matrox_mystique = {
> -       MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore,
> +       .preinit = MGA1064_preinit,
> +       .reset = MGA1064_reset,
> +       .init = MGA1064_init,
> +       .restore = MGA1064_restore,
>  };
>  EXPORT_SYMBOL(matrox_mystique);
>  #endif
>
>  #ifdef CONFIG_FB_MATROX_G
>  struct matrox_switch matrox_G100 = {
> -       MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore,
> +       .preinit = MGAG100_preinit,
> +       .reset = MGAG100_reset,
> +       .init = MGAG100_init,
> +       .restore = MGAG100_restore,
>  };
>  EXPORT_SYMBOL(matrox_G100);
>  #endif
> diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> index 195ad7c..09743fc 100644
> --- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> +++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> @@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo)
>  }
>
>  struct matrox_switch matrox_millennium = {
> -       Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore
> +       .preinit = Ti3026_preinit,
> +       .reset = Ti3026_reset,
> +       .init = Ti3026_init,
> +       .restore = Ti3026_restore
>  };
>  EXPORT_SYMBOL(matrox_millennium);
>  #endif
> diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
> index aca73dd..e3c558d 100644
> --- a/fs/reiserfs/item_ops.c
> +++ b/fs/reiserfs/item_ops.c
> @@ -724,18 +724,18 @@ static void errcatch_print_vi(struct virtual_item *vi)
>  }
>
>  static struct item_operations errcatch_ops = {
> -       errcatch_bytes_number,
> -       errcatch_decrement_key,
> -       errcatch_is_left_mergeable,
> -       errcatch_print_item,
> -       errcatch_check_item,
> -
> -       errcatch_create_vi,
> -       errcatch_check_left,
> -       errcatch_check_right,
> -       errcatch_part_size,
> -       errcatch_unit_num,
> -       errcatch_print_vi
> +       .bytes_number = errcatch_bytes_number,
> +       .decrement_key = errcatch_decrement_key,
> +       .is_left_mergeable = errcatch_is_left_mergeable,
> +       .print_item = errcatch_print_item,
> +       .check_item = errcatch_check_item,
> +
> +       .create_vi = errcatch_create_vi,
> +       .check_left = errcatch_check_left,
> +       .check_right = errcatch_check_right,
> +       .part_size = errcatch_part_size,
> +       .unit_num = errcatch_unit_num,
> +       .print_vi = errcatch_print_vi
>  };
>
>  #if ! (TYPE_STAT_DATA == 0 && TYPE_INDIRECT == 1 && TYPE_DIRECT == 2 && TYPE_DIRENTRY == 3)
> diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
> index 14d7b83..a1edf56 100644
> --- a/include/linux/rbtree_augmented.h
> +++ b/include/linux/rbtree_augmented.h
> @@ -90,7 +90,9 @@ rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new)     \
>         old->rbaugmented = rbcompute(old);                              \
>  }                                                                      \
>  rbstatic const struct rb_augment_callbacks rbname = {                  \
> -       rbname ## _propagate, rbname ## _copy, rbname ## _rotate        \
> +       .propagate = rbname ## _propagate,                              \
> +       .copy = rbname ## _copy,                                        \
> +       .rotate = rbname ## _rotate                                     \
>  };
>
>
> diff --git a/lib/rbtree.c b/lib/rbtree.c
> index 1356454..70ce6c6 100644
> --- a/lib/rbtree.c
> +++ b/lib/rbtree.c
> @@ -412,7 +412,9 @@ static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {}
>  static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {}
>
>  static const struct rb_augment_callbacks dummy_callbacks = {
> -       dummy_propagate, dummy_copy, dummy_rotate
> +       .propagate = dummy_propagate,
> +       .copy = dummy_copy,
> +       .rotate = dummy_rotate
>  };
>
>  void rb_insert_color(struct rb_node *node, struct rb_root *root)
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 838ca8bb..7432a90 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -561,7 +561,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page,
>                 __mod_zone_freepage_state(zone, (1 << order), migratetype);
>  }
>  #else
> -struct page_ext_operations debug_guardpage_ops = { NULL, };
> +struct page_ext_operations debug_guardpage_ops = { .need = NULL, .init = NULL };
>  static inline void set_page_guard(struct zone *zone, struct page *page,
>                                 unsigned int order, int migratetype) {}
>  static inline void clear_page_guard(struct zone *zone, struct page *page,
> diff --git a/net/atm/lec.c b/net/atm/lec.c
> index cd3b379..977a3c9 100644
> --- a/net/atm/lec.c
> +++ b/net/atm/lec.c
> @@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
>  }
>
>  static struct lane2_ops lane2_ops = {
> -       lane2_resolve,          /* resolve,             spec 3.1.3 */
> -       lane2_associate_req,    /* associate_req,       spec 3.1.4 */
> -       NULL                    /* associate indicator, spec 3.1.5 */
> +       .resolve = lane2_resolve,
> +       .associate_req = lane2_associate_req,
> +       .associate_indicator = NULL
>  };
>
>  static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
> diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
> index 9e60e74..637c96e 100644
> --- a/net/atm/mpoa_caches.c
> +++ b/net/atm/mpoa_caches.c
> @@ -535,30 +535,29 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
>
>
>  static const struct in_cache_ops ingress_ops = {
> -       in_cache_add_entry,               /* add_entry       */
> -       in_cache_get,                     /* get             */
> -       in_cache_get_with_mask,           /* get_with_mask   */
> -       in_cache_get_by_vcc,              /* get_by_vcc      */
> -       in_cache_put,                     /* put             */
> -       in_cache_remove_entry,            /* remove_entry    */
> -       cache_hit,                        /* cache_hit       */
> -       clear_count_and_expired,          /* clear_count     */
> -       check_resolving_entries,          /* check_resolving */
> -       refresh_entries,                  /* refresh         */
> -       in_destroy_cache                  /* destroy_cache   */
> +       .add_entry = in_cache_add_entry,
> +       .get = in_cache_get,
> +       .get_with_mask = in_cache_get_with_mask,
> +       .get_by_vcc = in_cache_get_by_vcc,
> +       .put = in_cache_put,
> +       .remove_entry = in_cache_remove_entry,
> +       .cache_hit = cache_hit,
> +       .clear_count = clear_count_and_expired,
> +       .check_resolving = check_resolving_entries,
> +       .refresh = refresh_entries,
>  };
>
>  static const struct eg_cache_ops egress_ops = {
> -       eg_cache_add_entry,               /* add_entry        */
> -       eg_cache_get_by_cache_id,         /* get_by_cache_id  */
> -       eg_cache_get_by_tag,              /* get_by_tag       */
> -       eg_cache_get_by_vcc,              /* get_by_vcc       */
> -       eg_cache_get_by_src_ip,           /* get_by_src_ip    */
> -       eg_cache_put,                     /* put              */
> -       eg_cache_remove_entry,            /* remove_entry     */
> -       update_eg_cache_entry,            /* update           */
> -       clear_expired,                    /* clear_expired    */
> -       eg_destroy_cache                  /* destroy_cache    */
> +       .add_entry = eg_cache_add_entry,
> +       .get_by_cache_id = eg_cache_get_by_cache_id,
> +       .get_by_tag = eg_cache_get_by_tag,
> +       .get_by_vcc = eg_cache_get_by_vcc,
> +       .get_by_src_ip = eg_cache_get_by_src_ip,
> +       .put = eg_cache_put,
> +       .remove_entry = eg_cache_remove_entry,
> +       .update = update_eg_cache_entry,
> +       .clear_expired = clear_expired,
> +       .destroy_cache = eg_destroy_cache
>  };
>
>
> diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
> index fd8cf02..1406db4 100644
> --- a/net/vmw_vsock/vmci_transport_notify.c
> +++ b/net/vmw_vsock/vmci_transport_notify.c
> @@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
>
>  /* Socket control packet based operations. */
>  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
> -       vmci_transport_notify_pkt_socket_init,
> -       vmci_transport_notify_pkt_socket_destruct,
> -       vmci_transport_notify_pkt_poll_in,
> -       vmci_transport_notify_pkt_poll_out,
> -       vmci_transport_notify_pkt_handle_pkt,
> -       vmci_transport_notify_pkt_recv_init,
> -       vmci_transport_notify_pkt_recv_pre_block,
> -       vmci_transport_notify_pkt_recv_pre_dequeue,
> -       vmci_transport_notify_pkt_recv_post_dequeue,
> -       vmci_transport_notify_pkt_send_init,
> -       vmci_transport_notify_pkt_send_pre_block,
> -       vmci_transport_notify_pkt_send_pre_enqueue,
> -       vmci_transport_notify_pkt_send_post_enqueue,
> -       vmci_transport_notify_pkt_process_request,
> -       vmci_transport_notify_pkt_process_negotiate,
> +       .socket_init = vmci_transport_notify_pkt_socket_init,
> +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
> +       .poll_in = vmci_transport_notify_pkt_poll_in,
> +       .poll_out = vmci_transport_notify_pkt_poll_out,
> +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
> +       .recv_init = vmci_transport_notify_pkt_recv_init,
> +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
> +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
> +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
> +       .send_init = vmci_transport_notify_pkt_send_init,
> +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
> +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
> +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
> +       .process_request = vmci_transport_notify_pkt_process_request,
> +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
>  };
> diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
> index 21e591d..f3a0afc 100644
> --- a/net/vmw_vsock/vmci_transport_notify_qstate.c
> +++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
> @@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue(
>
>  /* Socket always on control packet based operations. */
>  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
> -       vmci_transport_notify_pkt_socket_init,
> -       vmci_transport_notify_pkt_socket_destruct,
> -       vmci_transport_notify_pkt_poll_in,
> -       vmci_transport_notify_pkt_poll_out,
> -       vmci_transport_notify_pkt_handle_pkt,
> -       vmci_transport_notify_pkt_recv_init,
> -       vmci_transport_notify_pkt_recv_pre_block,
> -       vmci_transport_notify_pkt_recv_pre_dequeue,
> -       vmci_transport_notify_pkt_recv_post_dequeue,
> -       vmci_transport_notify_pkt_send_init,
> -       vmci_transport_notify_pkt_send_pre_block,
> -       vmci_transport_notify_pkt_send_pre_enqueue,
> -       vmci_transport_notify_pkt_send_post_enqueue,
> -       vmci_transport_notify_pkt_process_request,
> -       vmci_transport_notify_pkt_process_negotiate,
> +       .socket_init = vmci_transport_notify_pkt_socket_init,
> +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
> +       .poll_in = vmci_transport_notify_pkt_poll_in,
> +       .poll_out = vmci_transport_notify_pkt_poll_out,
> +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
> +       .recv_init = vmci_transport_notify_pkt_recv_init,
> +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
> +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
> +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
> +       .send_init = vmci_transport_notify_pkt_send_init,
> +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
> +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
> +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
> +       .process_request = vmci_transport_notify_pkt_process_request,
> +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
>  };
> diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
> index a020920..55579f6 100644
> --- a/sound/synth/emux/emux_seq.c
> +++ b/sound/synth/emux/emux_seq.c
> @@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
>   * MIDI emulation operators
>   */
>  static struct snd_midi_op emux_ops = {
> -       snd_emux_note_on,
> -       snd_emux_note_off,
> -       snd_emux_key_press,
> -       snd_emux_terminate_note,
> -       snd_emux_control,
> -       snd_emux_nrpn,
> -       snd_emux_sysex,
> +       .note_on = snd_emux_note_on,
> +       .note_off = snd_emux_note_off,
> +       .key_press = snd_emux_key_press,
> +       .note_terminate = snd_emux_terminate_note,
> +       .control = snd_emux_control,
> +       .nrpn = snd_emux_nrpn,
> +       .sysex = snd_emux_sysex,
>  };
>
>
> --
> 1.9.1
>



-- 
Kees Cook
Chrome OS & Brillo Security

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

* [kernel-hardening] Re: [RFC 0/3] Add struct randomization plugin
  2016-05-05 17:21 [kernel-hardening] [RFC 0/3] Add struct randomization plugin Michael Leibowitz
                   ` (2 preceding siblings ...)
  2016-05-05 17:21 ` [kernel-hardening] [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs Michael Leibowitz
@ 2016-05-05 18:26 ` Kees Cook
  2016-10-07 15:40 ` [kernel-hardening] " David Sterba
  4 siblings, 0 replies; 21+ messages in thread
From: Kees Cook @ 2016-05-05 18:26 UTC (permalink / raw)
  To: Michael Leibowitz; +Cc: Brad Spengler, kernel-hardening, Emese Revfy, PaX Team

On Thu, May 5, 2016 at 10:21 AM, Michael Leibowitz
<michael.leibowitz@intel.com> wrote:
> This patch set ports over grsecurity's structure randomization
> feature.  The plugin is largely unchanged from grsecurity, with some
> porting to go over Emese Revfy's v7 patch set for gcc plugin
> infrastructure.  This is an RFC.

Very cool, thanks for sending this out!

> Although this set of changes does not directly make exploitation
> harder, when a number of structures are randomized, it will make it
> difficult to splat many relevant structures without knowing the exact
> build of the kernel the target is using.  While for one structure,
> there are limited number of guesses required, in aggregate, this can
> be a large obstacle for exploitation.

Yeah, this is very powerful for people that build their own kernels
(it's a blinding defense that requires many more leaks before most
write attacks can happen). This is handy for distro kernels too, since
it forces attackers to handle all the built versions of a released
kernels.

To that end, if the kernel version changes, it seems like it would
make sense to invalidate the rand seed. It doesn't look like that's
happening, but I might be missing something in the modversioning.

> Patch 3 is a grab bag that probably needs to be broken up, although
> I'm not sure of the best way to do so.  Breaking by subsystem would
> seem to make an unwieldy patch set.

I'm hoping Julia will have some ideas about this. I think it makes
sense to get this fixed on its own, regardless of this feature.

> Known TODO that is not addressed as part of this patch set:
>   * tag security relevant structures for randomization

Does the plugin detect which structures it can randomize, or does it
require this hinting?

>   * add checkpatch checking for non-C99 initialization

Yeah, this would be very nice.

>   * automated testing of randomization

What do you have in mind for this?

>   * better description and examples of exploits effectively mitigated
>     by this feature

Basically everything that uses manual cred writing would be rendered
more difficult by this.

I'd also be curious to see some benchmark examples to identify the
true effect of enabling this and comparing it to the cacheline aware
option, etc.

> Tagging of structures to be randomized will come in subsequent series
> of patches.

Thanks!

-Kees

>
> --
>
>  arch/Kconfig                                    |  35 +
>  arch/x86/include/asm/floppy.h                   |  20 +-
>  arch/x86/include/asm/paravirt_types.h           |  18 +-
>  drivers/acpi/acpica/hwxfsleep.c                 |  11 +-
>  drivers/block/cciss.h                           |  30 +-
>  drivers/gpu/drm/nouveau/nouveau_ttm.c           |  28 +-
>  drivers/gpu/drm/ttm/ttm_bo_manager.c            |  10 +-
>  drivers/gpu/drm/virtio/virtgpu_ttm.c            |  10 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   |  10 +-
>  drivers/infiniband/hw/nes/nes_cm.c              |  22 +-
>  drivers/isdn/gigaset/bas-gigaset.c              |  32 +-
>  drivers/isdn/gigaset/ser-gigaset.c              |  32 +-
>  drivers/isdn/gigaset/usb-gigaset.c              |  32 +-
>  drivers/isdn/i4l/isdn_concap.c                  |   6 +-
>  drivers/isdn/i4l/isdn_x25iface.c                |  16 +-
>  drivers/media/pci/solo6x10/solo6x10-g723.c      |   2 +-
>  drivers/net/ethernet/brocade/bna/bna_enet.c     |   8 +-
>  drivers/net/wan/lmc/lmc_media.c                 |  97 +--
>  drivers/scsi/bfa/bfa_fcs.c                      |  19 +-
>  drivers/scsi/bfa/bfa_fcs_lport.c                |  29 +-
>  drivers/scsi/bfa/bfa_modules.h                  |  12 +-
>  drivers/scsi/hpsa.h                             |  40 +-
>  drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |   2 +-
>  drivers/staging/lustre/lustre/libcfs/module.c   |  10 +-
>  drivers/video/fbdev/matrox/matroxfb_DAC1064.c   |  10 +-
>  drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |   5 +-
>  fs/reiserfs/item_ops.c                          |  24 +-
>  include/linux/compiler-gcc.h                    |   5 +
>  include/linux/compiler.h                        |   9 +
>  include/linux/rbtree_augmented.h                |   4 +-
>  include/linux/vermagic.h                        |   9 +-
>  kernel/module.c                                 |  27 +
>  lib/rbtree.c                                    |   4 +-
>  mm/page_alloc.c                                 |   2 +-
>  net/atm/lec.c                                   |   6 +-
>  net/atm/mpoa_caches.c                           |  41 +-
>  net/vmw_vsock/vmci_transport_notify.c           |  30 +-
>  net/vmw_vsock/vmci_transport_notify_qstate.c    |  30 +-
>  scripts/Makefile.gcc-plugins                    |  11 +-
>  scripts/gcc-plugins/.gitignore                  |   1 +
>  scripts/gcc-plugins/Makefile                    |  12 +
>  scripts/gcc-plugins/gen-random-seed.sh          |   8 +
>  scripts/gcc-plugins/randomize_layout_plugin.c   | 935 ++++++++++++++++++++++++
>  sound/synth/emux/emux_seq.c                     |  14 +-
>  44 files changed, 1402 insertions(+), 316 deletions(-)
>



-- 
Kees Cook
Chrome OS & Brillo Security

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

* [kernel-hardening] Re: [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs
  2016-05-05 18:17   ` [kernel-hardening] " Kees Cook
@ 2016-05-05 19:46     ` Julia Lawall
  2016-05-06 12:37     ` Julia Lawall
  2016-06-13 14:32     ` Julia Lawall
  2 siblings, 0 replies; 21+ messages in thread
From: Julia Lawall @ 2016-05-05 19:46 UTC (permalink / raw)
  To: Kees Cook
  Cc: Michael Leibowitz, Brad Spengler, kernel-hardening, Emese Revfy,
	PaX Team



On Thu, 5 May 2016, Kees Cook wrote:

> On Thu, May 5, 2016 at 10:21 AM, Michael Leibowitz
> <michael.leibowitz@intel.com> wrote:
> > Due to randomization of structs, the in order struct intialization
> > style is replaced with explicit field style.
> >
> > struct foo_t my_foo = {
> >        one,
> >        two,
> >        three
> > };
> >
> > becomes
> >
> > struct foo_t my_foo = {
> >        .one = one,
> >        .two = two,
> >        .three = three
> > };
> 
> Can a coccinelle script be written to do this also? It might be useful
> to keep that around.

Yes.  I have such a script lying around.  I'll ask my intern for this 
summer to check on it and get it integrated into the kernel.

julia

> >
> > Additionally, tag paravirt related structures to explicitly not be
> > randomized, as the structure layout is important.
> 
> This might need to be split out? It's logically separate. Also, I
> think this needs to come before the plugin, since the plugin isn't
> usable until this patch is in place.
> 
> -Kees
> 
> >
> > This feature is ported over from grsecurity.  This is largely
> > unchanged from the Original code written by the PaX Team and Spender.
> >
> > Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
> > ---
> >  arch/x86/include/asm/floppy.h                   | 20 ++---
> >  arch/x86/include/asm/paravirt_types.h           | 18 +++--
> >  drivers/acpi/acpica/hwxfsleep.c                 | 11 +--
> >  drivers/block/cciss.h                           | 30 ++++----
> >  drivers/gpu/drm/nouveau/nouveau_ttm.c           | 28 +++----
> >  drivers/gpu/drm/ttm/ttm_bo_manager.c            | 10 +--
> >  drivers/gpu/drm/virtio/virtgpu_ttm.c            | 10 +--
> >  drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   | 10 +--
> >  drivers/infiniband/hw/nes/nes_cm.c              | 22 +++---
> >  drivers/isdn/gigaset/bas-gigaset.c              | 32 ++++----
> >  drivers/isdn/gigaset/ser-gigaset.c              | 32 ++++----
> >  drivers/isdn/gigaset/usb-gigaset.c              | 32 ++++----
> >  drivers/isdn/i4l/isdn_concap.c                  |  6 +-
> >  drivers/isdn/i4l/isdn_x25iface.c                | 16 ++--
> >  drivers/media/pci/solo6x10/solo6x10-g723.c      |  2 +-
> >  drivers/net/ethernet/brocade/bna/bna_enet.c     |  8 +-
> >  drivers/net/wan/lmc/lmc_media.c                 | 97 +++++++++++++------------
> >  drivers/scsi/bfa/bfa_fcs.c                      | 19 ++++-
> >  drivers/scsi/bfa/bfa_fcs_lport.c                | 29 +++++---
> >  drivers/scsi/bfa/bfa_modules.h                  | 12 +--
> >  drivers/scsi/hpsa.h                             | 40 +++++-----
> >  drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |  2 +-
> >  drivers/staging/lustre/lustre/libcfs/module.c   | 10 +--
> >  drivers/video/fbdev/matrox/matroxfb_DAC1064.c   | 10 ++-
> >  drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |  5 +-
> >  fs/reiserfs/item_ops.c                          | 24 +++---
> >  include/linux/rbtree_augmented.h                |  4 +-
> >  lib/rbtree.c                                    |  4 +-
> >  mm/page_alloc.c                                 |  2 +-
> >  net/atm/lec.c                                   |  6 +-
> >  net/atm/mpoa_caches.c                           | 41 +++++------
> >  net/vmw_vsock/vmci_transport_notify.c           | 30 ++++----
> >  net/vmw_vsock/vmci_transport_notify_qstate.c    | 30 ++++----
> >  sound/synth/emux/emux_seq.c                     | 14 ++--
> >  34 files changed, 352 insertions(+), 314 deletions(-)
> >
> > diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
> > index 1c7eefe..d0e4702 100644
> > --- a/arch/x86/include/asm/floppy.h
> > +++ b/arch/x86/include/asm/floppy.h
> > @@ -229,18 +229,18 @@ static struct fd_routine_l {
> >         int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
> >  } fd_routine[] = {
> >         {
> > -               request_dma,
> > -               free_dma,
> > -               get_dma_residue,
> > -               dma_mem_alloc,
> > -               hard_dma_setup
> > +               ._request_dma = request_dma,
> > +               ._free_dma = free_dma,
> > +               ._get_dma_residue = get_dma_residue,
> > +               ._dma_mem_alloc = dma_mem_alloc,
> > +               ._dma_setup = hard_dma_setup
> >         },
> >         {
> > -               vdma_request_dma,
> > -               vdma_nop,
> > -               vdma_get_dma_residue,
> > -               vdma_mem_alloc,
> > -               vdma_dma_setup
> > +               ._request_dma = vdma_request_dma,
> > +               ._free_dma = vdma_nop,
> > +               ._get_dma_residue = vdma_get_dma_residue,
> > +               ._dma_mem_alloc = vdma_mem_alloc,
> > +               ._dma_setup = vdma_dma_setup
> >         }
> >  };
> >
> > diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
> > index 77db561..927c396 100644
> > --- a/arch/x86/include/asm/paravirt_types.h
> > +++ b/arch/x86/include/asm/paravirt_types.h
> > @@ -89,7 +89,7 @@ struct pv_init_ops {
> >          */
> >         unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
> >                           unsigned long addr, unsigned len);
> > -};
> > +} __no_randomize_layout;
> >
> >
> >  struct pv_lazy_ops {
> > @@ -97,12 +97,12 @@ struct pv_lazy_ops {
> >         void (*enter)(void);
> >         void (*leave)(void);
> >         void (*flush)(void);
> > -};
> > +} __no_randomize_layout;
> >
> >  struct pv_time_ops {
> >         unsigned long long (*sched_clock)(void);
> >         unsigned long long (*steal_clock)(int cpu);
> > -};
> > +} __no_randomize_layout;
> >
> >  struct pv_cpu_ops {
> >         /* hooks for various privileged instructions */
> > @@ -178,7 +178,7 @@ struct pv_cpu_ops {
> >
> >         void (*start_context_switch)(struct task_struct *prev);
> >         void (*end_context_switch)(struct task_struct *next);
> > -};
> > +} __no_randomize_layout;
> >
> >  struct pv_irq_ops {
> >         /*
> > @@ -201,7 +201,7 @@ struct pv_irq_ops {
> >  #ifdef CONFIG_X86_64
> >         void (*adjust_exception_frame)(void);
> >  #endif
> > -};
> > +} __no_randomize_layout;
> >
> >  struct pv_mmu_ops {
> >         unsigned long (*read_cr2)(void);
> > @@ -296,7 +296,7 @@ struct pv_mmu_ops {
> >            an mfn.  We can tell which is which from the index. */
> >         void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
> >                            phys_addr_t phys, pgprot_t flags);
> > -};
> > +} __no_randomize_layout;
> >
> >  struct arch_spinlock;
> >  #ifdef CONFIG_SMP
> > @@ -322,7 +322,9 @@ struct pv_lock_ops {
> >
> >  /* This contains all the paravirt structures: we get a convenient
> >   * number for each function using the offset which we use to indicate
> > - * what to patch. */
> > + * what to patch.
> > + * shouldn't be randomized due to the "NEAT TRICK" in paravirt.c
> > + */
> >  struct paravirt_patch_template {
> >         struct pv_init_ops pv_init_ops;
> >         struct pv_time_ops pv_time_ops;
> > @@ -330,7 +332,7 @@ struct paravirt_patch_template {
> >         struct pv_irq_ops pv_irq_ops;
> >         struct pv_mmu_ops pv_mmu_ops;
> >         struct pv_lock_ops pv_lock_ops;
> > -};
> > +} __no_randomize_layout;
> >
> >  extern struct pv_info pv_info;
> >  extern struct pv_init_ops pv_init_ops;
> > diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
> > index f76e0ea..4b83315 100644
> > --- a/drivers/acpi/acpica/hwxfsleep.c
> > +++ b/drivers/acpi/acpica/hwxfsleep.c
> > @@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
> >  /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
> >
> >  static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
> > -        acpi_hw_extended_sleep},
> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
> > -        acpi_hw_extended_wake_prep},
> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake}
> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
> > +        .extended_function = acpi_hw_extended_sleep},
> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
> > +        .extended_function = acpi_hw_extended_wake_prep},
> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake),
> > +        .extended_function = acpi_hw_extended_wake}
> >  };
> >
> >  /*
> > diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
> > index 7fda30e..428766d 100644
> > --- a/drivers/block/cciss.h
> > +++ b/drivers/block/cciss.h
> > @@ -402,27 +402,27 @@ static bool SA5_performant_intr_pending(ctlr_info_t *h)
> >  }
> >
> >  static struct access_method SA5_access = {
> > -       SA5_submit_command,
> > -       SA5_intr_mask,
> > -       SA5_fifo_full,
> > -       SA5_intr_pending,
> > -       SA5_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_intr_mask,
> > +       .fifo_full = SA5_fifo_full,
> > +       .intr_pending = SA5_intr_pending,
> > +       .command_completed = SA5_completed,
> >  };
> >
> >  static struct access_method SA5B_access = {
> > -        SA5_submit_command,
> > -        SA5B_intr_mask,
> > -        SA5_fifo_full,
> > -        SA5B_intr_pending,
> > -        SA5_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5B_intr_mask,
> > +       .fifo_full = SA5_fifo_full,
> > +       .intr_pending = SA5B_intr_pending,
> > +       .command_completed = SA5_completed,
> >  };
> >
> >  static struct access_method SA5_performant_access = {
> > -       SA5_submit_command,
> > -       SA5_performant_intr_mask,
> > -       SA5_fifo_full,
> > -       SA5_performant_intr_pending,
> > -       SA5_performant_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .fifo_full = SA5_fifo_full,
> > +       .intr_pending = SA5_performant_intr_pending,
> > +       .command_completed = SA5_performant_completed,
> >  };
> >
> >  struct board_type {
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> > index d2e7d20..7bbe51f 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> > @@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
> >  }
> >
> >  const struct ttm_mem_type_manager_func nouveau_vram_manager = {
> > -       nouveau_vram_manager_init,
> > -       nouveau_vram_manager_fini,
> > -       nouveau_vram_manager_new,
> > -       nouveau_vram_manager_del,
> > +       .init = nouveau_vram_manager_init,
> > +       .takedown = nouveau_vram_manager_fini,
> > +       .get_node = nouveau_vram_manager_new,
> > +       .put_node = nouveau_vram_manager_del,
> >  };
> >
> >  static int
> > @@ -183,11 +183,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
> >  }
> >
> >  const struct ttm_mem_type_manager_func nouveau_gart_manager = {
> > -       nouveau_gart_manager_init,
> > -       nouveau_gart_manager_fini,
> > -       nouveau_gart_manager_new,
> > -       nouveau_gart_manager_del,
> > -       nouveau_gart_manager_debug
> > +       .init = nouveau_gart_manager_init,
> > +       .takedown = nouveau_gart_manager_fini,
> > +       .get_node = nouveau_gart_manager_new,
> > +       .put_node = nouveau_gart_manager_del,
> > +       .debug = nouveau_gart_manager_debug
> >  };
> >
> >  /*XXX*/
> > @@ -256,11 +256,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
> >  }
> >
> >  const struct ttm_mem_type_manager_func nv04_gart_manager = {
> > -       nv04_gart_manager_init,
> > -       nv04_gart_manager_fini,
> > -       nv04_gart_manager_new,
> > -       nv04_gart_manager_del,
> > -       nv04_gart_manager_debug
> > +       .init = nv04_gart_manager_init,
> > +       .takedown = nv04_gart_manager_fini,
> > +       .get_node = nv04_gart_manager_new,
> > +       .put_node = nv04_gart_manager_del,
> > +       .debug = nv04_gart_manager_debug
> >  };
> >
> >  int
> > diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
> > index aa0bd05..aea6a01 100644
> > --- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
> > +++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
> > @@ -148,10 +148,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
> >  }
> >
> >  const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
> > -       ttm_bo_man_init,
> > -       ttm_bo_man_takedown,
> > -       ttm_bo_man_get_node,
> > -       ttm_bo_man_put_node,
> > -       ttm_bo_man_debug
> > +       .init = ttm_bo_man_init,
> > +       .takedown = ttm_bo_man_takedown,
> > +       .get_node = ttm_bo_man_get_node,
> > +       .put_node = ttm_bo_man_put_node,
> > +       .debug = ttm_bo_man_debug
> >  };
> >  EXPORT_SYMBOL(ttm_bo_manager_func);
> > diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
> > index 9fd924c..e5ec4ef 100644
> > --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
> > +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
> > @@ -198,11 +198,11 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
> >  }
> >
> >  static const struct ttm_mem_type_manager_func virtio_gpu_bo_manager_func = {
> > -       ttm_bo_man_init,
> > -       ttm_bo_man_takedown,
> > -       ttm_bo_man_get_node,
> > -       ttm_bo_man_put_node,
> > -       ttm_bo_man_debug
> > +       .init = ttm_bo_man_init,
> > +       .takedown = ttm_bo_man_takedown,
> > +       .get_node = ttm_bo_man_get_node,
> > +       .put_node = ttm_bo_man_put_node,
> > +       .debug = ttm_bo_man_debug
> >  };
> >
> >  static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> > index 170b61b..fec7348 100644
> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> > @@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
> >  }
> >
> >  const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
> > -       vmw_gmrid_man_init,
> > -       vmw_gmrid_man_takedown,
> > -       vmw_gmrid_man_get_node,
> > -       vmw_gmrid_man_put_node,
> > -       vmw_gmrid_man_debug
> > +       .init = vmw_gmrid_man_init,
> > +       .takedown = vmw_gmrid_man_takedown,
> > +       .get_node = vmw_gmrid_man_get_node,
> > +       .put_node = vmw_gmrid_man_put_node,
> > +       .debug = vmw_gmrid_man_debug
> >  };
> > diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
> > index cb9f0f2..8b1f654 100644
> > --- a/drivers/infiniband/hw/nes/nes_cm.c
> > +++ b/drivers/infiniband/hw/nes/nes_cm.c
> > @@ -135,17 +135,17 @@ static void record_ird_ord(struct nes_cm_node *, u16, u16);
> >  /* instance of function pointers for client API */
> >  /* set address of this instance to cm_core->cm_ops at cm_core alloc */
> >  static const struct nes_cm_ops nes_cm_api = {
> > -       mini_cm_accelerated,
> > -       mini_cm_listen,
> > -       mini_cm_del_listen,
> > -       mini_cm_connect,
> > -       mini_cm_close,
> > -       mini_cm_accept,
> > -       mini_cm_reject,
> > -       mini_cm_recv_pkt,
> > -       mini_cm_dealloc_core,
> > -       mini_cm_get,
> > -       mini_cm_set
> > +       .accelerated = mini_cm_accelerated,
> > +       .listen = mini_cm_listen,
> > +       .stop_listener = mini_cm_del_listen,
> > +       .connect = mini_cm_connect,
> > +       .close = mini_cm_close,
> > +       .accept = mini_cm_accept,
> > +       .reject = mini_cm_reject,
> > +       .recv_pkt = mini_cm_recv_pkt,
> > +       .destroy_cm_core = mini_cm_dealloc_core,
> > +       .get = mini_cm_get,
> > +       .set = mini_cm_set
> >  };
> >
> >  static struct nes_cm_core *g_cm_core;
> > diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
> > index aecec6d..11e13c5 100644
> > --- a/drivers/isdn/gigaset/bas-gigaset.c
> > +++ b/drivers/isdn/gigaset/bas-gigaset.c
> > @@ -2565,22 +2565,22 @@ static int gigaset_post_reset(struct usb_interface *intf)
> >
> >
> >  static const struct gigaset_ops gigops = {
> > -       gigaset_write_cmd,
> > -       gigaset_write_room,
> > -       gigaset_chars_in_buffer,
> > -       gigaset_brkchars,
> > -       gigaset_init_bchannel,
> > -       gigaset_close_bchannel,
> > -       gigaset_initbcshw,
> > -       gigaset_freebcshw,
> > -       gigaset_reinitbcshw,
> > -       gigaset_initcshw,
> > -       gigaset_freecshw,
> > -       gigaset_set_modem_ctrl,
> > -       gigaset_baud_rate,
> > -       gigaset_set_line_ctrl,
> > -       gigaset_isoc_send_skb,
> > -       gigaset_isoc_input,
> > +       .write_cmd = gigaset_write_cmd,
> > +       .write_room = gigaset_write_room,
> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> > +       .brkchars = gigaset_brkchars,
> > +       .init_bchannel = gigaset_init_bchannel,
> > +       .close_bchannel = gigaset_close_bchannel,
> > +       .initbcshw = gigaset_initbcshw,
> > +       .freebcshw = gigaset_freebcshw,
> > +       .reinitbcshw = gigaset_reinitbcshw,
> > +       .initcshw = gigaset_initcshw,
> > +       .freecshw = gigaset_freecshw,
> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> > +       .baud_rate = gigaset_baud_rate,
> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> > +       .send_skb = gigaset_isoc_send_skb,
> > +       .handle_input = gigaset_isoc_input,
> >  };
> >
> >  /* bas_gigaset_init
> > diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
> > index d1f8ab9..c0412f2 100644
> > --- a/drivers/isdn/gigaset/ser-gigaset.c
> > +++ b/drivers/isdn/gigaset/ser-gigaset.c
> > @@ -445,22 +445,22 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
> >  }
> >
> >  static const struct gigaset_ops ops = {
> > -       gigaset_write_cmd,
> > -       gigaset_write_room,
> > -       gigaset_chars_in_buffer,
> > -       gigaset_brkchars,
> > -       gigaset_init_bchannel,
> > -       gigaset_close_bchannel,
> > -       gigaset_initbcshw,
> > -       gigaset_freebcshw,
> > -       gigaset_reinitbcshw,
> > -       gigaset_initcshw,
> > -       gigaset_freecshw,
> > -       gigaset_set_modem_ctrl,
> > -       gigaset_baud_rate,
> > -       gigaset_set_line_ctrl,
> > -       gigaset_m10x_send_skb,  /* asyncdata.c */
> > -       gigaset_m10x_input,     /* asyncdata.c */
> > +       .write_cmd = gigaset_write_cmd,
> > +       .write_room = gigaset_write_room,
> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> > +       .brkchars = gigaset_brkchars,
> > +       .init_bchannel = gigaset_init_bchannel,
> > +       .close_bchannel = gigaset_close_bchannel,
> > +       .initbcshw = gigaset_initbcshw,
> > +       .freebcshw = gigaset_freebcshw,
> > +       .reinitbcshw = gigaset_reinitbcshw,
> > +       .initcshw = gigaset_initcshw,
> > +       .freecshw = gigaset_freecshw,
> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> > +       .baud_rate = gigaset_baud_rate,
> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> > +       .send_skb = gigaset_m10x_send_skb,      /* asyncdata.c */
> > +       .handle_input = gigaset_m10x_input,     /* asyncdata.c */
> >  };
> >
> >
> > diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
> > index 5f306e2..eade36d 100644
> > --- a/drivers/isdn/gigaset/usb-gigaset.c
> > +++ b/drivers/isdn/gigaset/usb-gigaset.c
> > @@ -862,22 +862,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
> >  }
> >
> >  static const struct gigaset_ops ops = {
> > -       gigaset_write_cmd,
> > -       gigaset_write_room,
> > -       gigaset_chars_in_buffer,
> > -       gigaset_brkchars,
> > -       gigaset_init_bchannel,
> > -       gigaset_close_bchannel,
> > -       gigaset_initbcshw,
> > -       gigaset_freebcshw,
> > -       gigaset_reinitbcshw,
> > -       gigaset_initcshw,
> > -       gigaset_freecshw,
> > -       gigaset_set_modem_ctrl,
> > -       gigaset_baud_rate,
> > -       gigaset_set_line_ctrl,
> > -       gigaset_m10x_send_skb,
> > -       gigaset_m10x_input,
> > +       .write_cmd = gigaset_write_cmd,
> > +       .write_room = gigaset_write_room,
> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> > +       .brkchars = gigaset_brkchars,
> > +       .init_bchannel = gigaset_init_bchannel,
> > +       .close_bchannel = gigaset_close_bchannel,
> > +       .initbcshw = gigaset_initbcshw,
> > +       .freebcshw = gigaset_freebcshw,
> > +       .reinitbcshw = gigaset_reinitbcshw,
> > +       .initcshw = gigaset_initcshw,
> > +       .freecshw = gigaset_freecshw,
> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> > +       .baud_rate = gigaset_baud_rate,
> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> > +       .send_skb = gigaset_m10x_send_skb,
> > +       .handle_input = gigaset_m10x_input,
> >  };
> >
> >  /*
> > diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
> > index 91d5730..336523e 100644
> > --- a/drivers/isdn/i4l/isdn_concap.c
> > +++ b/drivers/isdn/i4l/isdn_concap.c
> > @@ -80,9 +80,9 @@ static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
> >  }
> >
> >  struct concap_device_ops isdn_concap_reliable_dl_dops = {
> > -       &isdn_concap_dl_data_req,
> > -       &isdn_concap_dl_connect_req,
> > -       &isdn_concap_dl_disconn_req
> > +       .data_req = &isdn_concap_dl_data_req,
> > +       .connect_req = &isdn_concap_dl_connect_req,
> > +       .disconn_req = &isdn_concap_dl_disconn_req
> >  };
> >
> >  /* The following should better go into a dedicated source file such that
> > diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
> > index e2d4e58..40cd045 100644
> > --- a/drivers/isdn/i4l/isdn_x25iface.c
> > +++ b/drivers/isdn/i4l/isdn_x25iface.c
> > @@ -53,14 +53,14 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *);
> >
> >
> >  static struct concap_proto_ops ix25_pops = {
> > -       &isdn_x25iface_proto_new,
> > -       &isdn_x25iface_proto_del,
> > -       &isdn_x25iface_proto_restart,
> > -       &isdn_x25iface_proto_close,
> > -       &isdn_x25iface_xmit,
> > -       &isdn_x25iface_receive,
> > -       &isdn_x25iface_connect_ind,
> > -       &isdn_x25iface_disconn_ind
> > +       .proto_new = &isdn_x25iface_proto_new,
> > +       .proto_del = &isdn_x25iface_proto_del,
> > +       .restart = &isdn_x25iface_proto_restart,
> > +       .close = &isdn_x25iface_proto_close,
> > +       .encap_and_xmit = &isdn_x25iface_xmit,
> > +       .data_ind = &isdn_x25iface_receive,
> > +       .connect_ind = &isdn_x25iface_connect_ind,
> > +       .disconn_ind = &isdn_x25iface_disconn_ind
> >  };
> >
> >  /* error message helper function */
> > diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
> > index 4a37a1c..7e82dfd 100644
> > --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> > +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> > @@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
> >
> >  int solo_g723_init(struct solo_dev *solo_dev)
> >  {
> > -       static struct snd_device_ops ops = { NULL };
> > +       static struct snd_device_ops ops = { };
> >         struct snd_card *card;
> >         struct snd_kcontrol_new kctl;
> >         char name[32];
> > diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c
> > index 4e5c387..bba8173 100644
> > --- a/drivers/net/ethernet/brocade/bna/bna_enet.c
> > +++ b/drivers/net/ethernet/brocade/bna/bna_enet.c
> > @@ -1676,10 +1676,10 @@ bna_cb_ioceth_reset(void *arg)
> >  }
> >
> >  static struct bfa_ioc_cbfn bna_ioceth_cbfn = {
> > -       bna_cb_ioceth_enable,
> > -       bna_cb_ioceth_disable,
> > -       bna_cb_ioceth_hbfail,
> > -       bna_cb_ioceth_reset
> > +       .enable_cbfn = bna_cb_ioceth_enable,
> > +       .disable_cbfn = bna_cb_ioceth_disable,
> > +       .hbfail_cbfn = bna_cb_ioceth_hbfail,
> > +       .reset_cbfn = bna_cb_ioceth_reset
> >  };
> >
> >  static void bna_attr_init(struct bna_ioceth *ioceth)
> > diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
> > index 5920c99..ff2e4a5 100644
> > --- a/drivers/net/wan/lmc/lmc_media.c
> > +++ b/drivers/net/wan/lmc/lmc_media.c
> > @@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int);
> >  static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
> >
> >  lmc_media_t lmc_ds3_media = {
> > -  lmc_ds3_init,                        /* special media init stuff */
> > -  lmc_ds3_default,             /* reset to default state */
> > -  lmc_ds3_set_status,          /* reset status to state provided */
> > -  lmc_dummy_set_1,             /* set clock source */
> > -  lmc_dummy_set2_1,            /* set line speed */
> > -  lmc_ds3_set_100ft,           /* set cable length */
> > -  lmc_ds3_set_scram,           /* set scrambler */
> > -  lmc_ds3_get_link_status,     /* get link status */
> > -  lmc_dummy_set_1,             /* set link status */
> > -  lmc_ds3_set_crc_length,      /* set CRC length */
> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> > -  lmc_ds3_watchdog
> > +  .init = lmc_ds3_init,                                /* special media init stuff */
> > +  .defaults = lmc_ds3_default,                 /* reset to default state */
> > +  .set_status = lmc_ds3_set_status,            /* reset status to state provided */
> > +  .set_clock_source = lmc_dummy_set_1,         /* set clock source */
> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> > +  .set_cable_length = lmc_ds3_set_100ft,       /* set cable length */
> > +  .set_scrambler = lmc_ds3_set_scram,          /* set scrambler */
> > +  .get_link_status = lmc_ds3_get_link_status,  /* get link status */
> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
> > +  .set_crc_length = lmc_ds3_set_crc_length,    /* set CRC length */
> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> > +  .watchdog = lmc_ds3_watchdog
> >  };
> >
> >  lmc_media_t lmc_hssi_media = {
> > -  lmc_hssi_init,               /* special media init stuff */
> > -  lmc_hssi_default,            /* reset to default state */
> > -  lmc_hssi_set_status,         /* reset status to state provided */
> > -  lmc_hssi_set_clock,          /* set clock source */
> > -  lmc_dummy_set2_1,            /* set line speed */
> > -  lmc_dummy_set_1,             /* set cable length */
> > -  lmc_dummy_set_1,             /* set scrambler */
> > -  lmc_hssi_get_link_status,    /* get link status */
> > -  lmc_hssi_set_link_status,    /* set link status */
> > -  lmc_hssi_set_crc_length,     /* set CRC length */
> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> > -  lmc_hssi_watchdog
> > +  .init = lmc_hssi_init,                       /* special media init stuff */
> > +  .defaults = lmc_hssi_default,                        /* reset to default state */
> > +  .set_status = lmc_hssi_set_status,           /* reset status to state provided */
> > +  .set_clock_source = lmc_hssi_set_clock,      /* set clock source */
> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> > +  .get_link_status = lmc_hssi_get_link_status, /* get link status */
> > +  .set_link_status = lmc_hssi_set_link_status, /* set link status */
> > +  .set_crc_length = lmc_hssi_set_crc_length,   /* set CRC length */
> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> > +  .watchdog = lmc_hssi_watchdog
> >  };
> >
> > -lmc_media_t lmc_ssi_media = { lmc_ssi_init,    /* special media init stuff */
> > -  lmc_ssi_default,             /* reset to default state */
> > -  lmc_ssi_set_status,          /* reset status to state provided */
> > -  lmc_ssi_set_clock,           /* set clock source */
> > -  lmc_ssi_set_speed,           /* set line speed */
> > -  lmc_dummy_set_1,             /* set cable length */
> > -  lmc_dummy_set_1,             /* set scrambler */
> > -  lmc_ssi_get_link_status,     /* get link status */
> > -  lmc_ssi_set_link_status,     /* set link status */
> > -  lmc_ssi_set_crc_length,      /* set CRC length */
> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> > -  lmc_ssi_watchdog
> > +lmc_media_t lmc_ssi_media = {
> > +  .init = lmc_ssi_init,                                /* special media init stuff */
> > +  .defaults = lmc_ssi_default,                 /* reset to default state */
> > +  .set_status = lmc_ssi_set_status,            /* reset status to state provided */
> > +  .set_clock_source = lmc_ssi_set_clock,       /* set clock source */
> > +  .set_speed = lmc_ssi_set_speed,              /* set line speed */
> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> > +  .get_link_status = lmc_ssi_get_link_status,  /* get link status */
> > +  .set_link_status = lmc_ssi_set_link_status,  /* set link status */
> > +  .set_crc_length = lmc_ssi_set_crc_length,    /* set CRC length */
> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> > +  .watchdog = lmc_ssi_watchdog
> >  };
> >
> >  lmc_media_t lmc_t1_media = {
> > -  lmc_t1_init,                 /* special media init stuff */
> > -  lmc_t1_default,              /* reset to default state */
> > -  lmc_t1_set_status,           /* reset status to state provided */
> > -  lmc_t1_set_clock,            /* set clock source */
> > -  lmc_dummy_set2_1,            /* set line speed */
> > -  lmc_dummy_set_1,             /* set cable length */
> > -  lmc_dummy_set_1,             /* set scrambler */
> > -  lmc_t1_get_link_status,      /* get link status */
> > -  lmc_dummy_set_1,             /* set link status */
> > -  lmc_t1_set_crc_length,       /* set CRC length */
> > -  lmc_t1_set_circuit_type,     /* set T1 or E1 circuit type */
> > -  lmc_t1_watchdog
> > +  .init = lmc_t1_init,                         /* special media init stuff */
> > +  .defaults = lmc_t1_default,                  /* reset to default state */
> > +  .set_status = lmc_t1_set_status,             /* reset status to state provided */
> > +  .set_clock_source = lmc_t1_set_clock,                /* set clock source */
> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> > +  .get_link_status = lmc_t1_get_link_status,   /* get link status */
> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
> > +  .set_crc_length = lmc_t1_set_crc_length,     /* set CRC length */
> > +  .set_circuit_type = lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
> > +  .watchdog = lmc_t1_watchdog
> >  };
> >
> >  static void
> > diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
> > index 1e7e139..c2031dd 100644
> > --- a/drivers/scsi/bfa/bfa_fcs.c
> > +++ b/drivers/scsi/bfa/bfa_fcs.c
> > @@ -39,10 +39,21 @@ struct bfa_fcs_mod_s {
> >  #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
> >
> >  static struct bfa_fcs_mod_s fcs_modules[] = {
> > -       { bfa_fcs_port_attach, NULL, NULL },
> > -       { bfa_fcs_uf_attach, NULL, NULL },
> > -       { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
> > -         bfa_fcs_fabric_modexit },
> > +       {
> > +               .attach = bfa_fcs_port_attach,
> > +               .modinit = NULL,
> > +               .modexit = NULL
> > +       },
> > +       {
> > +               .attach = bfa_fcs_uf_attach,
> > +               .modinit = NULL,
> > +               .modexit = NULL
> > +       },
> > +       {
> > +               .attach = bfa_fcs_fabric_attach,
> > +               .modinit = bfa_fcs_fabric_modinit,
> > +               .modexit = bfa_fcs_fabric_modexit
> > +       },
> >  };
> >
> >  /*
> > diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
> > index 7733ad5..e5edbce 100644
> > --- a/drivers/scsi/bfa/bfa_fcs_lport.c
> > +++ b/drivers/scsi/bfa/bfa_fcs_lport.c
> > @@ -90,15 +90,26 @@ static struct {
> >         void            (*offline) (struct bfa_fcs_lport_s *port);
> >  } __port_action[] = {
> >         {
> > -       bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
> > -                       bfa_fcs_lport_unknown_offline}, {
> > -       bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
> > -                       bfa_fcs_lport_fab_offline}, {
> > -       bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
> > -                       bfa_fcs_lport_n2n_offline}, {
> > -       bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
> > -                       bfa_fcs_lport_loop_offline},
> > -       };
> > +               .init = bfa_fcs_lport_unknown_init,
> > +               .online = bfa_fcs_lport_unknown_online,
> > +               .offline = bfa_fcs_lport_unknown_offline
> > +       },
> > +       {
> > +               .init = bfa_fcs_lport_fab_init,
> > +               .online = bfa_fcs_lport_fab_online,
> > +               .offline = bfa_fcs_lport_fab_offline
> > +       },
> > +       {
> > +               .init = bfa_fcs_lport_n2n_init,
> > +               .online = bfa_fcs_lport_n2n_online,
> > +               .offline = bfa_fcs_lport_n2n_offline
> > +       },
> > +       {
> > +               .init = bfa_fcs_lport_loop_init,
> > +               .online = bfa_fcs_lport_loop_online,
> > +               .offline = bfa_fcs_lport_loop_offline
> > +       },
> > +};
> >
> >  /*
> >   *  fcs_port_sm FCS logical port state machine
> > diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
> > index 53135f2..640621b 100644
> > --- a/drivers/scsi/bfa/bfa_modules.h
> > +++ b/drivers/scsi/bfa/bfa_modules.h
> > @@ -79,12 +79,12 @@ enum {
> >                                                                         \
> >         extern struct bfa_module_s hal_mod_ ## __mod;                   \
> >         struct bfa_module_s hal_mod_ ## __mod = {                       \
> > -               bfa_ ## __mod ## _meminfo,                              \
> > -               bfa_ ## __mod ## _attach,                               \
> > -               bfa_ ## __mod ## _detach,                               \
> > -               bfa_ ## __mod ## _start,                                \
> > -               bfa_ ## __mod ## _stop,                                 \
> > -               bfa_ ## __mod ## _iocdisable,                           \
> > +               .meminfo = bfa_ ## __mod ## _meminfo,                   \
> > +               .attach = bfa_ ## __mod ## _attach,                     \
> > +               .detach = bfa_ ## __mod ## _detach,                     \
> > +               .start = bfa_ ## __mod ## _start,                       \
> > +               .stop = bfa_ ## __mod ## _stop,                         \
> > +               .iocdisable = bfa_ ## __mod ## _iocdisable,             \
> >         }
> >
> >  #define BFA_CACHELINE_SZ       (256)
> > diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
> > index fdd39fc..b734478 100644
> > --- a/drivers/scsi/hpsa.h
> > +++ b/drivers/scsi/hpsa.h
> > @@ -577,38 +577,38 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
> >  }
> >
> >  static struct access_method SA5_access = {
> > -       SA5_submit_command,
> > -       SA5_intr_mask,
> > -       SA5_intr_pending,
> > -       SA5_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_intr_mask,
> > +       .intr_pending = SA5_intr_pending,
> > +       .command_completed = SA5_completed,
> >  };
> >
> >  static struct access_method SA5_ioaccel_mode1_access = {
> > -       SA5_submit_command,
> > -       SA5_performant_intr_mask,
> > -       SA5_ioaccel_mode1_intr_pending,
> > -       SA5_ioaccel_mode1_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .intr_pending = SA5_ioaccel_mode1_intr_pending,
> > +       .command_completed = SA5_ioaccel_mode1_completed,
> >  };
> >
> >  static struct access_method SA5_ioaccel_mode2_access = {
> > -       SA5_submit_command_ioaccel2,
> > -       SA5_performant_intr_mask,
> > -       SA5_performant_intr_pending,
> > -       SA5_performant_completed,
> > +       .submit_command = SA5_submit_command_ioaccel2,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .intr_pending = SA5_performant_intr_pending,
> > +       .command_completed = SA5_performant_completed,
> >  };
> >
> >  static struct access_method SA5_performant_access = {
> > -       SA5_submit_command,
> > -       SA5_performant_intr_mask,
> > -       SA5_performant_intr_pending,
> > -       SA5_performant_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .intr_pending = SA5_performant_intr_pending,
> > +       .command_completed = SA5_performant_completed,
> >  };
> >
> >  static struct access_method SA5_performant_access_no_read = {
> > -       SA5_submit_command_no_read,
> > -       SA5_performant_intr_mask,
> > -       SA5_performant_intr_pending,
> > -       SA5_performant_completed,
> > +       .submit_command = SA5_submit_command_no_read,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .intr_pending = SA5_performant_intr_pending,
> > +       .command_completed = SA5_performant_completed,
> >  };
> >
> >  struct board_type {
> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> > index 4310154..605d035 100644
> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> > @@ -147,7 +147,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
> >         int added = (mode == LCK_NL);
> >         int overlaps = 0;
> >         int splitted = 0;
> > -       const struct ldlm_callback_suite null_cbs = { NULL };
> > +       const struct ldlm_callback_suite null_cbs = { };
> >
> >         CDEBUG(D_DLMTRACE,
> >                "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
> > diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
> > index 329d78c..9756f9e 100644
> > --- a/drivers/staging/lustre/lustre/libcfs/module.c
> > +++ b/drivers/staging/lustre/lustre/libcfs/module.c
> > @@ -322,11 +322,11 @@ out:
> >  }
> >
> >  struct cfs_psdev_ops libcfs_psdev_ops = {
> > -       libcfs_psdev_open,
> > -       libcfs_psdev_release,
> > -       NULL,
> > -       NULL,
> > -       libcfs_ioctl
> > +       .p_open = libcfs_psdev_open,
> > +       .p_close = libcfs_psdev_release,
> > +       .p_read = NULL,
> > +       .p_write = NULL,
> > +       .p_ioctl = libcfs_ioctl
> >  };
> >
> >  static int proc_call_handler(void *data, int write, loff_t *ppos,
> > diff --git a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> > index a01147f..5d896f8 100644
> > --- a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> > +++ b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> > @@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo)
> >
> >  #ifdef CONFIG_FB_MATROX_MYSTIQUE
> >  struct matrox_switch matrox_mystique = {
> > -       MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore,
> > +       .preinit = MGA1064_preinit,
> > +       .reset = MGA1064_reset,
> > +       .init = MGA1064_init,
> > +       .restore = MGA1064_restore,
> >  };
> >  EXPORT_SYMBOL(matrox_mystique);
> >  #endif
> >
> >  #ifdef CONFIG_FB_MATROX_G
> >  struct matrox_switch matrox_G100 = {
> > -       MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore,
> > +       .preinit = MGAG100_preinit,
> > +       .reset = MGAG100_reset,
> > +       .init = MGAG100_init,
> > +       .restore = MGAG100_restore,
> >  };
> >  EXPORT_SYMBOL(matrox_G100);
> >  #endif
> > diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> > index 195ad7c..09743fc 100644
> > --- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> > +++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> > @@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo)
> >  }
> >
> >  struct matrox_switch matrox_millennium = {
> > -       Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore
> > +       .preinit = Ti3026_preinit,
> > +       .reset = Ti3026_reset,
> > +       .init = Ti3026_init,
> > +       .restore = Ti3026_restore
> >  };
> >  EXPORT_SYMBOL(matrox_millennium);
> >  #endif
> > diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
> > index aca73dd..e3c558d 100644
> > --- a/fs/reiserfs/item_ops.c
> > +++ b/fs/reiserfs/item_ops.c
> > @@ -724,18 +724,18 @@ static void errcatch_print_vi(struct virtual_item *vi)
> >  }
> >
> >  static struct item_operations errcatch_ops = {
> > -       errcatch_bytes_number,
> > -       errcatch_decrement_key,
> > -       errcatch_is_left_mergeable,
> > -       errcatch_print_item,
> > -       errcatch_check_item,
> > -
> > -       errcatch_create_vi,
> > -       errcatch_check_left,
> > -       errcatch_check_right,
> > -       errcatch_part_size,
> > -       errcatch_unit_num,
> > -       errcatch_print_vi
> > +       .bytes_number = errcatch_bytes_number,
> > +       .decrement_key = errcatch_decrement_key,
> > +       .is_left_mergeable = errcatch_is_left_mergeable,
> > +       .print_item = errcatch_print_item,
> > +       .check_item = errcatch_check_item,
> > +
> > +       .create_vi = errcatch_create_vi,
> > +       .check_left = errcatch_check_left,
> > +       .check_right = errcatch_check_right,
> > +       .part_size = errcatch_part_size,
> > +       .unit_num = errcatch_unit_num,
> > +       .print_vi = errcatch_print_vi
> >  };
> >
> >  #if ! (TYPE_STAT_DATA == 0 && TYPE_INDIRECT == 1 && TYPE_DIRECT == 2 && TYPE_DIRENTRY == 3)
> > diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
> > index 14d7b83..a1edf56 100644
> > --- a/include/linux/rbtree_augmented.h
> > +++ b/include/linux/rbtree_augmented.h
> > @@ -90,7 +90,9 @@ rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new)     \
> >         old->rbaugmented = rbcompute(old);                              \
> >  }                                                                      \
> >  rbstatic const struct rb_augment_callbacks rbname = {                  \
> > -       rbname ## _propagate, rbname ## _copy, rbname ## _rotate        \
> > +       .propagate = rbname ## _propagate,                              \
> > +       .copy = rbname ## _copy,                                        \
> > +       .rotate = rbname ## _rotate                                     \
> >  };
> >
> >
> > diff --git a/lib/rbtree.c b/lib/rbtree.c
> > index 1356454..70ce6c6 100644
> > --- a/lib/rbtree.c
> > +++ b/lib/rbtree.c
> > @@ -412,7 +412,9 @@ static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {}
> >  static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {}
> >
> >  static const struct rb_augment_callbacks dummy_callbacks = {
> > -       dummy_propagate, dummy_copy, dummy_rotate
> > +       .propagate = dummy_propagate,
> > +       .copy = dummy_copy,
> > +       .rotate = dummy_rotate
> >  };
> >
> >  void rb_insert_color(struct rb_node *node, struct rb_root *root)
> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index 838ca8bb..7432a90 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -561,7 +561,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page,
> >                 __mod_zone_freepage_state(zone, (1 << order), migratetype);
> >  }
> >  #else
> > -struct page_ext_operations debug_guardpage_ops = { NULL, };
> > +struct page_ext_operations debug_guardpage_ops = { .need = NULL, .init = NULL };
> >  static inline void set_page_guard(struct zone *zone, struct page *page,
> >                                 unsigned int order, int migratetype) {}
> >  static inline void clear_page_guard(struct zone *zone, struct page *page,
> > diff --git a/net/atm/lec.c b/net/atm/lec.c
> > index cd3b379..977a3c9 100644
> > --- a/net/atm/lec.c
> > +++ b/net/atm/lec.c
> > @@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
> >  }
> >
> >  static struct lane2_ops lane2_ops = {
> > -       lane2_resolve,          /* resolve,             spec 3.1.3 */
> > -       lane2_associate_req,    /* associate_req,       spec 3.1.4 */
> > -       NULL                    /* associate indicator, spec 3.1.5 */
> > +       .resolve = lane2_resolve,
> > +       .associate_req = lane2_associate_req,
> > +       .associate_indicator = NULL
> >  };
> >
> >  static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
> > diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
> > index 9e60e74..637c96e 100644
> > --- a/net/atm/mpoa_caches.c
> > +++ b/net/atm/mpoa_caches.c
> > @@ -535,30 +535,29 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
> >
> >
> >  static const struct in_cache_ops ingress_ops = {
> > -       in_cache_add_entry,               /* add_entry       */
> > -       in_cache_get,                     /* get             */
> > -       in_cache_get_with_mask,           /* get_with_mask   */
> > -       in_cache_get_by_vcc,              /* get_by_vcc      */
> > -       in_cache_put,                     /* put             */
> > -       in_cache_remove_entry,            /* remove_entry    */
> > -       cache_hit,                        /* cache_hit       */
> > -       clear_count_and_expired,          /* clear_count     */
> > -       check_resolving_entries,          /* check_resolving */
> > -       refresh_entries,                  /* refresh         */
> > -       in_destroy_cache                  /* destroy_cache   */
> > +       .add_entry = in_cache_add_entry,
> > +       .get = in_cache_get,
> > +       .get_with_mask = in_cache_get_with_mask,
> > +       .get_by_vcc = in_cache_get_by_vcc,
> > +       .put = in_cache_put,
> > +       .remove_entry = in_cache_remove_entry,
> > +       .cache_hit = cache_hit,
> > +       .clear_count = clear_count_and_expired,
> > +       .check_resolving = check_resolving_entries,
> > +       .refresh = refresh_entries,
> >  };
> >
> >  static const struct eg_cache_ops egress_ops = {
> > -       eg_cache_add_entry,               /* add_entry        */
> > -       eg_cache_get_by_cache_id,         /* get_by_cache_id  */
> > -       eg_cache_get_by_tag,              /* get_by_tag       */
> > -       eg_cache_get_by_vcc,              /* get_by_vcc       */
> > -       eg_cache_get_by_src_ip,           /* get_by_src_ip    */
> > -       eg_cache_put,                     /* put              */
> > -       eg_cache_remove_entry,            /* remove_entry     */
> > -       update_eg_cache_entry,            /* update           */
> > -       clear_expired,                    /* clear_expired    */
> > -       eg_destroy_cache                  /* destroy_cache    */
> > +       .add_entry = eg_cache_add_entry,
> > +       .get_by_cache_id = eg_cache_get_by_cache_id,
> > +       .get_by_tag = eg_cache_get_by_tag,
> > +       .get_by_vcc = eg_cache_get_by_vcc,
> > +       .get_by_src_ip = eg_cache_get_by_src_ip,
> > +       .put = eg_cache_put,
> > +       .remove_entry = eg_cache_remove_entry,
> > +       .update = update_eg_cache_entry,
> > +       .clear_expired = clear_expired,
> > +       .destroy_cache = eg_destroy_cache
> >  };
> >
> >
> > diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
> > index fd8cf02..1406db4 100644
> > --- a/net/vmw_vsock/vmci_transport_notify.c
> > +++ b/net/vmw_vsock/vmci_transport_notify.c
> > @@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
> >
> >  /* Socket control packet based operations. */
> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
> > -       vmci_transport_notify_pkt_socket_init,
> > -       vmci_transport_notify_pkt_socket_destruct,
> > -       vmci_transport_notify_pkt_poll_in,
> > -       vmci_transport_notify_pkt_poll_out,
> > -       vmci_transport_notify_pkt_handle_pkt,
> > -       vmci_transport_notify_pkt_recv_init,
> > -       vmci_transport_notify_pkt_recv_pre_block,
> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
> > -       vmci_transport_notify_pkt_recv_post_dequeue,
> > -       vmci_transport_notify_pkt_send_init,
> > -       vmci_transport_notify_pkt_send_pre_block,
> > -       vmci_transport_notify_pkt_send_pre_enqueue,
> > -       vmci_transport_notify_pkt_send_post_enqueue,
> > -       vmci_transport_notify_pkt_process_request,
> > -       vmci_transport_notify_pkt_process_negotiate,
> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
> > +       .send_init = vmci_transport_notify_pkt_send_init,
> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
> > +       .process_request = vmci_transport_notify_pkt_process_request,
> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
> >  };
> > diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
> > index 21e591d..f3a0afc 100644
> > --- a/net/vmw_vsock/vmci_transport_notify_qstate.c
> > +++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
> > @@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue(
> >
> >  /* Socket always on control packet based operations. */
> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
> > -       vmci_transport_notify_pkt_socket_init,
> > -       vmci_transport_notify_pkt_socket_destruct,
> > -       vmci_transport_notify_pkt_poll_in,
> > -       vmci_transport_notify_pkt_poll_out,
> > -       vmci_transport_notify_pkt_handle_pkt,
> > -       vmci_transport_notify_pkt_recv_init,
> > -       vmci_transport_notify_pkt_recv_pre_block,
> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
> > -       vmci_transport_notify_pkt_recv_post_dequeue,
> > -       vmci_transport_notify_pkt_send_init,
> > -       vmci_transport_notify_pkt_send_pre_block,
> > -       vmci_transport_notify_pkt_send_pre_enqueue,
> > -       vmci_transport_notify_pkt_send_post_enqueue,
> > -       vmci_transport_notify_pkt_process_request,
> > -       vmci_transport_notify_pkt_process_negotiate,
> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
> > +       .send_init = vmci_transport_notify_pkt_send_init,
> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
> > +       .process_request = vmci_transport_notify_pkt_process_request,
> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
> >  };
> > diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
> > index a020920..55579f6 100644
> > --- a/sound/synth/emux/emux_seq.c
> > +++ b/sound/synth/emux/emux_seq.c
> > @@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
> >   * MIDI emulation operators
> >   */
> >  static struct snd_midi_op emux_ops = {
> > -       snd_emux_note_on,
> > -       snd_emux_note_off,
> > -       snd_emux_key_press,
> > -       snd_emux_terminate_note,
> > -       snd_emux_control,
> > -       snd_emux_nrpn,
> > -       snd_emux_sysex,
> > +       .note_on = snd_emux_note_on,
> > +       .note_off = snd_emux_note_off,
> > +       .key_press = snd_emux_key_press,
> > +       .note_terminate = snd_emux_terminate_note,
> > +       .control = snd_emux_control,
> > +       .nrpn = snd_emux_nrpn,
> > +       .sysex = snd_emux_sysex,
> >  };
> >
> >
> > --
> > 1.9.1
> >
> 
> 
> 
> -- 
> Kees Cook
> Chrome OS & Brillo Security
> 

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

* [kernel-hardening] Re: [RFC 1/3] Add struct randomizing plugin
  2016-05-05 17:21 ` [kernel-hardening] [RFC 1/3] Add struct randomizing plugin Michael Leibowitz
@ 2016-05-05 21:00   ` Brad Spengler
  2016-05-06 21:58     ` Leibowitz, Michael
  0 siblings, 1 reply; 21+ messages in thread
From: Brad Spengler @ 2016-05-05 21:00 UTC (permalink / raw)
  To: Michael Leibowitz; +Cc: kernel-hardening, keescook, re.emese, pageexec

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

Hi Michael,

> + * Copyright (c) 2016, Intel Corporation.

Can you please describe exactly what changes of yours to my work justify claiming
Intel's copyright over even a sliver of the file?  What new expression of creativity
has Intel provided here?

Was it the whitespace changes?  The conversion of // to /* */ ?  The single typo fix?
Removing the single line that breaks the plugin when used with the constify plugin?

-Brad

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [kernel-hardening] Re: [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs
  2016-05-05 18:17   ` [kernel-hardening] " Kees Cook
  2016-05-05 19:46     ` Julia Lawall
@ 2016-05-06 12:37     ` Julia Lawall
  2016-06-13 14:32     ` Julia Lawall
  2 siblings, 0 replies; 21+ messages in thread
From: Julia Lawall @ 2016-05-06 12:37 UTC (permalink / raw)
  To: Kees Cook
  Cc: Michael Leibowitz, Brad Spengler, kernel-hardening, Emese Revfy,
	PaX Team



On Thu, 5 May 2016, Kees Cook wrote:

> On Thu, May 5, 2016 at 10:21 AM, Michael Leibowitz
> <michael.leibowitz@intel.com> wrote:
> > Due to randomization of structs, the in order struct intialization
> > style is replaced with explicit field style.
> >
> > struct foo_t my_foo = {
> >        one,
> >        two,
> >        three
> > };
> >
> > becomes
> >
> > struct foo_t my_foo = {
> >        .one = one,
> >        .two = two,
> >        .three = three
> > };
>
> Can a coccinelle script be written to do this also? It might be useful
> to keep that around.

Does randomization apply to all structures?  Only global ones?  Only those
that contain function pointers?

julia

>
> >
> > Additionally, tag paravirt related structures to explicitly not be
> > randomized, as the structure layout is important.
>
> This might need to be split out? It's logically separate. Also, I
> think this needs to come before the plugin, since the plugin isn't
> usable until this patch is in place.
>
> -Kees
>
> >
> > This feature is ported over from grsecurity.  This is largely
> > unchanged from the Original code written by the PaX Team and Spender.
> >
> > Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
> > ---
> >  arch/x86/include/asm/floppy.h                   | 20 ++---
> >  arch/x86/include/asm/paravirt_types.h           | 18 +++--
> >  drivers/acpi/acpica/hwxfsleep.c                 | 11 +--
> >  drivers/block/cciss.h                           | 30 ++++----
> >  drivers/gpu/drm/nouveau/nouveau_ttm.c           | 28 +++----
> >  drivers/gpu/drm/ttm/ttm_bo_manager.c            | 10 +--
> >  drivers/gpu/drm/virtio/virtgpu_ttm.c            | 10 +--
> >  drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   | 10 +--
> >  drivers/infiniband/hw/nes/nes_cm.c              | 22 +++---
> >  drivers/isdn/gigaset/bas-gigaset.c              | 32 ++++----
> >  drivers/isdn/gigaset/ser-gigaset.c              | 32 ++++----
> >  drivers/isdn/gigaset/usb-gigaset.c              | 32 ++++----
> >  drivers/isdn/i4l/isdn_concap.c                  |  6 +-
> >  drivers/isdn/i4l/isdn_x25iface.c                | 16 ++--
> >  drivers/media/pci/solo6x10/solo6x10-g723.c      |  2 +-
> >  drivers/net/ethernet/brocade/bna/bna_enet.c     |  8 +-
> >  drivers/net/wan/lmc/lmc_media.c                 | 97 +++++++++++++------------
> >  drivers/scsi/bfa/bfa_fcs.c                      | 19 ++++-
> >  drivers/scsi/bfa/bfa_fcs_lport.c                | 29 +++++---
> >  drivers/scsi/bfa/bfa_modules.h                  | 12 +--
> >  drivers/scsi/hpsa.h                             | 40 +++++-----
> >  drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |  2 +-
> >  drivers/staging/lustre/lustre/libcfs/module.c   | 10 +--
> >  drivers/video/fbdev/matrox/matroxfb_DAC1064.c   | 10 ++-
> >  drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |  5 +-
> >  fs/reiserfs/item_ops.c                          | 24 +++---
> >  include/linux/rbtree_augmented.h                |  4 +-
> >  lib/rbtree.c                                    |  4 +-
> >  mm/page_alloc.c                                 |  2 +-
> >  net/atm/lec.c                                   |  6 +-
> >  net/atm/mpoa_caches.c                           | 41 +++++------
> >  net/vmw_vsock/vmci_transport_notify.c           | 30 ++++----
> >  net/vmw_vsock/vmci_transport_notify_qstate.c    | 30 ++++----
> >  sound/synth/emux/emux_seq.c                     | 14 ++--
> >  34 files changed, 352 insertions(+), 314 deletions(-)
> >
> > diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
> > index 1c7eefe..d0e4702 100644
> > --- a/arch/x86/include/asm/floppy.h
> > +++ b/arch/x86/include/asm/floppy.h
> > @@ -229,18 +229,18 @@ static struct fd_routine_l {
> >         int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
> >  } fd_routine[] = {
> >         {
> > -               request_dma,
> > -               free_dma,
> > -               get_dma_residue,
> > -               dma_mem_alloc,
> > -               hard_dma_setup
> > +               ._request_dma = request_dma,
> > +               ._free_dma = free_dma,
> > +               ._get_dma_residue = get_dma_residue,
> > +               ._dma_mem_alloc = dma_mem_alloc,
> > +               ._dma_setup = hard_dma_setup
> >         },
> >         {
> > -               vdma_request_dma,
> > -               vdma_nop,
> > -               vdma_get_dma_residue,
> > -               vdma_mem_alloc,
> > -               vdma_dma_setup
> > +               ._request_dma = vdma_request_dma,
> > +               ._free_dma = vdma_nop,
> > +               ._get_dma_residue = vdma_get_dma_residue,
> > +               ._dma_mem_alloc = vdma_mem_alloc,
> > +               ._dma_setup = vdma_dma_setup
> >         }
> >  };
> >
> > diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
> > index 77db561..927c396 100644
> > --- a/arch/x86/include/asm/paravirt_types.h
> > +++ b/arch/x86/include/asm/paravirt_types.h
> > @@ -89,7 +89,7 @@ struct pv_init_ops {
> >          */
> >         unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
> >                           unsigned long addr, unsigned len);
> > -};
> > +} __no_randomize_layout;
> >
> >
> >  struct pv_lazy_ops {
> > @@ -97,12 +97,12 @@ struct pv_lazy_ops {
> >         void (*enter)(void);
> >         void (*leave)(void);
> >         void (*flush)(void);
> > -};
> > +} __no_randomize_layout;
> >
> >  struct pv_time_ops {
> >         unsigned long long (*sched_clock)(void);
> >         unsigned long long (*steal_clock)(int cpu);
> > -};
> > +} __no_randomize_layout;
> >
> >  struct pv_cpu_ops {
> >         /* hooks for various privileged instructions */
> > @@ -178,7 +178,7 @@ struct pv_cpu_ops {
> >
> >         void (*start_context_switch)(struct task_struct *prev);
> >         void (*end_context_switch)(struct task_struct *next);
> > -};
> > +} __no_randomize_layout;
> >
> >  struct pv_irq_ops {
> >         /*
> > @@ -201,7 +201,7 @@ struct pv_irq_ops {
> >  #ifdef CONFIG_X86_64
> >         void (*adjust_exception_frame)(void);
> >  #endif
> > -};
> > +} __no_randomize_layout;
> >
> >  struct pv_mmu_ops {
> >         unsigned long (*read_cr2)(void);
> > @@ -296,7 +296,7 @@ struct pv_mmu_ops {
> >            an mfn.  We can tell which is which from the index. */
> >         void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
> >                            phys_addr_t phys, pgprot_t flags);
> > -};
> > +} __no_randomize_layout;
> >
> >  struct arch_spinlock;
> >  #ifdef CONFIG_SMP
> > @@ -322,7 +322,9 @@ struct pv_lock_ops {
> >
> >  /* This contains all the paravirt structures: we get a convenient
> >   * number for each function using the offset which we use to indicate
> > - * what to patch. */
> > + * what to patch.
> > + * shouldn't be randomized due to the "NEAT TRICK" in paravirt.c
> > + */
> >  struct paravirt_patch_template {
> >         struct pv_init_ops pv_init_ops;
> >         struct pv_time_ops pv_time_ops;
> > @@ -330,7 +332,7 @@ struct paravirt_patch_template {
> >         struct pv_irq_ops pv_irq_ops;
> >         struct pv_mmu_ops pv_mmu_ops;
> >         struct pv_lock_ops pv_lock_ops;
> > -};
> > +} __no_randomize_layout;
> >
> >  extern struct pv_info pv_info;
> >  extern struct pv_init_ops pv_init_ops;
> > diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
> > index f76e0ea..4b83315 100644
> > --- a/drivers/acpi/acpica/hwxfsleep.c
> > +++ b/drivers/acpi/acpica/hwxfsleep.c
> > @@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
> >  /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
> >
> >  static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
> > -        acpi_hw_extended_sleep},
> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
> > -        acpi_hw_extended_wake_prep},
> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake}
> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
> > +        .extended_function = acpi_hw_extended_sleep},
> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
> > +        .extended_function = acpi_hw_extended_wake_prep},
> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake),
> > +        .extended_function = acpi_hw_extended_wake}
> >  };
> >
> >  /*
> > diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
> > index 7fda30e..428766d 100644
> > --- a/drivers/block/cciss.h
> > +++ b/drivers/block/cciss.h
> > @@ -402,27 +402,27 @@ static bool SA5_performant_intr_pending(ctlr_info_t *h)
> >  }
> >
> >  static struct access_method SA5_access = {
> > -       SA5_submit_command,
> > -       SA5_intr_mask,
> > -       SA5_fifo_full,
> > -       SA5_intr_pending,
> > -       SA5_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_intr_mask,
> > +       .fifo_full = SA5_fifo_full,
> > +       .intr_pending = SA5_intr_pending,
> > +       .command_completed = SA5_completed,
> >  };
> >
> >  static struct access_method SA5B_access = {
> > -        SA5_submit_command,
> > -        SA5B_intr_mask,
> > -        SA5_fifo_full,
> > -        SA5B_intr_pending,
> > -        SA5_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5B_intr_mask,
> > +       .fifo_full = SA5_fifo_full,
> > +       .intr_pending = SA5B_intr_pending,
> > +       .command_completed = SA5_completed,
> >  };
> >
> >  static struct access_method SA5_performant_access = {
> > -       SA5_submit_command,
> > -       SA5_performant_intr_mask,
> > -       SA5_fifo_full,
> > -       SA5_performant_intr_pending,
> > -       SA5_performant_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .fifo_full = SA5_fifo_full,
> > +       .intr_pending = SA5_performant_intr_pending,
> > +       .command_completed = SA5_performant_completed,
> >  };
> >
> >  struct board_type {
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> > index d2e7d20..7bbe51f 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> > @@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
> >  }
> >
> >  const struct ttm_mem_type_manager_func nouveau_vram_manager = {
> > -       nouveau_vram_manager_init,
> > -       nouveau_vram_manager_fini,
> > -       nouveau_vram_manager_new,
> > -       nouveau_vram_manager_del,
> > +       .init = nouveau_vram_manager_init,
> > +       .takedown = nouveau_vram_manager_fini,
> > +       .get_node = nouveau_vram_manager_new,
> > +       .put_node = nouveau_vram_manager_del,
> >  };
> >
> >  static int
> > @@ -183,11 +183,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
> >  }
> >
> >  const struct ttm_mem_type_manager_func nouveau_gart_manager = {
> > -       nouveau_gart_manager_init,
> > -       nouveau_gart_manager_fini,
> > -       nouveau_gart_manager_new,
> > -       nouveau_gart_manager_del,
> > -       nouveau_gart_manager_debug
> > +       .init = nouveau_gart_manager_init,
> > +       .takedown = nouveau_gart_manager_fini,
> > +       .get_node = nouveau_gart_manager_new,
> > +       .put_node = nouveau_gart_manager_del,
> > +       .debug = nouveau_gart_manager_debug
> >  };
> >
> >  /*XXX*/
> > @@ -256,11 +256,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
> >  }
> >
> >  const struct ttm_mem_type_manager_func nv04_gart_manager = {
> > -       nv04_gart_manager_init,
> > -       nv04_gart_manager_fini,
> > -       nv04_gart_manager_new,
> > -       nv04_gart_manager_del,
> > -       nv04_gart_manager_debug
> > +       .init = nv04_gart_manager_init,
> > +       .takedown = nv04_gart_manager_fini,
> > +       .get_node = nv04_gart_manager_new,
> > +       .put_node = nv04_gart_manager_del,
> > +       .debug = nv04_gart_manager_debug
> >  };
> >
> >  int
> > diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
> > index aa0bd05..aea6a01 100644
> > --- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
> > +++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
> > @@ -148,10 +148,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
> >  }
> >
> >  const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
> > -       ttm_bo_man_init,
> > -       ttm_bo_man_takedown,
> > -       ttm_bo_man_get_node,
> > -       ttm_bo_man_put_node,
> > -       ttm_bo_man_debug
> > +       .init = ttm_bo_man_init,
> > +       .takedown = ttm_bo_man_takedown,
> > +       .get_node = ttm_bo_man_get_node,
> > +       .put_node = ttm_bo_man_put_node,
> > +       .debug = ttm_bo_man_debug
> >  };
> >  EXPORT_SYMBOL(ttm_bo_manager_func);
> > diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
> > index 9fd924c..e5ec4ef 100644
> > --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
> > +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
> > @@ -198,11 +198,11 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
> >  }
> >
> >  static const struct ttm_mem_type_manager_func virtio_gpu_bo_manager_func = {
> > -       ttm_bo_man_init,
> > -       ttm_bo_man_takedown,
> > -       ttm_bo_man_get_node,
> > -       ttm_bo_man_put_node,
> > -       ttm_bo_man_debug
> > +       .init = ttm_bo_man_init,
> > +       .takedown = ttm_bo_man_takedown,
> > +       .get_node = ttm_bo_man_get_node,
> > +       .put_node = ttm_bo_man_put_node,
> > +       .debug = ttm_bo_man_debug
> >  };
> >
> >  static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> > index 170b61b..fec7348 100644
> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> > @@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
> >  }
> >
> >  const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
> > -       vmw_gmrid_man_init,
> > -       vmw_gmrid_man_takedown,
> > -       vmw_gmrid_man_get_node,
> > -       vmw_gmrid_man_put_node,
> > -       vmw_gmrid_man_debug
> > +       .init = vmw_gmrid_man_init,
> > +       .takedown = vmw_gmrid_man_takedown,
> > +       .get_node = vmw_gmrid_man_get_node,
> > +       .put_node = vmw_gmrid_man_put_node,
> > +       .debug = vmw_gmrid_man_debug
> >  };
> > diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
> > index cb9f0f2..8b1f654 100644
> > --- a/drivers/infiniband/hw/nes/nes_cm.c
> > +++ b/drivers/infiniband/hw/nes/nes_cm.c
> > @@ -135,17 +135,17 @@ static void record_ird_ord(struct nes_cm_node *, u16, u16);
> >  /* instance of function pointers for client API */
> >  /* set address of this instance to cm_core->cm_ops at cm_core alloc */
> >  static const struct nes_cm_ops nes_cm_api = {
> > -       mini_cm_accelerated,
> > -       mini_cm_listen,
> > -       mini_cm_del_listen,
> > -       mini_cm_connect,
> > -       mini_cm_close,
> > -       mini_cm_accept,
> > -       mini_cm_reject,
> > -       mini_cm_recv_pkt,
> > -       mini_cm_dealloc_core,
> > -       mini_cm_get,
> > -       mini_cm_set
> > +       .accelerated = mini_cm_accelerated,
> > +       .listen = mini_cm_listen,
> > +       .stop_listener = mini_cm_del_listen,
> > +       .connect = mini_cm_connect,
> > +       .close = mini_cm_close,
> > +       .accept = mini_cm_accept,
> > +       .reject = mini_cm_reject,
> > +       .recv_pkt = mini_cm_recv_pkt,
> > +       .destroy_cm_core = mini_cm_dealloc_core,
> > +       .get = mini_cm_get,
> > +       .set = mini_cm_set
> >  };
> >
> >  static struct nes_cm_core *g_cm_core;
> > diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
> > index aecec6d..11e13c5 100644
> > --- a/drivers/isdn/gigaset/bas-gigaset.c
> > +++ b/drivers/isdn/gigaset/bas-gigaset.c
> > @@ -2565,22 +2565,22 @@ static int gigaset_post_reset(struct usb_interface *intf)
> >
> >
> >  static const struct gigaset_ops gigops = {
> > -       gigaset_write_cmd,
> > -       gigaset_write_room,
> > -       gigaset_chars_in_buffer,
> > -       gigaset_brkchars,
> > -       gigaset_init_bchannel,
> > -       gigaset_close_bchannel,
> > -       gigaset_initbcshw,
> > -       gigaset_freebcshw,
> > -       gigaset_reinitbcshw,
> > -       gigaset_initcshw,
> > -       gigaset_freecshw,
> > -       gigaset_set_modem_ctrl,
> > -       gigaset_baud_rate,
> > -       gigaset_set_line_ctrl,
> > -       gigaset_isoc_send_skb,
> > -       gigaset_isoc_input,
> > +       .write_cmd = gigaset_write_cmd,
> > +       .write_room = gigaset_write_room,
> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> > +       .brkchars = gigaset_brkchars,
> > +       .init_bchannel = gigaset_init_bchannel,
> > +       .close_bchannel = gigaset_close_bchannel,
> > +       .initbcshw = gigaset_initbcshw,
> > +       .freebcshw = gigaset_freebcshw,
> > +       .reinitbcshw = gigaset_reinitbcshw,
> > +       .initcshw = gigaset_initcshw,
> > +       .freecshw = gigaset_freecshw,
> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> > +       .baud_rate = gigaset_baud_rate,
> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> > +       .send_skb = gigaset_isoc_send_skb,
> > +       .handle_input = gigaset_isoc_input,
> >  };
> >
> >  /* bas_gigaset_init
> > diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
> > index d1f8ab9..c0412f2 100644
> > --- a/drivers/isdn/gigaset/ser-gigaset.c
> > +++ b/drivers/isdn/gigaset/ser-gigaset.c
> > @@ -445,22 +445,22 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
> >  }
> >
> >  static const struct gigaset_ops ops = {
> > -       gigaset_write_cmd,
> > -       gigaset_write_room,
> > -       gigaset_chars_in_buffer,
> > -       gigaset_brkchars,
> > -       gigaset_init_bchannel,
> > -       gigaset_close_bchannel,
> > -       gigaset_initbcshw,
> > -       gigaset_freebcshw,
> > -       gigaset_reinitbcshw,
> > -       gigaset_initcshw,
> > -       gigaset_freecshw,
> > -       gigaset_set_modem_ctrl,
> > -       gigaset_baud_rate,
> > -       gigaset_set_line_ctrl,
> > -       gigaset_m10x_send_skb,  /* asyncdata.c */
> > -       gigaset_m10x_input,     /* asyncdata.c */
> > +       .write_cmd = gigaset_write_cmd,
> > +       .write_room = gigaset_write_room,
> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> > +       .brkchars = gigaset_brkchars,
> > +       .init_bchannel = gigaset_init_bchannel,
> > +       .close_bchannel = gigaset_close_bchannel,
> > +       .initbcshw = gigaset_initbcshw,
> > +       .freebcshw = gigaset_freebcshw,
> > +       .reinitbcshw = gigaset_reinitbcshw,
> > +       .initcshw = gigaset_initcshw,
> > +       .freecshw = gigaset_freecshw,
> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> > +       .baud_rate = gigaset_baud_rate,
> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> > +       .send_skb = gigaset_m10x_send_skb,      /* asyncdata.c */
> > +       .handle_input = gigaset_m10x_input,     /* asyncdata.c */
> >  };
> >
> >
> > diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
> > index 5f306e2..eade36d 100644
> > --- a/drivers/isdn/gigaset/usb-gigaset.c
> > +++ b/drivers/isdn/gigaset/usb-gigaset.c
> > @@ -862,22 +862,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
> >  }
> >
> >  static const struct gigaset_ops ops = {
> > -       gigaset_write_cmd,
> > -       gigaset_write_room,
> > -       gigaset_chars_in_buffer,
> > -       gigaset_brkchars,
> > -       gigaset_init_bchannel,
> > -       gigaset_close_bchannel,
> > -       gigaset_initbcshw,
> > -       gigaset_freebcshw,
> > -       gigaset_reinitbcshw,
> > -       gigaset_initcshw,
> > -       gigaset_freecshw,
> > -       gigaset_set_modem_ctrl,
> > -       gigaset_baud_rate,
> > -       gigaset_set_line_ctrl,
> > -       gigaset_m10x_send_skb,
> > -       gigaset_m10x_input,
> > +       .write_cmd = gigaset_write_cmd,
> > +       .write_room = gigaset_write_room,
> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> > +       .brkchars = gigaset_brkchars,
> > +       .init_bchannel = gigaset_init_bchannel,
> > +       .close_bchannel = gigaset_close_bchannel,
> > +       .initbcshw = gigaset_initbcshw,
> > +       .freebcshw = gigaset_freebcshw,
> > +       .reinitbcshw = gigaset_reinitbcshw,
> > +       .initcshw = gigaset_initcshw,
> > +       .freecshw = gigaset_freecshw,
> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> > +       .baud_rate = gigaset_baud_rate,
> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> > +       .send_skb = gigaset_m10x_send_skb,
> > +       .handle_input = gigaset_m10x_input,
> >  };
> >
> >  /*
> > diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
> > index 91d5730..336523e 100644
> > --- a/drivers/isdn/i4l/isdn_concap.c
> > +++ b/drivers/isdn/i4l/isdn_concap.c
> > @@ -80,9 +80,9 @@ static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
> >  }
> >
> >  struct concap_device_ops isdn_concap_reliable_dl_dops = {
> > -       &isdn_concap_dl_data_req,
> > -       &isdn_concap_dl_connect_req,
> > -       &isdn_concap_dl_disconn_req
> > +       .data_req = &isdn_concap_dl_data_req,
> > +       .connect_req = &isdn_concap_dl_connect_req,
> > +       .disconn_req = &isdn_concap_dl_disconn_req
> >  };
> >
> >  /* The following should better go into a dedicated source file such that
> > diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
> > index e2d4e58..40cd045 100644
> > --- a/drivers/isdn/i4l/isdn_x25iface.c
> > +++ b/drivers/isdn/i4l/isdn_x25iface.c
> > @@ -53,14 +53,14 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *);
> >
> >
> >  static struct concap_proto_ops ix25_pops = {
> > -       &isdn_x25iface_proto_new,
> > -       &isdn_x25iface_proto_del,
> > -       &isdn_x25iface_proto_restart,
> > -       &isdn_x25iface_proto_close,
> > -       &isdn_x25iface_xmit,
> > -       &isdn_x25iface_receive,
> > -       &isdn_x25iface_connect_ind,
> > -       &isdn_x25iface_disconn_ind
> > +       .proto_new = &isdn_x25iface_proto_new,
> > +       .proto_del = &isdn_x25iface_proto_del,
> > +       .restart = &isdn_x25iface_proto_restart,
> > +       .close = &isdn_x25iface_proto_close,
> > +       .encap_and_xmit = &isdn_x25iface_xmit,
> > +       .data_ind = &isdn_x25iface_receive,
> > +       .connect_ind = &isdn_x25iface_connect_ind,
> > +       .disconn_ind = &isdn_x25iface_disconn_ind
> >  };
> >
> >  /* error message helper function */
> > diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
> > index 4a37a1c..7e82dfd 100644
> > --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> > +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> > @@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
> >
> >  int solo_g723_init(struct solo_dev *solo_dev)
> >  {
> > -       static struct snd_device_ops ops = { NULL };
> > +       static struct snd_device_ops ops = { };
> >         struct snd_card *card;
> >         struct snd_kcontrol_new kctl;
> >         char name[32];
> > diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c
> > index 4e5c387..bba8173 100644
> > --- a/drivers/net/ethernet/brocade/bna/bna_enet.c
> > +++ b/drivers/net/ethernet/brocade/bna/bna_enet.c
> > @@ -1676,10 +1676,10 @@ bna_cb_ioceth_reset(void *arg)
> >  }
> >
> >  static struct bfa_ioc_cbfn bna_ioceth_cbfn = {
> > -       bna_cb_ioceth_enable,
> > -       bna_cb_ioceth_disable,
> > -       bna_cb_ioceth_hbfail,
> > -       bna_cb_ioceth_reset
> > +       .enable_cbfn = bna_cb_ioceth_enable,
> > +       .disable_cbfn = bna_cb_ioceth_disable,
> > +       .hbfail_cbfn = bna_cb_ioceth_hbfail,
> > +       .reset_cbfn = bna_cb_ioceth_reset
> >  };
> >
> >  static void bna_attr_init(struct bna_ioceth *ioceth)
> > diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
> > index 5920c99..ff2e4a5 100644
> > --- a/drivers/net/wan/lmc/lmc_media.c
> > +++ b/drivers/net/wan/lmc/lmc_media.c
> > @@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int);
> >  static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
> >
> >  lmc_media_t lmc_ds3_media = {
> > -  lmc_ds3_init,                        /* special media init stuff */
> > -  lmc_ds3_default,             /* reset to default state */
> > -  lmc_ds3_set_status,          /* reset status to state provided */
> > -  lmc_dummy_set_1,             /* set clock source */
> > -  lmc_dummy_set2_1,            /* set line speed */
> > -  lmc_ds3_set_100ft,           /* set cable length */
> > -  lmc_ds3_set_scram,           /* set scrambler */
> > -  lmc_ds3_get_link_status,     /* get link status */
> > -  lmc_dummy_set_1,             /* set link status */
> > -  lmc_ds3_set_crc_length,      /* set CRC length */
> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> > -  lmc_ds3_watchdog
> > +  .init = lmc_ds3_init,                                /* special media init stuff */
> > +  .defaults = lmc_ds3_default,                 /* reset to default state */
> > +  .set_status = lmc_ds3_set_status,            /* reset status to state provided */
> > +  .set_clock_source = lmc_dummy_set_1,         /* set clock source */
> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> > +  .set_cable_length = lmc_ds3_set_100ft,       /* set cable length */
> > +  .set_scrambler = lmc_ds3_set_scram,          /* set scrambler */
> > +  .get_link_status = lmc_ds3_get_link_status,  /* get link status */
> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
> > +  .set_crc_length = lmc_ds3_set_crc_length,    /* set CRC length */
> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> > +  .watchdog = lmc_ds3_watchdog
> >  };
> >
> >  lmc_media_t lmc_hssi_media = {
> > -  lmc_hssi_init,               /* special media init stuff */
> > -  lmc_hssi_default,            /* reset to default state */
> > -  lmc_hssi_set_status,         /* reset status to state provided */
> > -  lmc_hssi_set_clock,          /* set clock source */
> > -  lmc_dummy_set2_1,            /* set line speed */
> > -  lmc_dummy_set_1,             /* set cable length */
> > -  lmc_dummy_set_1,             /* set scrambler */
> > -  lmc_hssi_get_link_status,    /* get link status */
> > -  lmc_hssi_set_link_status,    /* set link status */
> > -  lmc_hssi_set_crc_length,     /* set CRC length */
> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> > -  lmc_hssi_watchdog
> > +  .init = lmc_hssi_init,                       /* special media init stuff */
> > +  .defaults = lmc_hssi_default,                        /* reset to default state */
> > +  .set_status = lmc_hssi_set_status,           /* reset status to state provided */
> > +  .set_clock_source = lmc_hssi_set_clock,      /* set clock source */
> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> > +  .get_link_status = lmc_hssi_get_link_status, /* get link status */
> > +  .set_link_status = lmc_hssi_set_link_status, /* set link status */
> > +  .set_crc_length = lmc_hssi_set_crc_length,   /* set CRC length */
> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> > +  .watchdog = lmc_hssi_watchdog
> >  };
> >
> > -lmc_media_t lmc_ssi_media = { lmc_ssi_init,    /* special media init stuff */
> > -  lmc_ssi_default,             /* reset to default state */
> > -  lmc_ssi_set_status,          /* reset status to state provided */
> > -  lmc_ssi_set_clock,           /* set clock source */
> > -  lmc_ssi_set_speed,           /* set line speed */
> > -  lmc_dummy_set_1,             /* set cable length */
> > -  lmc_dummy_set_1,             /* set scrambler */
> > -  lmc_ssi_get_link_status,     /* get link status */
> > -  lmc_ssi_set_link_status,     /* set link status */
> > -  lmc_ssi_set_crc_length,      /* set CRC length */
> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> > -  lmc_ssi_watchdog
> > +lmc_media_t lmc_ssi_media = {
> > +  .init = lmc_ssi_init,                                /* special media init stuff */
> > +  .defaults = lmc_ssi_default,                 /* reset to default state */
> > +  .set_status = lmc_ssi_set_status,            /* reset status to state provided */
> > +  .set_clock_source = lmc_ssi_set_clock,       /* set clock source */
> > +  .set_speed = lmc_ssi_set_speed,              /* set line speed */
> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> > +  .get_link_status = lmc_ssi_get_link_status,  /* get link status */
> > +  .set_link_status = lmc_ssi_set_link_status,  /* set link status */
> > +  .set_crc_length = lmc_ssi_set_crc_length,    /* set CRC length */
> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> > +  .watchdog = lmc_ssi_watchdog
> >  };
> >
> >  lmc_media_t lmc_t1_media = {
> > -  lmc_t1_init,                 /* special media init stuff */
> > -  lmc_t1_default,              /* reset to default state */
> > -  lmc_t1_set_status,           /* reset status to state provided */
> > -  lmc_t1_set_clock,            /* set clock source */
> > -  lmc_dummy_set2_1,            /* set line speed */
> > -  lmc_dummy_set_1,             /* set cable length */
> > -  lmc_dummy_set_1,             /* set scrambler */
> > -  lmc_t1_get_link_status,      /* get link status */
> > -  lmc_dummy_set_1,             /* set link status */
> > -  lmc_t1_set_crc_length,       /* set CRC length */
> > -  lmc_t1_set_circuit_type,     /* set T1 or E1 circuit type */
> > -  lmc_t1_watchdog
> > +  .init = lmc_t1_init,                         /* special media init stuff */
> > +  .defaults = lmc_t1_default,                  /* reset to default state */
> > +  .set_status = lmc_t1_set_status,             /* reset status to state provided */
> > +  .set_clock_source = lmc_t1_set_clock,                /* set clock source */
> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> > +  .get_link_status = lmc_t1_get_link_status,   /* get link status */
> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
> > +  .set_crc_length = lmc_t1_set_crc_length,     /* set CRC length */
> > +  .set_circuit_type = lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
> > +  .watchdog = lmc_t1_watchdog
> >  };
> >
> >  static void
> > diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
> > index 1e7e139..c2031dd 100644
> > --- a/drivers/scsi/bfa/bfa_fcs.c
> > +++ b/drivers/scsi/bfa/bfa_fcs.c
> > @@ -39,10 +39,21 @@ struct bfa_fcs_mod_s {
> >  #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
> >
> >  static struct bfa_fcs_mod_s fcs_modules[] = {
> > -       { bfa_fcs_port_attach, NULL, NULL },
> > -       { bfa_fcs_uf_attach, NULL, NULL },
> > -       { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
> > -         bfa_fcs_fabric_modexit },
> > +       {
> > +               .attach = bfa_fcs_port_attach,
> > +               .modinit = NULL,
> > +               .modexit = NULL
> > +       },
> > +       {
> > +               .attach = bfa_fcs_uf_attach,
> > +               .modinit = NULL,
> > +               .modexit = NULL
> > +       },
> > +       {
> > +               .attach = bfa_fcs_fabric_attach,
> > +               .modinit = bfa_fcs_fabric_modinit,
> > +               .modexit = bfa_fcs_fabric_modexit
> > +       },
> >  };
> >
> >  /*
> > diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
> > index 7733ad5..e5edbce 100644
> > --- a/drivers/scsi/bfa/bfa_fcs_lport.c
> > +++ b/drivers/scsi/bfa/bfa_fcs_lport.c
> > @@ -90,15 +90,26 @@ static struct {
> >         void            (*offline) (struct bfa_fcs_lport_s *port);
> >  } __port_action[] = {
> >         {
> > -       bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
> > -                       bfa_fcs_lport_unknown_offline}, {
> > -       bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
> > -                       bfa_fcs_lport_fab_offline}, {
> > -       bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
> > -                       bfa_fcs_lport_n2n_offline}, {
> > -       bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
> > -                       bfa_fcs_lport_loop_offline},
> > -       };
> > +               .init = bfa_fcs_lport_unknown_init,
> > +               .online = bfa_fcs_lport_unknown_online,
> > +               .offline = bfa_fcs_lport_unknown_offline
> > +       },
> > +       {
> > +               .init = bfa_fcs_lport_fab_init,
> > +               .online = bfa_fcs_lport_fab_online,
> > +               .offline = bfa_fcs_lport_fab_offline
> > +       },
> > +       {
> > +               .init = bfa_fcs_lport_n2n_init,
> > +               .online = bfa_fcs_lport_n2n_online,
> > +               .offline = bfa_fcs_lport_n2n_offline
> > +       },
> > +       {
> > +               .init = bfa_fcs_lport_loop_init,
> > +               .online = bfa_fcs_lport_loop_online,
> > +               .offline = bfa_fcs_lport_loop_offline
> > +       },
> > +};
> >
> >  /*
> >   *  fcs_port_sm FCS logical port state machine
> > diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
> > index 53135f2..640621b 100644
> > --- a/drivers/scsi/bfa/bfa_modules.h
> > +++ b/drivers/scsi/bfa/bfa_modules.h
> > @@ -79,12 +79,12 @@ enum {
> >                                                                         \
> >         extern struct bfa_module_s hal_mod_ ## __mod;                   \
> >         struct bfa_module_s hal_mod_ ## __mod = {                       \
> > -               bfa_ ## __mod ## _meminfo,                              \
> > -               bfa_ ## __mod ## _attach,                               \
> > -               bfa_ ## __mod ## _detach,                               \
> > -               bfa_ ## __mod ## _start,                                \
> > -               bfa_ ## __mod ## _stop,                                 \
> > -               bfa_ ## __mod ## _iocdisable,                           \
> > +               .meminfo = bfa_ ## __mod ## _meminfo,                   \
> > +               .attach = bfa_ ## __mod ## _attach,                     \
> > +               .detach = bfa_ ## __mod ## _detach,                     \
> > +               .start = bfa_ ## __mod ## _start,                       \
> > +               .stop = bfa_ ## __mod ## _stop,                         \
> > +               .iocdisable = bfa_ ## __mod ## _iocdisable,             \
> >         }
> >
> >  #define BFA_CACHELINE_SZ       (256)
> > diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
> > index fdd39fc..b734478 100644
> > --- a/drivers/scsi/hpsa.h
> > +++ b/drivers/scsi/hpsa.h
> > @@ -577,38 +577,38 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
> >  }
> >
> >  static struct access_method SA5_access = {
> > -       SA5_submit_command,
> > -       SA5_intr_mask,
> > -       SA5_intr_pending,
> > -       SA5_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_intr_mask,
> > +       .intr_pending = SA5_intr_pending,
> > +       .command_completed = SA5_completed,
> >  };
> >
> >  static struct access_method SA5_ioaccel_mode1_access = {
> > -       SA5_submit_command,
> > -       SA5_performant_intr_mask,
> > -       SA5_ioaccel_mode1_intr_pending,
> > -       SA5_ioaccel_mode1_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .intr_pending = SA5_ioaccel_mode1_intr_pending,
> > +       .command_completed = SA5_ioaccel_mode1_completed,
> >  };
> >
> >  static struct access_method SA5_ioaccel_mode2_access = {
> > -       SA5_submit_command_ioaccel2,
> > -       SA5_performant_intr_mask,
> > -       SA5_performant_intr_pending,
> > -       SA5_performant_completed,
> > +       .submit_command = SA5_submit_command_ioaccel2,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .intr_pending = SA5_performant_intr_pending,
> > +       .command_completed = SA5_performant_completed,
> >  };
> >
> >  static struct access_method SA5_performant_access = {
> > -       SA5_submit_command,
> > -       SA5_performant_intr_mask,
> > -       SA5_performant_intr_pending,
> > -       SA5_performant_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .intr_pending = SA5_performant_intr_pending,
> > +       .command_completed = SA5_performant_completed,
> >  };
> >
> >  static struct access_method SA5_performant_access_no_read = {
> > -       SA5_submit_command_no_read,
> > -       SA5_performant_intr_mask,
> > -       SA5_performant_intr_pending,
> > -       SA5_performant_completed,
> > +       .submit_command = SA5_submit_command_no_read,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .intr_pending = SA5_performant_intr_pending,
> > +       .command_completed = SA5_performant_completed,
> >  };
> >
> >  struct board_type {
> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> > index 4310154..605d035 100644
> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> > @@ -147,7 +147,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
> >         int added = (mode == LCK_NL);
> >         int overlaps = 0;
> >         int splitted = 0;
> > -       const struct ldlm_callback_suite null_cbs = { NULL };
> > +       const struct ldlm_callback_suite null_cbs = { };
> >
> >         CDEBUG(D_DLMTRACE,
> >                "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
> > diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
> > index 329d78c..9756f9e 100644
> > --- a/drivers/staging/lustre/lustre/libcfs/module.c
> > +++ b/drivers/staging/lustre/lustre/libcfs/module.c
> > @@ -322,11 +322,11 @@ out:
> >  }
> >
> >  struct cfs_psdev_ops libcfs_psdev_ops = {
> > -       libcfs_psdev_open,
> > -       libcfs_psdev_release,
> > -       NULL,
> > -       NULL,
> > -       libcfs_ioctl
> > +       .p_open = libcfs_psdev_open,
> > +       .p_close = libcfs_psdev_release,
> > +       .p_read = NULL,
> > +       .p_write = NULL,
> > +       .p_ioctl = libcfs_ioctl
> >  };
> >
> >  static int proc_call_handler(void *data, int write, loff_t *ppos,
> > diff --git a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> > index a01147f..5d896f8 100644
> > --- a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> > +++ b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> > @@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo)
> >
> >  #ifdef CONFIG_FB_MATROX_MYSTIQUE
> >  struct matrox_switch matrox_mystique = {
> > -       MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore,
> > +       .preinit = MGA1064_preinit,
> > +       .reset = MGA1064_reset,
> > +       .init = MGA1064_init,
> > +       .restore = MGA1064_restore,
> >  };
> >  EXPORT_SYMBOL(matrox_mystique);
> >  #endif
> >
> >  #ifdef CONFIG_FB_MATROX_G
> >  struct matrox_switch matrox_G100 = {
> > -       MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore,
> > +       .preinit = MGAG100_preinit,
> > +       .reset = MGAG100_reset,
> > +       .init = MGAG100_init,
> > +       .restore = MGAG100_restore,
> >  };
> >  EXPORT_SYMBOL(matrox_G100);
> >  #endif
> > diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> > index 195ad7c..09743fc 100644
> > --- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> > +++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> > @@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo)
> >  }
> >
> >  struct matrox_switch matrox_millennium = {
> > -       Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore
> > +       .preinit = Ti3026_preinit,
> > +       .reset = Ti3026_reset,
> > +       .init = Ti3026_init,
> > +       .restore = Ti3026_restore
> >  };
> >  EXPORT_SYMBOL(matrox_millennium);
> >  #endif
> > diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
> > index aca73dd..e3c558d 100644
> > --- a/fs/reiserfs/item_ops.c
> > +++ b/fs/reiserfs/item_ops.c
> > @@ -724,18 +724,18 @@ static void errcatch_print_vi(struct virtual_item *vi)
> >  }
> >
> >  static struct item_operations errcatch_ops = {
> > -       errcatch_bytes_number,
> > -       errcatch_decrement_key,
> > -       errcatch_is_left_mergeable,
> > -       errcatch_print_item,
> > -       errcatch_check_item,
> > -
> > -       errcatch_create_vi,
> > -       errcatch_check_left,
> > -       errcatch_check_right,
> > -       errcatch_part_size,
> > -       errcatch_unit_num,
> > -       errcatch_print_vi
> > +       .bytes_number = errcatch_bytes_number,
> > +       .decrement_key = errcatch_decrement_key,
> > +       .is_left_mergeable = errcatch_is_left_mergeable,
> > +       .print_item = errcatch_print_item,
> > +       .check_item = errcatch_check_item,
> > +
> > +       .create_vi = errcatch_create_vi,
> > +       .check_left = errcatch_check_left,
> > +       .check_right = errcatch_check_right,
> > +       .part_size = errcatch_part_size,
> > +       .unit_num = errcatch_unit_num,
> > +       .print_vi = errcatch_print_vi
> >  };
> >
> >  #if ! (TYPE_STAT_DATA == 0 && TYPE_INDIRECT == 1 && TYPE_DIRECT == 2 && TYPE_DIRENTRY == 3)
> > diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
> > index 14d7b83..a1edf56 100644
> > --- a/include/linux/rbtree_augmented.h
> > +++ b/include/linux/rbtree_augmented.h
> > @@ -90,7 +90,9 @@ rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new)     \
> >         old->rbaugmented = rbcompute(old);                              \
> >  }                                                                      \
> >  rbstatic const struct rb_augment_callbacks rbname = {                  \
> > -       rbname ## _propagate, rbname ## _copy, rbname ## _rotate        \
> > +       .propagate = rbname ## _propagate,                              \
> > +       .copy = rbname ## _copy,                                        \
> > +       .rotate = rbname ## _rotate                                     \
> >  };
> >
> >
> > diff --git a/lib/rbtree.c b/lib/rbtree.c
> > index 1356454..70ce6c6 100644
> > --- a/lib/rbtree.c
> > +++ b/lib/rbtree.c
> > @@ -412,7 +412,9 @@ static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {}
> >  static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {}
> >
> >  static const struct rb_augment_callbacks dummy_callbacks = {
> > -       dummy_propagate, dummy_copy, dummy_rotate
> > +       .propagate = dummy_propagate,
> > +       .copy = dummy_copy,
> > +       .rotate = dummy_rotate
> >  };
> >
> >  void rb_insert_color(struct rb_node *node, struct rb_root *root)
> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index 838ca8bb..7432a90 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -561,7 +561,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page,
> >                 __mod_zone_freepage_state(zone, (1 << order), migratetype);
> >  }
> >  #else
> > -struct page_ext_operations debug_guardpage_ops = { NULL, };
> > +struct page_ext_operations debug_guardpage_ops = { .need = NULL, .init = NULL };
> >  static inline void set_page_guard(struct zone *zone, struct page *page,
> >                                 unsigned int order, int migratetype) {}
> >  static inline void clear_page_guard(struct zone *zone, struct page *page,
> > diff --git a/net/atm/lec.c b/net/atm/lec.c
> > index cd3b379..977a3c9 100644
> > --- a/net/atm/lec.c
> > +++ b/net/atm/lec.c
> > @@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
> >  }
> >
> >  static struct lane2_ops lane2_ops = {
> > -       lane2_resolve,          /* resolve,             spec 3.1.3 */
> > -       lane2_associate_req,    /* associate_req,       spec 3.1.4 */
> > -       NULL                    /* associate indicator, spec 3.1.5 */
> > +       .resolve = lane2_resolve,
> > +       .associate_req = lane2_associate_req,
> > +       .associate_indicator = NULL
> >  };
> >
> >  static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
> > diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
> > index 9e60e74..637c96e 100644
> > --- a/net/atm/mpoa_caches.c
> > +++ b/net/atm/mpoa_caches.c
> > @@ -535,30 +535,29 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
> >
> >
> >  static const struct in_cache_ops ingress_ops = {
> > -       in_cache_add_entry,               /* add_entry       */
> > -       in_cache_get,                     /* get             */
> > -       in_cache_get_with_mask,           /* get_with_mask   */
> > -       in_cache_get_by_vcc,              /* get_by_vcc      */
> > -       in_cache_put,                     /* put             */
> > -       in_cache_remove_entry,            /* remove_entry    */
> > -       cache_hit,                        /* cache_hit       */
> > -       clear_count_and_expired,          /* clear_count     */
> > -       check_resolving_entries,          /* check_resolving */
> > -       refresh_entries,                  /* refresh         */
> > -       in_destroy_cache                  /* destroy_cache   */
> > +       .add_entry = in_cache_add_entry,
> > +       .get = in_cache_get,
> > +       .get_with_mask = in_cache_get_with_mask,
> > +       .get_by_vcc = in_cache_get_by_vcc,
> > +       .put = in_cache_put,
> > +       .remove_entry = in_cache_remove_entry,
> > +       .cache_hit = cache_hit,
> > +       .clear_count = clear_count_and_expired,
> > +       .check_resolving = check_resolving_entries,
> > +       .refresh = refresh_entries,
> >  };
> >
> >  static const struct eg_cache_ops egress_ops = {
> > -       eg_cache_add_entry,               /* add_entry        */
> > -       eg_cache_get_by_cache_id,         /* get_by_cache_id  */
> > -       eg_cache_get_by_tag,              /* get_by_tag       */
> > -       eg_cache_get_by_vcc,              /* get_by_vcc       */
> > -       eg_cache_get_by_src_ip,           /* get_by_src_ip    */
> > -       eg_cache_put,                     /* put              */
> > -       eg_cache_remove_entry,            /* remove_entry     */
> > -       update_eg_cache_entry,            /* update           */
> > -       clear_expired,                    /* clear_expired    */
> > -       eg_destroy_cache                  /* destroy_cache    */
> > +       .add_entry = eg_cache_add_entry,
> > +       .get_by_cache_id = eg_cache_get_by_cache_id,
> > +       .get_by_tag = eg_cache_get_by_tag,
> > +       .get_by_vcc = eg_cache_get_by_vcc,
> > +       .get_by_src_ip = eg_cache_get_by_src_ip,
> > +       .put = eg_cache_put,
> > +       .remove_entry = eg_cache_remove_entry,
> > +       .update = update_eg_cache_entry,
> > +       .clear_expired = clear_expired,
> > +       .destroy_cache = eg_destroy_cache
> >  };
> >
> >
> > diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
> > index fd8cf02..1406db4 100644
> > --- a/net/vmw_vsock/vmci_transport_notify.c
> > +++ b/net/vmw_vsock/vmci_transport_notify.c
> > @@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
> >
> >  /* Socket control packet based operations. */
> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
> > -       vmci_transport_notify_pkt_socket_init,
> > -       vmci_transport_notify_pkt_socket_destruct,
> > -       vmci_transport_notify_pkt_poll_in,
> > -       vmci_transport_notify_pkt_poll_out,
> > -       vmci_transport_notify_pkt_handle_pkt,
> > -       vmci_transport_notify_pkt_recv_init,
> > -       vmci_transport_notify_pkt_recv_pre_block,
> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
> > -       vmci_transport_notify_pkt_recv_post_dequeue,
> > -       vmci_transport_notify_pkt_send_init,
> > -       vmci_transport_notify_pkt_send_pre_block,
> > -       vmci_transport_notify_pkt_send_pre_enqueue,
> > -       vmci_transport_notify_pkt_send_post_enqueue,
> > -       vmci_transport_notify_pkt_process_request,
> > -       vmci_transport_notify_pkt_process_negotiate,
> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
> > +       .send_init = vmci_transport_notify_pkt_send_init,
> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
> > +       .process_request = vmci_transport_notify_pkt_process_request,
> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
> >  };
> > diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
> > index 21e591d..f3a0afc 100644
> > --- a/net/vmw_vsock/vmci_transport_notify_qstate.c
> > +++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
> > @@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue(
> >
> >  /* Socket always on control packet based operations. */
> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
> > -       vmci_transport_notify_pkt_socket_init,
> > -       vmci_transport_notify_pkt_socket_destruct,
> > -       vmci_transport_notify_pkt_poll_in,
> > -       vmci_transport_notify_pkt_poll_out,
> > -       vmci_transport_notify_pkt_handle_pkt,
> > -       vmci_transport_notify_pkt_recv_init,
> > -       vmci_transport_notify_pkt_recv_pre_block,
> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
> > -       vmci_transport_notify_pkt_recv_post_dequeue,
> > -       vmci_transport_notify_pkt_send_init,
> > -       vmci_transport_notify_pkt_send_pre_block,
> > -       vmci_transport_notify_pkt_send_pre_enqueue,
> > -       vmci_transport_notify_pkt_send_post_enqueue,
> > -       vmci_transport_notify_pkt_process_request,
> > -       vmci_transport_notify_pkt_process_negotiate,
> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
> > +       .send_init = vmci_transport_notify_pkt_send_init,
> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
> > +       .process_request = vmci_transport_notify_pkt_process_request,
> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
> >  };
> > diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
> > index a020920..55579f6 100644
> > --- a/sound/synth/emux/emux_seq.c
> > +++ b/sound/synth/emux/emux_seq.c
> > @@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
> >   * MIDI emulation operators
> >   */
> >  static struct snd_midi_op emux_ops = {
> > -       snd_emux_note_on,
> > -       snd_emux_note_off,
> > -       snd_emux_key_press,
> > -       snd_emux_terminate_note,
> > -       snd_emux_control,
> > -       snd_emux_nrpn,
> > -       snd_emux_sysex,
> > +       .note_on = snd_emux_note_on,
> > +       .note_off = snd_emux_note_off,
> > +       .key_press = snd_emux_key_press,
> > +       .note_terminate = snd_emux_terminate_note,
> > +       .control = snd_emux_control,
> > +       .nrpn = snd_emux_nrpn,
> > +       .sysex = snd_emux_sysex,
> >  };
> >
> >
> > --
> > 1.9.1
> >
>
>
>
> --
> Kees Cook
> Chrome OS & Brillo Security
>

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

* [kernel-hardening] Re: [RFC 1/3] Add struct randomizing plugin
  2016-05-05 21:00   ` [kernel-hardening] " Brad Spengler
@ 2016-05-06 21:58     ` Leibowitz, Michael
  0 siblings, 0 replies; 21+ messages in thread
From: Leibowitz, Michael @ 2016-05-06 21:58 UTC (permalink / raw)
  To: Brad Spengler; +Cc: kernel-hardening, Kees Cook, re.emese, pageexec

On Thu, May 5, 2016 at 2:00 PM, Brad Spengler <spender@grsecurity.net> wrote:
> Hi Michael,
>
>> + * Copyright (c) 2016, Intel Corporation.
>
> Can you please describe exactly what changes of yours to my work justify claiming
> Intel's copyright over even a sliver of the file?  What new expression of creativity
> has Intel provided here?
>
> Was it the whitespace changes?  The conversion of // to /* */ ?  The single typo fix?
> Removing the single line that breaks the plugin when used with the constify plugin?
>
> -Brad

The Intel copyright was applied as it is standard operating procedure.
After some internal discussions, we basically agree.  The changes
created here are trivial from the original and the result nearly 100%
your work.  The next RFC and any subsequent submissions will not have
the Intel copyright for trivial changes rotely applied.

Regarding the constify plugin breakage, as we don't presently have a
constify plugin, I removed it.

Cheers


-- 
Michael Leibowitz

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

* [kernel-hardening] Re: [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs
  2016-05-05 18:17   ` [kernel-hardening] " Kees Cook
  2016-05-05 19:46     ` Julia Lawall
  2016-05-06 12:37     ` Julia Lawall
@ 2016-06-13 14:32     ` Julia Lawall
  2016-06-13 18:15       ` Kees Cook
  2 siblings, 1 reply; 21+ messages in thread
From: Julia Lawall @ 2016-06-13 14:32 UTC (permalink / raw)
  To: Kees Cook
  Cc: Michael Leibowitz, Julia Lawall, Brad Spengler, kernel-hardening,
	Emese Revfy, PaX Team

On Thu, 5 May 2016, Kees Cook wrote:

> On Thu, May 5, 2016 at 10:21 AM, Michael Leibowitz
> <michael.leibowitz@intel.com> wrote:
> > Due to randomization of structs, the in order struct intialization
> > style is replaced with explicit field style.
> >
> > struct foo_t my_foo = {
> >        one,
> >        two,
> >        three
> > };
> >
> > becomes
> >
> > struct foo_t my_foo = {
> >        .one = one,
> >        .two = two,
> >        .three = three
> > };
>
> Can a coccinelle script be written to do this also? It might be useful
> to keep that around.

Is this needed for all kinds of structure initializations, ie for both
local and global variables, or only for global variables?

thanks,
julia

>
> >
> > Additionally, tag paravirt related structures to explicitly not be
> > randomized, as the structure layout is important.
>
> This might need to be split out? It's logically separate. Also, I
> think this needs to come before the plugin, since the plugin isn't
> usable until this patch is in place.
>
> -Kees
>
> >
> > This feature is ported over from grsecurity.  This is largely
> > unchanged from the Original code written by the PaX Team and Spender.
> >
> > Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
> > ---
> >  arch/x86/include/asm/floppy.h                   | 20 ++---
> >  arch/x86/include/asm/paravirt_types.h           | 18 +++--
> >  drivers/acpi/acpica/hwxfsleep.c                 | 11 +--
> >  drivers/block/cciss.h                           | 30 ++++----
> >  drivers/gpu/drm/nouveau/nouveau_ttm.c           | 28 +++----
> >  drivers/gpu/drm/ttm/ttm_bo_manager.c            | 10 +--
> >  drivers/gpu/drm/virtio/virtgpu_ttm.c            | 10 +--
> >  drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   | 10 +--
> >  drivers/infiniband/hw/nes/nes_cm.c              | 22 +++---
> >  drivers/isdn/gigaset/bas-gigaset.c              | 32 ++++----
> >  drivers/isdn/gigaset/ser-gigaset.c              | 32 ++++----
> >  drivers/isdn/gigaset/usb-gigaset.c              | 32 ++++----
> >  drivers/isdn/i4l/isdn_concap.c                  |  6 +-
> >  drivers/isdn/i4l/isdn_x25iface.c                | 16 ++--
> >  drivers/media/pci/solo6x10/solo6x10-g723.c      |  2 +-
> >  drivers/net/ethernet/brocade/bna/bna_enet.c     |  8 +-
> >  drivers/net/wan/lmc/lmc_media.c                 | 97 +++++++++++++------------
> >  drivers/scsi/bfa/bfa_fcs.c                      | 19 ++++-
> >  drivers/scsi/bfa/bfa_fcs_lport.c                | 29 +++++---
> >  drivers/scsi/bfa/bfa_modules.h                  | 12 +--
> >  drivers/scsi/hpsa.h                             | 40 +++++-----
> >  drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |  2 +-
> >  drivers/staging/lustre/lustre/libcfs/module.c   | 10 +--
> >  drivers/video/fbdev/matrox/matroxfb_DAC1064.c   | 10 ++-
> >  drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |  5 +-
> >  fs/reiserfs/item_ops.c                          | 24 +++---
> >  include/linux/rbtree_augmented.h                |  4 +-
> >  lib/rbtree.c                                    |  4 +-
> >  mm/page_alloc.c                                 |  2 +-
> >  net/atm/lec.c                                   |  6 +-
> >  net/atm/mpoa_caches.c                           | 41 +++++------
> >  net/vmw_vsock/vmci_transport_notify.c           | 30 ++++----
> >  net/vmw_vsock/vmci_transport_notify_qstate.c    | 30 ++++----
> >  sound/synth/emux/emux_seq.c                     | 14 ++--
> >  34 files changed, 352 insertions(+), 314 deletions(-)
> >
> > diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
> > index 1c7eefe..d0e4702 100644
> > --- a/arch/x86/include/asm/floppy.h
> > +++ b/arch/x86/include/asm/floppy.h
> > @@ -229,18 +229,18 @@ static struct fd_routine_l {
> >         int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
> >  } fd_routine[] = {
> >         {
> > -               request_dma,
> > -               free_dma,
> > -               get_dma_residue,
> > -               dma_mem_alloc,
> > -               hard_dma_setup
> > +               ._request_dma = request_dma,
> > +               ._free_dma = free_dma,
> > +               ._get_dma_residue = get_dma_residue,
> > +               ._dma_mem_alloc = dma_mem_alloc,
> > +               ._dma_setup = hard_dma_setup
> >         },
> >         {
> > -               vdma_request_dma,
> > -               vdma_nop,
> > -               vdma_get_dma_residue,
> > -               vdma_mem_alloc,
> > -               vdma_dma_setup
> > +               ._request_dma = vdma_request_dma,
> > +               ._free_dma = vdma_nop,
> > +               ._get_dma_residue = vdma_get_dma_residue,
> > +               ._dma_mem_alloc = vdma_mem_alloc,
> > +               ._dma_setup = vdma_dma_setup
> >         }
> >  };
> >
> > diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
> > index 77db561..927c396 100644
> > --- a/arch/x86/include/asm/paravirt_types.h
> > +++ b/arch/x86/include/asm/paravirt_types.h
> > @@ -89,7 +89,7 @@ struct pv_init_ops {
> >          */
> >         unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
> >                           unsigned long addr, unsigned len);
> > -};
> > +} __no_randomize_layout;
> >
> >
> >  struct pv_lazy_ops {
> > @@ -97,12 +97,12 @@ struct pv_lazy_ops {
> >         void (*enter)(void);
> >         void (*leave)(void);
> >         void (*flush)(void);
> > -};
> > +} __no_randomize_layout;
> >
> >  struct pv_time_ops {
> >         unsigned long long (*sched_clock)(void);
> >         unsigned long long (*steal_clock)(int cpu);
> > -};
> > +} __no_randomize_layout;
> >
> >  struct pv_cpu_ops {
> >         /* hooks for various privileged instructions */
> > @@ -178,7 +178,7 @@ struct pv_cpu_ops {
> >
> >         void (*start_context_switch)(struct task_struct *prev);
> >         void (*end_context_switch)(struct task_struct *next);
> > -};
> > +} __no_randomize_layout;
> >
> >  struct pv_irq_ops {
> >         /*
> > @@ -201,7 +201,7 @@ struct pv_irq_ops {
> >  #ifdef CONFIG_X86_64
> >         void (*adjust_exception_frame)(void);
> >  #endif
> > -};
> > +} __no_randomize_layout;
> >
> >  struct pv_mmu_ops {
> >         unsigned long (*read_cr2)(void);
> > @@ -296,7 +296,7 @@ struct pv_mmu_ops {
> >            an mfn.  We can tell which is which from the index. */
> >         void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
> >                            phys_addr_t phys, pgprot_t flags);
> > -};
> > +} __no_randomize_layout;
> >
> >  struct arch_spinlock;
> >  #ifdef CONFIG_SMP
> > @@ -322,7 +322,9 @@ struct pv_lock_ops {
> >
> >  /* This contains all the paravirt structures: we get a convenient
> >   * number for each function using the offset which we use to indicate
> > - * what to patch. */
> > + * what to patch.
> > + * shouldn't be randomized due to the "NEAT TRICK" in paravirt.c
> > + */
> >  struct paravirt_patch_template {
> >         struct pv_init_ops pv_init_ops;
> >         struct pv_time_ops pv_time_ops;
> > @@ -330,7 +332,7 @@ struct paravirt_patch_template {
> >         struct pv_irq_ops pv_irq_ops;
> >         struct pv_mmu_ops pv_mmu_ops;
> >         struct pv_lock_ops pv_lock_ops;
> > -};
> > +} __no_randomize_layout;
> >
> >  extern struct pv_info pv_info;
> >  extern struct pv_init_ops pv_init_ops;
> > diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
> > index f76e0ea..4b83315 100644
> > --- a/drivers/acpi/acpica/hwxfsleep.c
> > +++ b/drivers/acpi/acpica/hwxfsleep.c
> > @@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
> >  /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
> >
> >  static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
> > -        acpi_hw_extended_sleep},
> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
> > -        acpi_hw_extended_wake_prep},
> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake}
> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
> > +        .extended_function = acpi_hw_extended_sleep},
> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
> > +        .extended_function = acpi_hw_extended_wake_prep},
> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake),
> > +        .extended_function = acpi_hw_extended_wake}
> >  };
> >
> >  /*
> > diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
> > index 7fda30e..428766d 100644
> > --- a/drivers/block/cciss.h
> > +++ b/drivers/block/cciss.h
> > @@ -402,27 +402,27 @@ static bool SA5_performant_intr_pending(ctlr_info_t *h)
> >  }
> >
> >  static struct access_method SA5_access = {
> > -       SA5_submit_command,
> > -       SA5_intr_mask,
> > -       SA5_fifo_full,
> > -       SA5_intr_pending,
> > -       SA5_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_intr_mask,
> > +       .fifo_full = SA5_fifo_full,
> > +       .intr_pending = SA5_intr_pending,
> > +       .command_completed = SA5_completed,
> >  };
> >
> >  static struct access_method SA5B_access = {
> > -        SA5_submit_command,
> > -        SA5B_intr_mask,
> > -        SA5_fifo_full,
> > -        SA5B_intr_pending,
> > -        SA5_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5B_intr_mask,
> > +       .fifo_full = SA5_fifo_full,
> > +       .intr_pending = SA5B_intr_pending,
> > +       .command_completed = SA5_completed,
> >  };
> >
> >  static struct access_method SA5_performant_access = {
> > -       SA5_submit_command,
> > -       SA5_performant_intr_mask,
> > -       SA5_fifo_full,
> > -       SA5_performant_intr_pending,
> > -       SA5_performant_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .fifo_full = SA5_fifo_full,
> > +       .intr_pending = SA5_performant_intr_pending,
> > +       .command_completed = SA5_performant_completed,
> >  };
> >
> >  struct board_type {
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> > index d2e7d20..7bbe51f 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> > @@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
> >  }
> >
> >  const struct ttm_mem_type_manager_func nouveau_vram_manager = {
> > -       nouveau_vram_manager_init,
> > -       nouveau_vram_manager_fini,
> > -       nouveau_vram_manager_new,
> > -       nouveau_vram_manager_del,
> > +       .init = nouveau_vram_manager_init,
> > +       .takedown = nouveau_vram_manager_fini,
> > +       .get_node = nouveau_vram_manager_new,
> > +       .put_node = nouveau_vram_manager_del,
> >  };
> >
> >  static int
> > @@ -183,11 +183,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
> >  }
> >
> >  const struct ttm_mem_type_manager_func nouveau_gart_manager = {
> > -       nouveau_gart_manager_init,
> > -       nouveau_gart_manager_fini,
> > -       nouveau_gart_manager_new,
> > -       nouveau_gart_manager_del,
> > -       nouveau_gart_manager_debug
> > +       .init = nouveau_gart_manager_init,
> > +       .takedown = nouveau_gart_manager_fini,
> > +       .get_node = nouveau_gart_manager_new,
> > +       .put_node = nouveau_gart_manager_del,
> > +       .debug = nouveau_gart_manager_debug
> >  };
> >
> >  /*XXX*/
> > @@ -256,11 +256,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
> >  }
> >
> >  const struct ttm_mem_type_manager_func nv04_gart_manager = {
> > -       nv04_gart_manager_init,
> > -       nv04_gart_manager_fini,
> > -       nv04_gart_manager_new,
> > -       nv04_gart_manager_del,
> > -       nv04_gart_manager_debug
> > +       .init = nv04_gart_manager_init,
> > +       .takedown = nv04_gart_manager_fini,
> > +       .get_node = nv04_gart_manager_new,
> > +       .put_node = nv04_gart_manager_del,
> > +       .debug = nv04_gart_manager_debug
> >  };
> >
> >  int
> > diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
> > index aa0bd05..aea6a01 100644
> > --- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
> > +++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
> > @@ -148,10 +148,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
> >  }
> >
> >  const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
> > -       ttm_bo_man_init,
> > -       ttm_bo_man_takedown,
> > -       ttm_bo_man_get_node,
> > -       ttm_bo_man_put_node,
> > -       ttm_bo_man_debug
> > +       .init = ttm_bo_man_init,
> > +       .takedown = ttm_bo_man_takedown,
> > +       .get_node = ttm_bo_man_get_node,
> > +       .put_node = ttm_bo_man_put_node,
> > +       .debug = ttm_bo_man_debug
> >  };
> >  EXPORT_SYMBOL(ttm_bo_manager_func);
> > diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
> > index 9fd924c..e5ec4ef 100644
> > --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
> > +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
> > @@ -198,11 +198,11 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
> >  }
> >
> >  static const struct ttm_mem_type_manager_func virtio_gpu_bo_manager_func = {
> > -       ttm_bo_man_init,
> > -       ttm_bo_man_takedown,
> > -       ttm_bo_man_get_node,
> > -       ttm_bo_man_put_node,
> > -       ttm_bo_man_debug
> > +       .init = ttm_bo_man_init,
> > +       .takedown = ttm_bo_man_takedown,
> > +       .get_node = ttm_bo_man_get_node,
> > +       .put_node = ttm_bo_man_put_node,
> > +       .debug = ttm_bo_man_debug
> >  };
> >
> >  static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> > index 170b61b..fec7348 100644
> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> > @@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
> >  }
> >
> >  const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
> > -       vmw_gmrid_man_init,
> > -       vmw_gmrid_man_takedown,
> > -       vmw_gmrid_man_get_node,
> > -       vmw_gmrid_man_put_node,
> > -       vmw_gmrid_man_debug
> > +       .init = vmw_gmrid_man_init,
> > +       .takedown = vmw_gmrid_man_takedown,
> > +       .get_node = vmw_gmrid_man_get_node,
> > +       .put_node = vmw_gmrid_man_put_node,
> > +       .debug = vmw_gmrid_man_debug
> >  };
> > diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
> > index cb9f0f2..8b1f654 100644
> > --- a/drivers/infiniband/hw/nes/nes_cm.c
> > +++ b/drivers/infiniband/hw/nes/nes_cm.c
> > @@ -135,17 +135,17 @@ static void record_ird_ord(struct nes_cm_node *, u16, u16);
> >  /* instance of function pointers for client API */
> >  /* set address of this instance to cm_core->cm_ops at cm_core alloc */
> >  static const struct nes_cm_ops nes_cm_api = {
> > -       mini_cm_accelerated,
> > -       mini_cm_listen,
> > -       mini_cm_del_listen,
> > -       mini_cm_connect,
> > -       mini_cm_close,
> > -       mini_cm_accept,
> > -       mini_cm_reject,
> > -       mini_cm_recv_pkt,
> > -       mini_cm_dealloc_core,
> > -       mini_cm_get,
> > -       mini_cm_set
> > +       .accelerated = mini_cm_accelerated,
> > +       .listen = mini_cm_listen,
> > +       .stop_listener = mini_cm_del_listen,
> > +       .connect = mini_cm_connect,
> > +       .close = mini_cm_close,
> > +       .accept = mini_cm_accept,
> > +       .reject = mini_cm_reject,
> > +       .recv_pkt = mini_cm_recv_pkt,
> > +       .destroy_cm_core = mini_cm_dealloc_core,
> > +       .get = mini_cm_get,
> > +       .set = mini_cm_set
> >  };
> >
> >  static struct nes_cm_core *g_cm_core;
> > diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
> > index aecec6d..11e13c5 100644
> > --- a/drivers/isdn/gigaset/bas-gigaset.c
> > +++ b/drivers/isdn/gigaset/bas-gigaset.c
> > @@ -2565,22 +2565,22 @@ static int gigaset_post_reset(struct usb_interface *intf)
> >
> >
> >  static const struct gigaset_ops gigops = {
> > -       gigaset_write_cmd,
> > -       gigaset_write_room,
> > -       gigaset_chars_in_buffer,
> > -       gigaset_brkchars,
> > -       gigaset_init_bchannel,
> > -       gigaset_close_bchannel,
> > -       gigaset_initbcshw,
> > -       gigaset_freebcshw,
> > -       gigaset_reinitbcshw,
> > -       gigaset_initcshw,
> > -       gigaset_freecshw,
> > -       gigaset_set_modem_ctrl,
> > -       gigaset_baud_rate,
> > -       gigaset_set_line_ctrl,
> > -       gigaset_isoc_send_skb,
> > -       gigaset_isoc_input,
> > +       .write_cmd = gigaset_write_cmd,
> > +       .write_room = gigaset_write_room,
> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> > +       .brkchars = gigaset_brkchars,
> > +       .init_bchannel = gigaset_init_bchannel,
> > +       .close_bchannel = gigaset_close_bchannel,
> > +       .initbcshw = gigaset_initbcshw,
> > +       .freebcshw = gigaset_freebcshw,
> > +       .reinitbcshw = gigaset_reinitbcshw,
> > +       .initcshw = gigaset_initcshw,
> > +       .freecshw = gigaset_freecshw,
> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> > +       .baud_rate = gigaset_baud_rate,
> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> > +       .send_skb = gigaset_isoc_send_skb,
> > +       .handle_input = gigaset_isoc_input,
> >  };
> >
> >  /* bas_gigaset_init
> > diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
> > index d1f8ab9..c0412f2 100644
> > --- a/drivers/isdn/gigaset/ser-gigaset.c
> > +++ b/drivers/isdn/gigaset/ser-gigaset.c
> > @@ -445,22 +445,22 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
> >  }
> >
> >  static const struct gigaset_ops ops = {
> > -       gigaset_write_cmd,
> > -       gigaset_write_room,
> > -       gigaset_chars_in_buffer,
> > -       gigaset_brkchars,
> > -       gigaset_init_bchannel,
> > -       gigaset_close_bchannel,
> > -       gigaset_initbcshw,
> > -       gigaset_freebcshw,
> > -       gigaset_reinitbcshw,
> > -       gigaset_initcshw,
> > -       gigaset_freecshw,
> > -       gigaset_set_modem_ctrl,
> > -       gigaset_baud_rate,
> > -       gigaset_set_line_ctrl,
> > -       gigaset_m10x_send_skb,  /* asyncdata.c */
> > -       gigaset_m10x_input,     /* asyncdata.c */
> > +       .write_cmd = gigaset_write_cmd,
> > +       .write_room = gigaset_write_room,
> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> > +       .brkchars = gigaset_brkchars,
> > +       .init_bchannel = gigaset_init_bchannel,
> > +       .close_bchannel = gigaset_close_bchannel,
> > +       .initbcshw = gigaset_initbcshw,
> > +       .freebcshw = gigaset_freebcshw,
> > +       .reinitbcshw = gigaset_reinitbcshw,
> > +       .initcshw = gigaset_initcshw,
> > +       .freecshw = gigaset_freecshw,
> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> > +       .baud_rate = gigaset_baud_rate,
> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> > +       .send_skb = gigaset_m10x_send_skb,      /* asyncdata.c */
> > +       .handle_input = gigaset_m10x_input,     /* asyncdata.c */
> >  };
> >
> >
> > diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
> > index 5f306e2..eade36d 100644
> > --- a/drivers/isdn/gigaset/usb-gigaset.c
> > +++ b/drivers/isdn/gigaset/usb-gigaset.c
> > @@ -862,22 +862,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
> >  }
> >
> >  static const struct gigaset_ops ops = {
> > -       gigaset_write_cmd,
> > -       gigaset_write_room,
> > -       gigaset_chars_in_buffer,
> > -       gigaset_brkchars,
> > -       gigaset_init_bchannel,
> > -       gigaset_close_bchannel,
> > -       gigaset_initbcshw,
> > -       gigaset_freebcshw,
> > -       gigaset_reinitbcshw,
> > -       gigaset_initcshw,
> > -       gigaset_freecshw,
> > -       gigaset_set_modem_ctrl,
> > -       gigaset_baud_rate,
> > -       gigaset_set_line_ctrl,
> > -       gigaset_m10x_send_skb,
> > -       gigaset_m10x_input,
> > +       .write_cmd = gigaset_write_cmd,
> > +       .write_room = gigaset_write_room,
> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> > +       .brkchars = gigaset_brkchars,
> > +       .init_bchannel = gigaset_init_bchannel,
> > +       .close_bchannel = gigaset_close_bchannel,
> > +       .initbcshw = gigaset_initbcshw,
> > +       .freebcshw = gigaset_freebcshw,
> > +       .reinitbcshw = gigaset_reinitbcshw,
> > +       .initcshw = gigaset_initcshw,
> > +       .freecshw = gigaset_freecshw,
> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> > +       .baud_rate = gigaset_baud_rate,
> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> > +       .send_skb = gigaset_m10x_send_skb,
> > +       .handle_input = gigaset_m10x_input,
> >  };
> >
> >  /*
> > diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
> > index 91d5730..336523e 100644
> > --- a/drivers/isdn/i4l/isdn_concap.c
> > +++ b/drivers/isdn/i4l/isdn_concap.c
> > @@ -80,9 +80,9 @@ static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
> >  }
> >
> >  struct concap_device_ops isdn_concap_reliable_dl_dops = {
> > -       &isdn_concap_dl_data_req,
> > -       &isdn_concap_dl_connect_req,
> > -       &isdn_concap_dl_disconn_req
> > +       .data_req = &isdn_concap_dl_data_req,
> > +       .connect_req = &isdn_concap_dl_connect_req,
> > +       .disconn_req = &isdn_concap_dl_disconn_req
> >  };
> >
> >  /* The following should better go into a dedicated source file such that
> > diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
> > index e2d4e58..40cd045 100644
> > --- a/drivers/isdn/i4l/isdn_x25iface.c
> > +++ b/drivers/isdn/i4l/isdn_x25iface.c
> > @@ -53,14 +53,14 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *);
> >
> >
> >  static struct concap_proto_ops ix25_pops = {
> > -       &isdn_x25iface_proto_new,
> > -       &isdn_x25iface_proto_del,
> > -       &isdn_x25iface_proto_restart,
> > -       &isdn_x25iface_proto_close,
> > -       &isdn_x25iface_xmit,
> > -       &isdn_x25iface_receive,
> > -       &isdn_x25iface_connect_ind,
> > -       &isdn_x25iface_disconn_ind
> > +       .proto_new = &isdn_x25iface_proto_new,
> > +       .proto_del = &isdn_x25iface_proto_del,
> > +       .restart = &isdn_x25iface_proto_restart,
> > +       .close = &isdn_x25iface_proto_close,
> > +       .encap_and_xmit = &isdn_x25iface_xmit,
> > +       .data_ind = &isdn_x25iface_receive,
> > +       .connect_ind = &isdn_x25iface_connect_ind,
> > +       .disconn_ind = &isdn_x25iface_disconn_ind
> >  };
> >
> >  /* error message helper function */
> > diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
> > index 4a37a1c..7e82dfd 100644
> > --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> > +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> > @@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
> >
> >  int solo_g723_init(struct solo_dev *solo_dev)
> >  {
> > -       static struct snd_device_ops ops = { NULL };
> > +       static struct snd_device_ops ops = { };
> >         struct snd_card *card;
> >         struct snd_kcontrol_new kctl;
> >         char name[32];
> > diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c
> > index 4e5c387..bba8173 100644
> > --- a/drivers/net/ethernet/brocade/bna/bna_enet.c
> > +++ b/drivers/net/ethernet/brocade/bna/bna_enet.c
> > @@ -1676,10 +1676,10 @@ bna_cb_ioceth_reset(void *arg)
> >  }
> >
> >  static struct bfa_ioc_cbfn bna_ioceth_cbfn = {
> > -       bna_cb_ioceth_enable,
> > -       bna_cb_ioceth_disable,
> > -       bna_cb_ioceth_hbfail,
> > -       bna_cb_ioceth_reset
> > +       .enable_cbfn = bna_cb_ioceth_enable,
> > +       .disable_cbfn = bna_cb_ioceth_disable,
> > +       .hbfail_cbfn = bna_cb_ioceth_hbfail,
> > +       .reset_cbfn = bna_cb_ioceth_reset
> >  };
> >
> >  static void bna_attr_init(struct bna_ioceth *ioceth)
> > diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
> > index 5920c99..ff2e4a5 100644
> > --- a/drivers/net/wan/lmc/lmc_media.c
> > +++ b/drivers/net/wan/lmc/lmc_media.c
> > @@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int);
> >  static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
> >
> >  lmc_media_t lmc_ds3_media = {
> > -  lmc_ds3_init,                        /* special media init stuff */
> > -  lmc_ds3_default,             /* reset to default state */
> > -  lmc_ds3_set_status,          /* reset status to state provided */
> > -  lmc_dummy_set_1,             /* set clock source */
> > -  lmc_dummy_set2_1,            /* set line speed */
> > -  lmc_ds3_set_100ft,           /* set cable length */
> > -  lmc_ds3_set_scram,           /* set scrambler */
> > -  lmc_ds3_get_link_status,     /* get link status */
> > -  lmc_dummy_set_1,             /* set link status */
> > -  lmc_ds3_set_crc_length,      /* set CRC length */
> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> > -  lmc_ds3_watchdog
> > +  .init = lmc_ds3_init,                                /* special media init stuff */
> > +  .defaults = lmc_ds3_default,                 /* reset to default state */
> > +  .set_status = lmc_ds3_set_status,            /* reset status to state provided */
> > +  .set_clock_source = lmc_dummy_set_1,         /* set clock source */
> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> > +  .set_cable_length = lmc_ds3_set_100ft,       /* set cable length */
> > +  .set_scrambler = lmc_ds3_set_scram,          /* set scrambler */
> > +  .get_link_status = lmc_ds3_get_link_status,  /* get link status */
> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
> > +  .set_crc_length = lmc_ds3_set_crc_length,    /* set CRC length */
> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> > +  .watchdog = lmc_ds3_watchdog
> >  };
> >
> >  lmc_media_t lmc_hssi_media = {
> > -  lmc_hssi_init,               /* special media init stuff */
> > -  lmc_hssi_default,            /* reset to default state */
> > -  lmc_hssi_set_status,         /* reset status to state provided */
> > -  lmc_hssi_set_clock,          /* set clock source */
> > -  lmc_dummy_set2_1,            /* set line speed */
> > -  lmc_dummy_set_1,             /* set cable length */
> > -  lmc_dummy_set_1,             /* set scrambler */
> > -  lmc_hssi_get_link_status,    /* get link status */
> > -  lmc_hssi_set_link_status,    /* set link status */
> > -  lmc_hssi_set_crc_length,     /* set CRC length */
> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> > -  lmc_hssi_watchdog
> > +  .init = lmc_hssi_init,                       /* special media init stuff */
> > +  .defaults = lmc_hssi_default,                        /* reset to default state */
> > +  .set_status = lmc_hssi_set_status,           /* reset status to state provided */
> > +  .set_clock_source = lmc_hssi_set_clock,      /* set clock source */
> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> > +  .get_link_status = lmc_hssi_get_link_status, /* get link status */
> > +  .set_link_status = lmc_hssi_set_link_status, /* set link status */
> > +  .set_crc_length = lmc_hssi_set_crc_length,   /* set CRC length */
> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> > +  .watchdog = lmc_hssi_watchdog
> >  };
> >
> > -lmc_media_t lmc_ssi_media = { lmc_ssi_init,    /* special media init stuff */
> > -  lmc_ssi_default,             /* reset to default state */
> > -  lmc_ssi_set_status,          /* reset status to state provided */
> > -  lmc_ssi_set_clock,           /* set clock source */
> > -  lmc_ssi_set_speed,           /* set line speed */
> > -  lmc_dummy_set_1,             /* set cable length */
> > -  lmc_dummy_set_1,             /* set scrambler */
> > -  lmc_ssi_get_link_status,     /* get link status */
> > -  lmc_ssi_set_link_status,     /* set link status */
> > -  lmc_ssi_set_crc_length,      /* set CRC length */
> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> > -  lmc_ssi_watchdog
> > +lmc_media_t lmc_ssi_media = {
> > +  .init = lmc_ssi_init,                                /* special media init stuff */
> > +  .defaults = lmc_ssi_default,                 /* reset to default state */
> > +  .set_status = lmc_ssi_set_status,            /* reset status to state provided */
> > +  .set_clock_source = lmc_ssi_set_clock,       /* set clock source */
> > +  .set_speed = lmc_ssi_set_speed,              /* set line speed */
> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> > +  .get_link_status = lmc_ssi_get_link_status,  /* get link status */
> > +  .set_link_status = lmc_ssi_set_link_status,  /* set link status */
> > +  .set_crc_length = lmc_ssi_set_crc_length,    /* set CRC length */
> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> > +  .watchdog = lmc_ssi_watchdog
> >  };
> >
> >  lmc_media_t lmc_t1_media = {
> > -  lmc_t1_init,                 /* special media init stuff */
> > -  lmc_t1_default,              /* reset to default state */
> > -  lmc_t1_set_status,           /* reset status to state provided */
> > -  lmc_t1_set_clock,            /* set clock source */
> > -  lmc_dummy_set2_1,            /* set line speed */
> > -  lmc_dummy_set_1,             /* set cable length */
> > -  lmc_dummy_set_1,             /* set scrambler */
> > -  lmc_t1_get_link_status,      /* get link status */
> > -  lmc_dummy_set_1,             /* set link status */
> > -  lmc_t1_set_crc_length,       /* set CRC length */
> > -  lmc_t1_set_circuit_type,     /* set T1 or E1 circuit type */
> > -  lmc_t1_watchdog
> > +  .init = lmc_t1_init,                         /* special media init stuff */
> > +  .defaults = lmc_t1_default,                  /* reset to default state */
> > +  .set_status = lmc_t1_set_status,             /* reset status to state provided */
> > +  .set_clock_source = lmc_t1_set_clock,                /* set clock source */
> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> > +  .get_link_status = lmc_t1_get_link_status,   /* get link status */
> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
> > +  .set_crc_length = lmc_t1_set_crc_length,     /* set CRC length */
> > +  .set_circuit_type = lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
> > +  .watchdog = lmc_t1_watchdog
> >  };
> >
> >  static void
> > diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
> > index 1e7e139..c2031dd 100644
> > --- a/drivers/scsi/bfa/bfa_fcs.c
> > +++ b/drivers/scsi/bfa/bfa_fcs.c
> > @@ -39,10 +39,21 @@ struct bfa_fcs_mod_s {
> >  #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
> >
> >  static struct bfa_fcs_mod_s fcs_modules[] = {
> > -       { bfa_fcs_port_attach, NULL, NULL },
> > -       { bfa_fcs_uf_attach, NULL, NULL },
> > -       { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
> > -         bfa_fcs_fabric_modexit },
> > +       {
> > +               .attach = bfa_fcs_port_attach,
> > +               .modinit = NULL,
> > +               .modexit = NULL
> > +       },
> > +       {
> > +               .attach = bfa_fcs_uf_attach,
> > +               .modinit = NULL,
> > +               .modexit = NULL
> > +       },
> > +       {
> > +               .attach = bfa_fcs_fabric_attach,
> > +               .modinit = bfa_fcs_fabric_modinit,
> > +               .modexit = bfa_fcs_fabric_modexit
> > +       },
> >  };
> >
> >  /*
> > diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
> > index 7733ad5..e5edbce 100644
> > --- a/drivers/scsi/bfa/bfa_fcs_lport.c
> > +++ b/drivers/scsi/bfa/bfa_fcs_lport.c
> > @@ -90,15 +90,26 @@ static struct {
> >         void            (*offline) (struct bfa_fcs_lport_s *port);
> >  } __port_action[] = {
> >         {
> > -       bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
> > -                       bfa_fcs_lport_unknown_offline}, {
> > -       bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
> > -                       bfa_fcs_lport_fab_offline}, {
> > -       bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
> > -                       bfa_fcs_lport_n2n_offline}, {
> > -       bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
> > -                       bfa_fcs_lport_loop_offline},
> > -       };
> > +               .init = bfa_fcs_lport_unknown_init,
> > +               .online = bfa_fcs_lport_unknown_online,
> > +               .offline = bfa_fcs_lport_unknown_offline
> > +       },
> > +       {
> > +               .init = bfa_fcs_lport_fab_init,
> > +               .online = bfa_fcs_lport_fab_online,
> > +               .offline = bfa_fcs_lport_fab_offline
> > +       },
> > +       {
> > +               .init = bfa_fcs_lport_n2n_init,
> > +               .online = bfa_fcs_lport_n2n_online,
> > +               .offline = bfa_fcs_lport_n2n_offline
> > +       },
> > +       {
> > +               .init = bfa_fcs_lport_loop_init,
> > +               .online = bfa_fcs_lport_loop_online,
> > +               .offline = bfa_fcs_lport_loop_offline
> > +       },
> > +};
> >
> >  /*
> >   *  fcs_port_sm FCS logical port state machine
> > diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
> > index 53135f2..640621b 100644
> > --- a/drivers/scsi/bfa/bfa_modules.h
> > +++ b/drivers/scsi/bfa/bfa_modules.h
> > @@ -79,12 +79,12 @@ enum {
> >                                                                         \
> >         extern struct bfa_module_s hal_mod_ ## __mod;                   \
> >         struct bfa_module_s hal_mod_ ## __mod = {                       \
> > -               bfa_ ## __mod ## _meminfo,                              \
> > -               bfa_ ## __mod ## _attach,                               \
> > -               bfa_ ## __mod ## _detach,                               \
> > -               bfa_ ## __mod ## _start,                                \
> > -               bfa_ ## __mod ## _stop,                                 \
> > -               bfa_ ## __mod ## _iocdisable,                           \
> > +               .meminfo = bfa_ ## __mod ## _meminfo,                   \
> > +               .attach = bfa_ ## __mod ## _attach,                     \
> > +               .detach = bfa_ ## __mod ## _detach,                     \
> > +               .start = bfa_ ## __mod ## _start,                       \
> > +               .stop = bfa_ ## __mod ## _stop,                         \
> > +               .iocdisable = bfa_ ## __mod ## _iocdisable,             \
> >         }
> >
> >  #define BFA_CACHELINE_SZ       (256)
> > diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
> > index fdd39fc..b734478 100644
> > --- a/drivers/scsi/hpsa.h
> > +++ b/drivers/scsi/hpsa.h
> > @@ -577,38 +577,38 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
> >  }
> >
> >  static struct access_method SA5_access = {
> > -       SA5_submit_command,
> > -       SA5_intr_mask,
> > -       SA5_intr_pending,
> > -       SA5_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_intr_mask,
> > +       .intr_pending = SA5_intr_pending,
> > +       .command_completed = SA5_completed,
> >  };
> >
> >  static struct access_method SA5_ioaccel_mode1_access = {
> > -       SA5_submit_command,
> > -       SA5_performant_intr_mask,
> > -       SA5_ioaccel_mode1_intr_pending,
> > -       SA5_ioaccel_mode1_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .intr_pending = SA5_ioaccel_mode1_intr_pending,
> > +       .command_completed = SA5_ioaccel_mode1_completed,
> >  };
> >
> >  static struct access_method SA5_ioaccel_mode2_access = {
> > -       SA5_submit_command_ioaccel2,
> > -       SA5_performant_intr_mask,
> > -       SA5_performant_intr_pending,
> > -       SA5_performant_completed,
> > +       .submit_command = SA5_submit_command_ioaccel2,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .intr_pending = SA5_performant_intr_pending,
> > +       .command_completed = SA5_performant_completed,
> >  };
> >
> >  static struct access_method SA5_performant_access = {
> > -       SA5_submit_command,
> > -       SA5_performant_intr_mask,
> > -       SA5_performant_intr_pending,
> > -       SA5_performant_completed,
> > +       .submit_command = SA5_submit_command,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .intr_pending = SA5_performant_intr_pending,
> > +       .command_completed = SA5_performant_completed,
> >  };
> >
> >  static struct access_method SA5_performant_access_no_read = {
> > -       SA5_submit_command_no_read,
> > -       SA5_performant_intr_mask,
> > -       SA5_performant_intr_pending,
> > -       SA5_performant_completed,
> > +       .submit_command = SA5_submit_command_no_read,
> > +       .set_intr_mask = SA5_performant_intr_mask,
> > +       .intr_pending = SA5_performant_intr_pending,
> > +       .command_completed = SA5_performant_completed,
> >  };
> >
> >  struct board_type {
> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> > index 4310154..605d035 100644
> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> > @@ -147,7 +147,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
> >         int added = (mode == LCK_NL);
> >         int overlaps = 0;
> >         int splitted = 0;
> > -       const struct ldlm_callback_suite null_cbs = { NULL };
> > +       const struct ldlm_callback_suite null_cbs = { };
> >
> >         CDEBUG(D_DLMTRACE,
> >                "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
> > diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
> > index 329d78c..9756f9e 100644
> > --- a/drivers/staging/lustre/lustre/libcfs/module.c
> > +++ b/drivers/staging/lustre/lustre/libcfs/module.c
> > @@ -322,11 +322,11 @@ out:
> >  }
> >
> >  struct cfs_psdev_ops libcfs_psdev_ops = {
> > -       libcfs_psdev_open,
> > -       libcfs_psdev_release,
> > -       NULL,
> > -       NULL,
> > -       libcfs_ioctl
> > +       .p_open = libcfs_psdev_open,
> > +       .p_close = libcfs_psdev_release,
> > +       .p_read = NULL,
> > +       .p_write = NULL,
> > +       .p_ioctl = libcfs_ioctl
> >  };
> >
> >  static int proc_call_handler(void *data, int write, loff_t *ppos,
> > diff --git a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> > index a01147f..5d896f8 100644
> > --- a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> > +++ b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> > @@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo)
> >
> >  #ifdef CONFIG_FB_MATROX_MYSTIQUE
> >  struct matrox_switch matrox_mystique = {
> > -       MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore,
> > +       .preinit = MGA1064_preinit,
> > +       .reset = MGA1064_reset,
> > +       .init = MGA1064_init,
> > +       .restore = MGA1064_restore,
> >  };
> >  EXPORT_SYMBOL(matrox_mystique);
> >  #endif
> >
> >  #ifdef CONFIG_FB_MATROX_G
> >  struct matrox_switch matrox_G100 = {
> > -       MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore,
> > +       .preinit = MGAG100_preinit,
> > +       .reset = MGAG100_reset,
> > +       .init = MGAG100_init,
> > +       .restore = MGAG100_restore,
> >  };
> >  EXPORT_SYMBOL(matrox_G100);
> >  #endif
> > diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> > index 195ad7c..09743fc 100644
> > --- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> > +++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> > @@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo)
> >  }
> >
> >  struct matrox_switch matrox_millennium = {
> > -       Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore
> > +       .preinit = Ti3026_preinit,
> > +       .reset = Ti3026_reset,
> > +       .init = Ti3026_init,
> > +       .restore = Ti3026_restore
> >  };
> >  EXPORT_SYMBOL(matrox_millennium);
> >  #endif
> > diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
> > index aca73dd..e3c558d 100644
> > --- a/fs/reiserfs/item_ops.c
> > +++ b/fs/reiserfs/item_ops.c
> > @@ -724,18 +724,18 @@ static void errcatch_print_vi(struct virtual_item *vi)
> >  }
> >
> >  static struct item_operations errcatch_ops = {
> > -       errcatch_bytes_number,
> > -       errcatch_decrement_key,
> > -       errcatch_is_left_mergeable,
> > -       errcatch_print_item,
> > -       errcatch_check_item,
> > -
> > -       errcatch_create_vi,
> > -       errcatch_check_left,
> > -       errcatch_check_right,
> > -       errcatch_part_size,
> > -       errcatch_unit_num,
> > -       errcatch_print_vi
> > +       .bytes_number = errcatch_bytes_number,
> > +       .decrement_key = errcatch_decrement_key,
> > +       .is_left_mergeable = errcatch_is_left_mergeable,
> > +       .print_item = errcatch_print_item,
> > +       .check_item = errcatch_check_item,
> > +
> > +       .create_vi = errcatch_create_vi,
> > +       .check_left = errcatch_check_left,
> > +       .check_right = errcatch_check_right,
> > +       .part_size = errcatch_part_size,
> > +       .unit_num = errcatch_unit_num,
> > +       .print_vi = errcatch_print_vi
> >  };
> >
> >  #if ! (TYPE_STAT_DATA == 0 && TYPE_INDIRECT == 1 && TYPE_DIRECT == 2 && TYPE_DIRENTRY == 3)
> > diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
> > index 14d7b83..a1edf56 100644
> > --- a/include/linux/rbtree_augmented.h
> > +++ b/include/linux/rbtree_augmented.h
> > @@ -90,7 +90,9 @@ rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new)     \
> >         old->rbaugmented = rbcompute(old);                              \
> >  }                                                                      \
> >  rbstatic const struct rb_augment_callbacks rbname = {                  \
> > -       rbname ## _propagate, rbname ## _copy, rbname ## _rotate        \
> > +       .propagate = rbname ## _propagate,                              \
> > +       .copy = rbname ## _copy,                                        \
> > +       .rotate = rbname ## _rotate                                     \
> >  };
> >
> >
> > diff --git a/lib/rbtree.c b/lib/rbtree.c
> > index 1356454..70ce6c6 100644
> > --- a/lib/rbtree.c
> > +++ b/lib/rbtree.c
> > @@ -412,7 +412,9 @@ static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {}
> >  static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {}
> >
> >  static const struct rb_augment_callbacks dummy_callbacks = {
> > -       dummy_propagate, dummy_copy, dummy_rotate
> > +       .propagate = dummy_propagate,
> > +       .copy = dummy_copy,
> > +       .rotate = dummy_rotate
> >  };
> >
> >  void rb_insert_color(struct rb_node *node, struct rb_root *root)
> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index 838ca8bb..7432a90 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -561,7 +561,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page,
> >                 __mod_zone_freepage_state(zone, (1 << order), migratetype);
> >  }
> >  #else
> > -struct page_ext_operations debug_guardpage_ops = { NULL, };
> > +struct page_ext_operations debug_guardpage_ops = { .need = NULL, .init = NULL };
> >  static inline void set_page_guard(struct zone *zone, struct page *page,
> >                                 unsigned int order, int migratetype) {}
> >  static inline void clear_page_guard(struct zone *zone, struct page *page,
> > diff --git a/net/atm/lec.c b/net/atm/lec.c
> > index cd3b379..977a3c9 100644
> > --- a/net/atm/lec.c
> > +++ b/net/atm/lec.c
> > @@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
> >  }
> >
> >  static struct lane2_ops lane2_ops = {
> > -       lane2_resolve,          /* resolve,             spec 3.1.3 */
> > -       lane2_associate_req,    /* associate_req,       spec 3.1.4 */
> > -       NULL                    /* associate indicator, spec 3.1.5 */
> > +       .resolve = lane2_resolve,
> > +       .associate_req = lane2_associate_req,
> > +       .associate_indicator = NULL
> >  };
> >
> >  static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
> > diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
> > index 9e60e74..637c96e 100644
> > --- a/net/atm/mpoa_caches.c
> > +++ b/net/atm/mpoa_caches.c
> > @@ -535,30 +535,29 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
> >
> >
> >  static const struct in_cache_ops ingress_ops = {
> > -       in_cache_add_entry,               /* add_entry       */
> > -       in_cache_get,                     /* get             */
> > -       in_cache_get_with_mask,           /* get_with_mask   */
> > -       in_cache_get_by_vcc,              /* get_by_vcc      */
> > -       in_cache_put,                     /* put             */
> > -       in_cache_remove_entry,            /* remove_entry    */
> > -       cache_hit,                        /* cache_hit       */
> > -       clear_count_and_expired,          /* clear_count     */
> > -       check_resolving_entries,          /* check_resolving */
> > -       refresh_entries,                  /* refresh         */
> > -       in_destroy_cache                  /* destroy_cache   */
> > +       .add_entry = in_cache_add_entry,
> > +       .get = in_cache_get,
> > +       .get_with_mask = in_cache_get_with_mask,
> > +       .get_by_vcc = in_cache_get_by_vcc,
> > +       .put = in_cache_put,
> > +       .remove_entry = in_cache_remove_entry,
> > +       .cache_hit = cache_hit,
> > +       .clear_count = clear_count_and_expired,
> > +       .check_resolving = check_resolving_entries,
> > +       .refresh = refresh_entries,
> >  };
> >
> >  static const struct eg_cache_ops egress_ops = {
> > -       eg_cache_add_entry,               /* add_entry        */
> > -       eg_cache_get_by_cache_id,         /* get_by_cache_id  */
> > -       eg_cache_get_by_tag,              /* get_by_tag       */
> > -       eg_cache_get_by_vcc,              /* get_by_vcc       */
> > -       eg_cache_get_by_src_ip,           /* get_by_src_ip    */
> > -       eg_cache_put,                     /* put              */
> > -       eg_cache_remove_entry,            /* remove_entry     */
> > -       update_eg_cache_entry,            /* update           */
> > -       clear_expired,                    /* clear_expired    */
> > -       eg_destroy_cache                  /* destroy_cache    */
> > +       .add_entry = eg_cache_add_entry,
> > +       .get_by_cache_id = eg_cache_get_by_cache_id,
> > +       .get_by_tag = eg_cache_get_by_tag,
> > +       .get_by_vcc = eg_cache_get_by_vcc,
> > +       .get_by_src_ip = eg_cache_get_by_src_ip,
> > +       .put = eg_cache_put,
> > +       .remove_entry = eg_cache_remove_entry,
> > +       .update = update_eg_cache_entry,
> > +       .clear_expired = clear_expired,
> > +       .destroy_cache = eg_destroy_cache
> >  };
> >
> >
> > diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
> > index fd8cf02..1406db4 100644
> > --- a/net/vmw_vsock/vmci_transport_notify.c
> > +++ b/net/vmw_vsock/vmci_transport_notify.c
> > @@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
> >
> >  /* Socket control packet based operations. */
> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
> > -       vmci_transport_notify_pkt_socket_init,
> > -       vmci_transport_notify_pkt_socket_destruct,
> > -       vmci_transport_notify_pkt_poll_in,
> > -       vmci_transport_notify_pkt_poll_out,
> > -       vmci_transport_notify_pkt_handle_pkt,
> > -       vmci_transport_notify_pkt_recv_init,
> > -       vmci_transport_notify_pkt_recv_pre_block,
> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
> > -       vmci_transport_notify_pkt_recv_post_dequeue,
> > -       vmci_transport_notify_pkt_send_init,
> > -       vmci_transport_notify_pkt_send_pre_block,
> > -       vmci_transport_notify_pkt_send_pre_enqueue,
> > -       vmci_transport_notify_pkt_send_post_enqueue,
> > -       vmci_transport_notify_pkt_process_request,
> > -       vmci_transport_notify_pkt_process_negotiate,
> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
> > +       .send_init = vmci_transport_notify_pkt_send_init,
> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
> > +       .process_request = vmci_transport_notify_pkt_process_request,
> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
> >  };
> > diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
> > index 21e591d..f3a0afc 100644
> > --- a/net/vmw_vsock/vmci_transport_notify_qstate.c
> > +++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
> > @@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue(
> >
> >  /* Socket always on control packet based operations. */
> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
> > -       vmci_transport_notify_pkt_socket_init,
> > -       vmci_transport_notify_pkt_socket_destruct,
> > -       vmci_transport_notify_pkt_poll_in,
> > -       vmci_transport_notify_pkt_poll_out,
> > -       vmci_transport_notify_pkt_handle_pkt,
> > -       vmci_transport_notify_pkt_recv_init,
> > -       vmci_transport_notify_pkt_recv_pre_block,
> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
> > -       vmci_transport_notify_pkt_recv_post_dequeue,
> > -       vmci_transport_notify_pkt_send_init,
> > -       vmci_transport_notify_pkt_send_pre_block,
> > -       vmci_transport_notify_pkt_send_pre_enqueue,
> > -       vmci_transport_notify_pkt_send_post_enqueue,
> > -       vmci_transport_notify_pkt_process_request,
> > -       vmci_transport_notify_pkt_process_negotiate,
> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
> > +       .send_init = vmci_transport_notify_pkt_send_init,
> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
> > +       .process_request = vmci_transport_notify_pkt_process_request,
> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
> >  };
> > diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
> > index a020920..55579f6 100644
> > --- a/sound/synth/emux/emux_seq.c
> > +++ b/sound/synth/emux/emux_seq.c
> > @@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
> >   * MIDI emulation operators
> >   */
> >  static struct snd_midi_op emux_ops = {
> > -       snd_emux_note_on,
> > -       snd_emux_note_off,
> > -       snd_emux_key_press,
> > -       snd_emux_terminate_note,
> > -       snd_emux_control,
> > -       snd_emux_nrpn,
> > -       snd_emux_sysex,
> > +       .note_on = snd_emux_note_on,
> > +       .note_off = snd_emux_note_off,
> > +       .key_press = snd_emux_key_press,
> > +       .note_terminate = snd_emux_terminate_note,
> > +       .control = snd_emux_control,
> > +       .nrpn = snd_emux_nrpn,
> > +       .sysex = snd_emux_sysex,
> >  };
> >
> >
> > --
> > 1.9.1
> >
>
>
>
> --
> Kees Cook
> Chrome OS & Brillo Security
>

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

* [kernel-hardening] Re: [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs
  2016-06-13 14:32     ` Julia Lawall
@ 2016-06-13 18:15       ` Kees Cook
  2016-06-13 19:57         ` Julia Lawall
  2016-06-13 20:28         ` Leibowitz, Michael
  0 siblings, 2 replies; 21+ messages in thread
From: Kees Cook @ 2016-06-13 18:15 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Michael Leibowitz, Brad Spengler, kernel-hardening, Emese Revfy,
	PaX Team

On Mon, Jun 13, 2016 at 7:32 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> On Thu, 5 May 2016, Kees Cook wrote:
>
>> On Thu, May 5, 2016 at 10:21 AM, Michael Leibowitz
>> <michael.leibowitz@intel.com> wrote:
>> > Due to randomization of structs, the in order struct intialization
>> > style is replaced with explicit field style.
>> >
>> > struct foo_t my_foo = {
>> >        one,
>> >        two,
>> >        three
>> > };
>> >
>> > becomes
>> >
>> > struct foo_t my_foo = {
>> >        .one = one,
>> >        .two = two,
>> >        .three = three
>> > };
>>
>> Can a coccinelle script be written to do this also? It might be useful
>> to keep that around.
>
> Is this needed for all kinds of structure initializations, ie for both
> local and global variables, or only for global variables?

It's needed for any structure that has been globally defined. As in,
any use of a struct must be using C99 since that structure may be
randomized (in any context: global, local).

Michael, what's the state of this series? What're your next steps?

-Kees

>
> thanks,
> julia
>
>>
>> >
>> > Additionally, tag paravirt related structures to explicitly not be
>> > randomized, as the structure layout is important.
>>
>> This might need to be split out? It's logically separate. Also, I
>> think this needs to come before the plugin, since the plugin isn't
>> usable until this patch is in place.
>>
>> -Kees
>>
>> >
>> > This feature is ported over from grsecurity.  This is largely
>> > unchanged from the Original code written by the PaX Team and Spender.
>> >
>> > Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
>> > ---
>> >  arch/x86/include/asm/floppy.h                   | 20 ++---
>> >  arch/x86/include/asm/paravirt_types.h           | 18 +++--
>> >  drivers/acpi/acpica/hwxfsleep.c                 | 11 +--
>> >  drivers/block/cciss.h                           | 30 ++++----
>> >  drivers/gpu/drm/nouveau/nouveau_ttm.c           | 28 +++----
>> >  drivers/gpu/drm/ttm/ttm_bo_manager.c            | 10 +--
>> >  drivers/gpu/drm/virtio/virtgpu_ttm.c            | 10 +--
>> >  drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   | 10 +--
>> >  drivers/infiniband/hw/nes/nes_cm.c              | 22 +++---
>> >  drivers/isdn/gigaset/bas-gigaset.c              | 32 ++++----
>> >  drivers/isdn/gigaset/ser-gigaset.c              | 32 ++++----
>> >  drivers/isdn/gigaset/usb-gigaset.c              | 32 ++++----
>> >  drivers/isdn/i4l/isdn_concap.c                  |  6 +-
>> >  drivers/isdn/i4l/isdn_x25iface.c                | 16 ++--
>> >  drivers/media/pci/solo6x10/solo6x10-g723.c      |  2 +-
>> >  drivers/net/ethernet/brocade/bna/bna_enet.c     |  8 +-
>> >  drivers/net/wan/lmc/lmc_media.c                 | 97 +++++++++++++------------
>> >  drivers/scsi/bfa/bfa_fcs.c                      | 19 ++++-
>> >  drivers/scsi/bfa/bfa_fcs_lport.c                | 29 +++++---
>> >  drivers/scsi/bfa/bfa_modules.h                  | 12 +--
>> >  drivers/scsi/hpsa.h                             | 40 +++++-----
>> >  drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |  2 +-
>> >  drivers/staging/lustre/lustre/libcfs/module.c   | 10 +--
>> >  drivers/video/fbdev/matrox/matroxfb_DAC1064.c   | 10 ++-
>> >  drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |  5 +-
>> >  fs/reiserfs/item_ops.c                          | 24 +++---
>> >  include/linux/rbtree_augmented.h                |  4 +-
>> >  lib/rbtree.c                                    |  4 +-
>> >  mm/page_alloc.c                                 |  2 +-
>> >  net/atm/lec.c                                   |  6 +-
>> >  net/atm/mpoa_caches.c                           | 41 +++++------
>> >  net/vmw_vsock/vmci_transport_notify.c           | 30 ++++----
>> >  net/vmw_vsock/vmci_transport_notify_qstate.c    | 30 ++++----
>> >  sound/synth/emux/emux_seq.c                     | 14 ++--
>> >  34 files changed, 352 insertions(+), 314 deletions(-)
>> >
>> > diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
>> > index 1c7eefe..d0e4702 100644
>> > --- a/arch/x86/include/asm/floppy.h
>> > +++ b/arch/x86/include/asm/floppy.h
>> > @@ -229,18 +229,18 @@ static struct fd_routine_l {
>> >         int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
>> >  } fd_routine[] = {
>> >         {
>> > -               request_dma,
>> > -               free_dma,
>> > -               get_dma_residue,
>> > -               dma_mem_alloc,
>> > -               hard_dma_setup
>> > +               ._request_dma = request_dma,
>> > +               ._free_dma = free_dma,
>> > +               ._get_dma_residue = get_dma_residue,
>> > +               ._dma_mem_alloc = dma_mem_alloc,
>> > +               ._dma_setup = hard_dma_setup
>> >         },
>> >         {
>> > -               vdma_request_dma,
>> > -               vdma_nop,
>> > -               vdma_get_dma_residue,
>> > -               vdma_mem_alloc,
>> > -               vdma_dma_setup
>> > +               ._request_dma = vdma_request_dma,
>> > +               ._free_dma = vdma_nop,
>> > +               ._get_dma_residue = vdma_get_dma_residue,
>> > +               ._dma_mem_alloc = vdma_mem_alloc,
>> > +               ._dma_setup = vdma_dma_setup
>> >         }
>> >  };
>> >
>> > diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
>> > index 77db561..927c396 100644
>> > --- a/arch/x86/include/asm/paravirt_types.h
>> > +++ b/arch/x86/include/asm/paravirt_types.h
>> > @@ -89,7 +89,7 @@ struct pv_init_ops {
>> >          */
>> >         unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
>> >                           unsigned long addr, unsigned len);
>> > -};
>> > +} __no_randomize_layout;
>> >
>> >
>> >  struct pv_lazy_ops {
>> > @@ -97,12 +97,12 @@ struct pv_lazy_ops {
>> >         void (*enter)(void);
>> >         void (*leave)(void);
>> >         void (*flush)(void);
>> > -};
>> > +} __no_randomize_layout;
>> >
>> >  struct pv_time_ops {
>> >         unsigned long long (*sched_clock)(void);
>> >         unsigned long long (*steal_clock)(int cpu);
>> > -};
>> > +} __no_randomize_layout;
>> >
>> >  struct pv_cpu_ops {
>> >         /* hooks for various privileged instructions */
>> > @@ -178,7 +178,7 @@ struct pv_cpu_ops {
>> >
>> >         void (*start_context_switch)(struct task_struct *prev);
>> >         void (*end_context_switch)(struct task_struct *next);
>> > -};
>> > +} __no_randomize_layout;
>> >
>> >  struct pv_irq_ops {
>> >         /*
>> > @@ -201,7 +201,7 @@ struct pv_irq_ops {
>> >  #ifdef CONFIG_X86_64
>> >         void (*adjust_exception_frame)(void);
>> >  #endif
>> > -};
>> > +} __no_randomize_layout;
>> >
>> >  struct pv_mmu_ops {
>> >         unsigned long (*read_cr2)(void);
>> > @@ -296,7 +296,7 @@ struct pv_mmu_ops {
>> >            an mfn.  We can tell which is which from the index. */
>> >         void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
>> >                            phys_addr_t phys, pgprot_t flags);
>> > -};
>> > +} __no_randomize_layout;
>> >
>> >  struct arch_spinlock;
>> >  #ifdef CONFIG_SMP
>> > @@ -322,7 +322,9 @@ struct pv_lock_ops {
>> >
>> >  /* This contains all the paravirt structures: we get a convenient
>> >   * number for each function using the offset which we use to indicate
>> > - * what to patch. */
>> > + * what to patch.
>> > + * shouldn't be randomized due to the "NEAT TRICK" in paravirt.c
>> > + */
>> >  struct paravirt_patch_template {
>> >         struct pv_init_ops pv_init_ops;
>> >         struct pv_time_ops pv_time_ops;
>> > @@ -330,7 +332,7 @@ struct paravirt_patch_template {
>> >         struct pv_irq_ops pv_irq_ops;
>> >         struct pv_mmu_ops pv_mmu_ops;
>> >         struct pv_lock_ops pv_lock_ops;
>> > -};
>> > +} __no_randomize_layout;
>> >
>> >  extern struct pv_info pv_info;
>> >  extern struct pv_init_ops pv_init_ops;
>> > diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
>> > index f76e0ea..4b83315 100644
>> > --- a/drivers/acpi/acpica/hwxfsleep.c
>> > +++ b/drivers/acpi/acpica/hwxfsleep.c
>> > @@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
>> >  /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
>> >
>> >  static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
>> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
>> > -        acpi_hw_extended_sleep},
>> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
>> > -        acpi_hw_extended_wake_prep},
>> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake}
>> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
>> > +        .extended_function = acpi_hw_extended_sleep},
>> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
>> > +        .extended_function = acpi_hw_extended_wake_prep},
>> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake),
>> > +        .extended_function = acpi_hw_extended_wake}
>> >  };
>> >
>> >  /*
>> > diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
>> > index 7fda30e..428766d 100644
>> > --- a/drivers/block/cciss.h
>> > +++ b/drivers/block/cciss.h
>> > @@ -402,27 +402,27 @@ static bool SA5_performant_intr_pending(ctlr_info_t *h)
>> >  }
>> >
>> >  static struct access_method SA5_access = {
>> > -       SA5_submit_command,
>> > -       SA5_intr_mask,
>> > -       SA5_fifo_full,
>> > -       SA5_intr_pending,
>> > -       SA5_completed,
>> > +       .submit_command = SA5_submit_command,
>> > +       .set_intr_mask = SA5_intr_mask,
>> > +       .fifo_full = SA5_fifo_full,
>> > +       .intr_pending = SA5_intr_pending,
>> > +       .command_completed = SA5_completed,
>> >  };
>> >
>> >  static struct access_method SA5B_access = {
>> > -        SA5_submit_command,
>> > -        SA5B_intr_mask,
>> > -        SA5_fifo_full,
>> > -        SA5B_intr_pending,
>> > -        SA5_completed,
>> > +       .submit_command = SA5_submit_command,
>> > +       .set_intr_mask = SA5B_intr_mask,
>> > +       .fifo_full = SA5_fifo_full,
>> > +       .intr_pending = SA5B_intr_pending,
>> > +       .command_completed = SA5_completed,
>> >  };
>> >
>> >  static struct access_method SA5_performant_access = {
>> > -       SA5_submit_command,
>> > -       SA5_performant_intr_mask,
>> > -       SA5_fifo_full,
>> > -       SA5_performant_intr_pending,
>> > -       SA5_performant_completed,
>> > +       .submit_command = SA5_submit_command,
>> > +       .set_intr_mask = SA5_performant_intr_mask,
>> > +       .fifo_full = SA5_fifo_full,
>> > +       .intr_pending = SA5_performant_intr_pending,
>> > +       .command_completed = SA5_performant_completed,
>> >  };
>> >
>> >  struct board_type {
>> > diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
>> > index d2e7d20..7bbe51f 100644
>> > --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
>> > +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
>> > @@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
>> >  }
>> >
>> >  const struct ttm_mem_type_manager_func nouveau_vram_manager = {
>> > -       nouveau_vram_manager_init,
>> > -       nouveau_vram_manager_fini,
>> > -       nouveau_vram_manager_new,
>> > -       nouveau_vram_manager_del,
>> > +       .init = nouveau_vram_manager_init,
>> > +       .takedown = nouveau_vram_manager_fini,
>> > +       .get_node = nouveau_vram_manager_new,
>> > +       .put_node = nouveau_vram_manager_del,
>> >  };
>> >
>> >  static int
>> > @@ -183,11 +183,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
>> >  }
>> >
>> >  const struct ttm_mem_type_manager_func nouveau_gart_manager = {
>> > -       nouveau_gart_manager_init,
>> > -       nouveau_gart_manager_fini,
>> > -       nouveau_gart_manager_new,
>> > -       nouveau_gart_manager_del,
>> > -       nouveau_gart_manager_debug
>> > +       .init = nouveau_gart_manager_init,
>> > +       .takedown = nouveau_gart_manager_fini,
>> > +       .get_node = nouveau_gart_manager_new,
>> > +       .put_node = nouveau_gart_manager_del,
>> > +       .debug = nouveau_gart_manager_debug
>> >  };
>> >
>> >  /*XXX*/
>> > @@ -256,11 +256,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
>> >  }
>> >
>> >  const struct ttm_mem_type_manager_func nv04_gart_manager = {
>> > -       nv04_gart_manager_init,
>> > -       nv04_gart_manager_fini,
>> > -       nv04_gart_manager_new,
>> > -       nv04_gart_manager_del,
>> > -       nv04_gart_manager_debug
>> > +       .init = nv04_gart_manager_init,
>> > +       .takedown = nv04_gart_manager_fini,
>> > +       .get_node = nv04_gart_manager_new,
>> > +       .put_node = nv04_gart_manager_del,
>> > +       .debug = nv04_gart_manager_debug
>> >  };
>> >
>> >  int
>> > diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
>> > index aa0bd05..aea6a01 100644
>> > --- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
>> > +++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
>> > @@ -148,10 +148,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
>> >  }
>> >
>> >  const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
>> > -       ttm_bo_man_init,
>> > -       ttm_bo_man_takedown,
>> > -       ttm_bo_man_get_node,
>> > -       ttm_bo_man_put_node,
>> > -       ttm_bo_man_debug
>> > +       .init = ttm_bo_man_init,
>> > +       .takedown = ttm_bo_man_takedown,
>> > +       .get_node = ttm_bo_man_get_node,
>> > +       .put_node = ttm_bo_man_put_node,
>> > +       .debug = ttm_bo_man_debug
>> >  };
>> >  EXPORT_SYMBOL(ttm_bo_manager_func);
>> > diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
>> > index 9fd924c..e5ec4ef 100644
>> > --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
>> > +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
>> > @@ -198,11 +198,11 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
>> >  }
>> >
>> >  static const struct ttm_mem_type_manager_func virtio_gpu_bo_manager_func = {
>> > -       ttm_bo_man_init,
>> > -       ttm_bo_man_takedown,
>> > -       ttm_bo_man_get_node,
>> > -       ttm_bo_man_put_node,
>> > -       ttm_bo_man_debug
>> > +       .init = ttm_bo_man_init,
>> > +       .takedown = ttm_bo_man_takedown,
>> > +       .get_node = ttm_bo_man_get_node,
>> > +       .put_node = ttm_bo_man_put_node,
>> > +       .debug = ttm_bo_man_debug
>> >  };
>> >
>> >  static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
>> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
>> > index 170b61b..fec7348 100644
>> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
>> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
>> > @@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
>> >  }
>> >
>> >  const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
>> > -       vmw_gmrid_man_init,
>> > -       vmw_gmrid_man_takedown,
>> > -       vmw_gmrid_man_get_node,
>> > -       vmw_gmrid_man_put_node,
>> > -       vmw_gmrid_man_debug
>> > +       .init = vmw_gmrid_man_init,
>> > +       .takedown = vmw_gmrid_man_takedown,
>> > +       .get_node = vmw_gmrid_man_get_node,
>> > +       .put_node = vmw_gmrid_man_put_node,
>> > +       .debug = vmw_gmrid_man_debug
>> >  };
>> > diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
>> > index cb9f0f2..8b1f654 100644
>> > --- a/drivers/infiniband/hw/nes/nes_cm.c
>> > +++ b/drivers/infiniband/hw/nes/nes_cm.c
>> > @@ -135,17 +135,17 @@ static void record_ird_ord(struct nes_cm_node *, u16, u16);
>> >  /* instance of function pointers for client API */
>> >  /* set address of this instance to cm_core->cm_ops at cm_core alloc */
>> >  static const struct nes_cm_ops nes_cm_api = {
>> > -       mini_cm_accelerated,
>> > -       mini_cm_listen,
>> > -       mini_cm_del_listen,
>> > -       mini_cm_connect,
>> > -       mini_cm_close,
>> > -       mini_cm_accept,
>> > -       mini_cm_reject,
>> > -       mini_cm_recv_pkt,
>> > -       mini_cm_dealloc_core,
>> > -       mini_cm_get,
>> > -       mini_cm_set
>> > +       .accelerated = mini_cm_accelerated,
>> > +       .listen = mini_cm_listen,
>> > +       .stop_listener = mini_cm_del_listen,
>> > +       .connect = mini_cm_connect,
>> > +       .close = mini_cm_close,
>> > +       .accept = mini_cm_accept,
>> > +       .reject = mini_cm_reject,
>> > +       .recv_pkt = mini_cm_recv_pkt,
>> > +       .destroy_cm_core = mini_cm_dealloc_core,
>> > +       .get = mini_cm_get,
>> > +       .set = mini_cm_set
>> >  };
>> >
>> >  static struct nes_cm_core *g_cm_core;
>> > diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
>> > index aecec6d..11e13c5 100644
>> > --- a/drivers/isdn/gigaset/bas-gigaset.c
>> > +++ b/drivers/isdn/gigaset/bas-gigaset.c
>> > @@ -2565,22 +2565,22 @@ static int gigaset_post_reset(struct usb_interface *intf)
>> >
>> >
>> >  static const struct gigaset_ops gigops = {
>> > -       gigaset_write_cmd,
>> > -       gigaset_write_room,
>> > -       gigaset_chars_in_buffer,
>> > -       gigaset_brkchars,
>> > -       gigaset_init_bchannel,
>> > -       gigaset_close_bchannel,
>> > -       gigaset_initbcshw,
>> > -       gigaset_freebcshw,
>> > -       gigaset_reinitbcshw,
>> > -       gigaset_initcshw,
>> > -       gigaset_freecshw,
>> > -       gigaset_set_modem_ctrl,
>> > -       gigaset_baud_rate,
>> > -       gigaset_set_line_ctrl,
>> > -       gigaset_isoc_send_skb,
>> > -       gigaset_isoc_input,
>> > +       .write_cmd = gigaset_write_cmd,
>> > +       .write_room = gigaset_write_room,
>> > +       .chars_in_buffer = gigaset_chars_in_buffer,
>> > +       .brkchars = gigaset_brkchars,
>> > +       .init_bchannel = gigaset_init_bchannel,
>> > +       .close_bchannel = gigaset_close_bchannel,
>> > +       .initbcshw = gigaset_initbcshw,
>> > +       .freebcshw = gigaset_freebcshw,
>> > +       .reinitbcshw = gigaset_reinitbcshw,
>> > +       .initcshw = gigaset_initcshw,
>> > +       .freecshw = gigaset_freecshw,
>> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
>> > +       .baud_rate = gigaset_baud_rate,
>> > +       .set_line_ctrl = gigaset_set_line_ctrl,
>> > +       .send_skb = gigaset_isoc_send_skb,
>> > +       .handle_input = gigaset_isoc_input,
>> >  };
>> >
>> >  /* bas_gigaset_init
>> > diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
>> > index d1f8ab9..c0412f2 100644
>> > --- a/drivers/isdn/gigaset/ser-gigaset.c
>> > +++ b/drivers/isdn/gigaset/ser-gigaset.c
>> > @@ -445,22 +445,22 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
>> >  }
>> >
>> >  static const struct gigaset_ops ops = {
>> > -       gigaset_write_cmd,
>> > -       gigaset_write_room,
>> > -       gigaset_chars_in_buffer,
>> > -       gigaset_brkchars,
>> > -       gigaset_init_bchannel,
>> > -       gigaset_close_bchannel,
>> > -       gigaset_initbcshw,
>> > -       gigaset_freebcshw,
>> > -       gigaset_reinitbcshw,
>> > -       gigaset_initcshw,
>> > -       gigaset_freecshw,
>> > -       gigaset_set_modem_ctrl,
>> > -       gigaset_baud_rate,
>> > -       gigaset_set_line_ctrl,
>> > -       gigaset_m10x_send_skb,  /* asyncdata.c */
>> > -       gigaset_m10x_input,     /* asyncdata.c */
>> > +       .write_cmd = gigaset_write_cmd,
>> > +       .write_room = gigaset_write_room,
>> > +       .chars_in_buffer = gigaset_chars_in_buffer,
>> > +       .brkchars = gigaset_brkchars,
>> > +       .init_bchannel = gigaset_init_bchannel,
>> > +       .close_bchannel = gigaset_close_bchannel,
>> > +       .initbcshw = gigaset_initbcshw,
>> > +       .freebcshw = gigaset_freebcshw,
>> > +       .reinitbcshw = gigaset_reinitbcshw,
>> > +       .initcshw = gigaset_initcshw,
>> > +       .freecshw = gigaset_freecshw,
>> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
>> > +       .baud_rate = gigaset_baud_rate,
>> > +       .set_line_ctrl = gigaset_set_line_ctrl,
>> > +       .send_skb = gigaset_m10x_send_skb,      /* asyncdata.c */
>> > +       .handle_input = gigaset_m10x_input,     /* asyncdata.c */
>> >  };
>> >
>> >
>> > diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
>> > index 5f306e2..eade36d 100644
>> > --- a/drivers/isdn/gigaset/usb-gigaset.c
>> > +++ b/drivers/isdn/gigaset/usb-gigaset.c
>> > @@ -862,22 +862,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
>> >  }
>> >
>> >  static const struct gigaset_ops ops = {
>> > -       gigaset_write_cmd,
>> > -       gigaset_write_room,
>> > -       gigaset_chars_in_buffer,
>> > -       gigaset_brkchars,
>> > -       gigaset_init_bchannel,
>> > -       gigaset_close_bchannel,
>> > -       gigaset_initbcshw,
>> > -       gigaset_freebcshw,
>> > -       gigaset_reinitbcshw,
>> > -       gigaset_initcshw,
>> > -       gigaset_freecshw,
>> > -       gigaset_set_modem_ctrl,
>> > -       gigaset_baud_rate,
>> > -       gigaset_set_line_ctrl,
>> > -       gigaset_m10x_send_skb,
>> > -       gigaset_m10x_input,
>> > +       .write_cmd = gigaset_write_cmd,
>> > +       .write_room = gigaset_write_room,
>> > +       .chars_in_buffer = gigaset_chars_in_buffer,
>> > +       .brkchars = gigaset_brkchars,
>> > +       .init_bchannel = gigaset_init_bchannel,
>> > +       .close_bchannel = gigaset_close_bchannel,
>> > +       .initbcshw = gigaset_initbcshw,
>> > +       .freebcshw = gigaset_freebcshw,
>> > +       .reinitbcshw = gigaset_reinitbcshw,
>> > +       .initcshw = gigaset_initcshw,
>> > +       .freecshw = gigaset_freecshw,
>> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
>> > +       .baud_rate = gigaset_baud_rate,
>> > +       .set_line_ctrl = gigaset_set_line_ctrl,
>> > +       .send_skb = gigaset_m10x_send_skb,
>> > +       .handle_input = gigaset_m10x_input,
>> >  };
>> >
>> >  /*
>> > diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
>> > index 91d5730..336523e 100644
>> > --- a/drivers/isdn/i4l/isdn_concap.c
>> > +++ b/drivers/isdn/i4l/isdn_concap.c
>> > @@ -80,9 +80,9 @@ static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
>> >  }
>> >
>> >  struct concap_device_ops isdn_concap_reliable_dl_dops = {
>> > -       &isdn_concap_dl_data_req,
>> > -       &isdn_concap_dl_connect_req,
>> > -       &isdn_concap_dl_disconn_req
>> > +       .data_req = &isdn_concap_dl_data_req,
>> > +       .connect_req = &isdn_concap_dl_connect_req,
>> > +       .disconn_req = &isdn_concap_dl_disconn_req
>> >  };
>> >
>> >  /* The following should better go into a dedicated source file such that
>> > diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
>> > index e2d4e58..40cd045 100644
>> > --- a/drivers/isdn/i4l/isdn_x25iface.c
>> > +++ b/drivers/isdn/i4l/isdn_x25iface.c
>> > @@ -53,14 +53,14 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *);
>> >
>> >
>> >  static struct concap_proto_ops ix25_pops = {
>> > -       &isdn_x25iface_proto_new,
>> > -       &isdn_x25iface_proto_del,
>> > -       &isdn_x25iface_proto_restart,
>> > -       &isdn_x25iface_proto_close,
>> > -       &isdn_x25iface_xmit,
>> > -       &isdn_x25iface_receive,
>> > -       &isdn_x25iface_connect_ind,
>> > -       &isdn_x25iface_disconn_ind
>> > +       .proto_new = &isdn_x25iface_proto_new,
>> > +       .proto_del = &isdn_x25iface_proto_del,
>> > +       .restart = &isdn_x25iface_proto_restart,
>> > +       .close = &isdn_x25iface_proto_close,
>> > +       .encap_and_xmit = &isdn_x25iface_xmit,
>> > +       .data_ind = &isdn_x25iface_receive,
>> > +       .connect_ind = &isdn_x25iface_connect_ind,
>> > +       .disconn_ind = &isdn_x25iface_disconn_ind
>> >  };
>> >
>> >  /* error message helper function */
>> > diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
>> > index 4a37a1c..7e82dfd 100644
>> > --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
>> > +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
>> > @@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
>> >
>> >  int solo_g723_init(struct solo_dev *solo_dev)
>> >  {
>> > -       static struct snd_device_ops ops = { NULL };
>> > +       static struct snd_device_ops ops = { };
>> >         struct snd_card *card;
>> >         struct snd_kcontrol_new kctl;
>> >         char name[32];
>> > diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c
>> > index 4e5c387..bba8173 100644
>> > --- a/drivers/net/ethernet/brocade/bna/bna_enet.c
>> > +++ b/drivers/net/ethernet/brocade/bna/bna_enet.c
>> > @@ -1676,10 +1676,10 @@ bna_cb_ioceth_reset(void *arg)
>> >  }
>> >
>> >  static struct bfa_ioc_cbfn bna_ioceth_cbfn = {
>> > -       bna_cb_ioceth_enable,
>> > -       bna_cb_ioceth_disable,
>> > -       bna_cb_ioceth_hbfail,
>> > -       bna_cb_ioceth_reset
>> > +       .enable_cbfn = bna_cb_ioceth_enable,
>> > +       .disable_cbfn = bna_cb_ioceth_disable,
>> > +       .hbfail_cbfn = bna_cb_ioceth_hbfail,
>> > +       .reset_cbfn = bna_cb_ioceth_reset
>> >  };
>> >
>> >  static void bna_attr_init(struct bna_ioceth *ioceth)
>> > diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
>> > index 5920c99..ff2e4a5 100644
>> > --- a/drivers/net/wan/lmc/lmc_media.c
>> > +++ b/drivers/net/wan/lmc/lmc_media.c
>> > @@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int);
>> >  static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
>> >
>> >  lmc_media_t lmc_ds3_media = {
>> > -  lmc_ds3_init,                        /* special media init stuff */
>> > -  lmc_ds3_default,             /* reset to default state */
>> > -  lmc_ds3_set_status,          /* reset status to state provided */
>> > -  lmc_dummy_set_1,             /* set clock source */
>> > -  lmc_dummy_set2_1,            /* set line speed */
>> > -  lmc_ds3_set_100ft,           /* set cable length */
>> > -  lmc_ds3_set_scram,           /* set scrambler */
>> > -  lmc_ds3_get_link_status,     /* get link status */
>> > -  lmc_dummy_set_1,             /* set link status */
>> > -  lmc_ds3_set_crc_length,      /* set CRC length */
>> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
>> > -  lmc_ds3_watchdog
>> > +  .init = lmc_ds3_init,                                /* special media init stuff */
>> > +  .defaults = lmc_ds3_default,                 /* reset to default state */
>> > +  .set_status = lmc_ds3_set_status,            /* reset status to state provided */
>> > +  .set_clock_source = lmc_dummy_set_1,         /* set clock source */
>> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
>> > +  .set_cable_length = lmc_ds3_set_100ft,       /* set cable length */
>> > +  .set_scrambler = lmc_ds3_set_scram,          /* set scrambler */
>> > +  .get_link_status = lmc_ds3_get_link_status,  /* get link status */
>> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
>> > +  .set_crc_length = lmc_ds3_set_crc_length,    /* set CRC length */
>> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
>> > +  .watchdog = lmc_ds3_watchdog
>> >  };
>> >
>> >  lmc_media_t lmc_hssi_media = {
>> > -  lmc_hssi_init,               /* special media init stuff */
>> > -  lmc_hssi_default,            /* reset to default state */
>> > -  lmc_hssi_set_status,         /* reset status to state provided */
>> > -  lmc_hssi_set_clock,          /* set clock source */
>> > -  lmc_dummy_set2_1,            /* set line speed */
>> > -  lmc_dummy_set_1,             /* set cable length */
>> > -  lmc_dummy_set_1,             /* set scrambler */
>> > -  lmc_hssi_get_link_status,    /* get link status */
>> > -  lmc_hssi_set_link_status,    /* set link status */
>> > -  lmc_hssi_set_crc_length,     /* set CRC length */
>> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
>> > -  lmc_hssi_watchdog
>> > +  .init = lmc_hssi_init,                       /* special media init stuff */
>> > +  .defaults = lmc_hssi_default,                        /* reset to default state */
>> > +  .set_status = lmc_hssi_set_status,           /* reset status to state provided */
>> > +  .set_clock_source = lmc_hssi_set_clock,      /* set clock source */
>> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
>> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
>> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
>> > +  .get_link_status = lmc_hssi_get_link_status, /* get link status */
>> > +  .set_link_status = lmc_hssi_set_link_status, /* set link status */
>> > +  .set_crc_length = lmc_hssi_set_crc_length,   /* set CRC length */
>> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
>> > +  .watchdog = lmc_hssi_watchdog
>> >  };
>> >
>> > -lmc_media_t lmc_ssi_media = { lmc_ssi_init,    /* special media init stuff */
>> > -  lmc_ssi_default,             /* reset to default state */
>> > -  lmc_ssi_set_status,          /* reset status to state provided */
>> > -  lmc_ssi_set_clock,           /* set clock source */
>> > -  lmc_ssi_set_speed,           /* set line speed */
>> > -  lmc_dummy_set_1,             /* set cable length */
>> > -  lmc_dummy_set_1,             /* set scrambler */
>> > -  lmc_ssi_get_link_status,     /* get link status */
>> > -  lmc_ssi_set_link_status,     /* set link status */
>> > -  lmc_ssi_set_crc_length,      /* set CRC length */
>> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
>> > -  lmc_ssi_watchdog
>> > +lmc_media_t lmc_ssi_media = {
>> > +  .init = lmc_ssi_init,                                /* special media init stuff */
>> > +  .defaults = lmc_ssi_default,                 /* reset to default state */
>> > +  .set_status = lmc_ssi_set_status,            /* reset status to state provided */
>> > +  .set_clock_source = lmc_ssi_set_clock,       /* set clock source */
>> > +  .set_speed = lmc_ssi_set_speed,              /* set line speed */
>> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
>> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
>> > +  .get_link_status = lmc_ssi_get_link_status,  /* get link status */
>> > +  .set_link_status = lmc_ssi_set_link_status,  /* set link status */
>> > +  .set_crc_length = lmc_ssi_set_crc_length,    /* set CRC length */
>> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
>> > +  .watchdog = lmc_ssi_watchdog
>> >  };
>> >
>> >  lmc_media_t lmc_t1_media = {
>> > -  lmc_t1_init,                 /* special media init stuff */
>> > -  lmc_t1_default,              /* reset to default state */
>> > -  lmc_t1_set_status,           /* reset status to state provided */
>> > -  lmc_t1_set_clock,            /* set clock source */
>> > -  lmc_dummy_set2_1,            /* set line speed */
>> > -  lmc_dummy_set_1,             /* set cable length */
>> > -  lmc_dummy_set_1,             /* set scrambler */
>> > -  lmc_t1_get_link_status,      /* get link status */
>> > -  lmc_dummy_set_1,             /* set link status */
>> > -  lmc_t1_set_crc_length,       /* set CRC length */
>> > -  lmc_t1_set_circuit_type,     /* set T1 or E1 circuit type */
>> > -  lmc_t1_watchdog
>> > +  .init = lmc_t1_init,                         /* special media init stuff */
>> > +  .defaults = lmc_t1_default,                  /* reset to default state */
>> > +  .set_status = lmc_t1_set_status,             /* reset status to state provided */
>> > +  .set_clock_source = lmc_t1_set_clock,                /* set clock source */
>> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
>> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
>> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
>> > +  .get_link_status = lmc_t1_get_link_status,   /* get link status */
>> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
>> > +  .set_crc_length = lmc_t1_set_crc_length,     /* set CRC length */
>> > +  .set_circuit_type = lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
>> > +  .watchdog = lmc_t1_watchdog
>> >  };
>> >
>> >  static void
>> > diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
>> > index 1e7e139..c2031dd 100644
>> > --- a/drivers/scsi/bfa/bfa_fcs.c
>> > +++ b/drivers/scsi/bfa/bfa_fcs.c
>> > @@ -39,10 +39,21 @@ struct bfa_fcs_mod_s {
>> >  #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
>> >
>> >  static struct bfa_fcs_mod_s fcs_modules[] = {
>> > -       { bfa_fcs_port_attach, NULL, NULL },
>> > -       { bfa_fcs_uf_attach, NULL, NULL },
>> > -       { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
>> > -         bfa_fcs_fabric_modexit },
>> > +       {
>> > +               .attach = bfa_fcs_port_attach,
>> > +               .modinit = NULL,
>> > +               .modexit = NULL
>> > +       },
>> > +       {
>> > +               .attach = bfa_fcs_uf_attach,
>> > +               .modinit = NULL,
>> > +               .modexit = NULL
>> > +       },
>> > +       {
>> > +               .attach = bfa_fcs_fabric_attach,
>> > +               .modinit = bfa_fcs_fabric_modinit,
>> > +               .modexit = bfa_fcs_fabric_modexit
>> > +       },
>> >  };
>> >
>> >  /*
>> > diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
>> > index 7733ad5..e5edbce 100644
>> > --- a/drivers/scsi/bfa/bfa_fcs_lport.c
>> > +++ b/drivers/scsi/bfa/bfa_fcs_lport.c
>> > @@ -90,15 +90,26 @@ static struct {
>> >         void            (*offline) (struct bfa_fcs_lport_s *port);
>> >  } __port_action[] = {
>> >         {
>> > -       bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
>> > -                       bfa_fcs_lport_unknown_offline}, {
>> > -       bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
>> > -                       bfa_fcs_lport_fab_offline}, {
>> > -       bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
>> > -                       bfa_fcs_lport_n2n_offline}, {
>> > -       bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
>> > -                       bfa_fcs_lport_loop_offline},
>> > -       };
>> > +               .init = bfa_fcs_lport_unknown_init,
>> > +               .online = bfa_fcs_lport_unknown_online,
>> > +               .offline = bfa_fcs_lport_unknown_offline
>> > +       },
>> > +       {
>> > +               .init = bfa_fcs_lport_fab_init,
>> > +               .online = bfa_fcs_lport_fab_online,
>> > +               .offline = bfa_fcs_lport_fab_offline
>> > +       },
>> > +       {
>> > +               .init = bfa_fcs_lport_n2n_init,
>> > +               .online = bfa_fcs_lport_n2n_online,
>> > +               .offline = bfa_fcs_lport_n2n_offline
>> > +       },
>> > +       {
>> > +               .init = bfa_fcs_lport_loop_init,
>> > +               .online = bfa_fcs_lport_loop_online,
>> > +               .offline = bfa_fcs_lport_loop_offline
>> > +       },
>> > +};
>> >
>> >  /*
>> >   *  fcs_port_sm FCS logical port state machine
>> > diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
>> > index 53135f2..640621b 100644
>> > --- a/drivers/scsi/bfa/bfa_modules.h
>> > +++ b/drivers/scsi/bfa/bfa_modules.h
>> > @@ -79,12 +79,12 @@ enum {
>> >                                                                         \
>> >         extern struct bfa_module_s hal_mod_ ## __mod;                   \
>> >         struct bfa_module_s hal_mod_ ## __mod = {                       \
>> > -               bfa_ ## __mod ## _meminfo,                              \
>> > -               bfa_ ## __mod ## _attach,                               \
>> > -               bfa_ ## __mod ## _detach,                               \
>> > -               bfa_ ## __mod ## _start,                                \
>> > -               bfa_ ## __mod ## _stop,                                 \
>> > -               bfa_ ## __mod ## _iocdisable,                           \
>> > +               .meminfo = bfa_ ## __mod ## _meminfo,                   \
>> > +               .attach = bfa_ ## __mod ## _attach,                     \
>> > +               .detach = bfa_ ## __mod ## _detach,                     \
>> > +               .start = bfa_ ## __mod ## _start,                       \
>> > +               .stop = bfa_ ## __mod ## _stop,                         \
>> > +               .iocdisable = bfa_ ## __mod ## _iocdisable,             \
>> >         }
>> >
>> >  #define BFA_CACHELINE_SZ       (256)
>> > diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
>> > index fdd39fc..b734478 100644
>> > --- a/drivers/scsi/hpsa.h
>> > +++ b/drivers/scsi/hpsa.h
>> > @@ -577,38 +577,38 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
>> >  }
>> >
>> >  static struct access_method SA5_access = {
>> > -       SA5_submit_command,
>> > -       SA5_intr_mask,
>> > -       SA5_intr_pending,
>> > -       SA5_completed,
>> > +       .submit_command = SA5_submit_command,
>> > +       .set_intr_mask = SA5_intr_mask,
>> > +       .intr_pending = SA5_intr_pending,
>> > +       .command_completed = SA5_completed,
>> >  };
>> >
>> >  static struct access_method SA5_ioaccel_mode1_access = {
>> > -       SA5_submit_command,
>> > -       SA5_performant_intr_mask,
>> > -       SA5_ioaccel_mode1_intr_pending,
>> > -       SA5_ioaccel_mode1_completed,
>> > +       .submit_command = SA5_submit_command,
>> > +       .set_intr_mask = SA5_performant_intr_mask,
>> > +       .intr_pending = SA5_ioaccel_mode1_intr_pending,
>> > +       .command_completed = SA5_ioaccel_mode1_completed,
>> >  };
>> >
>> >  static struct access_method SA5_ioaccel_mode2_access = {
>> > -       SA5_submit_command_ioaccel2,
>> > -       SA5_performant_intr_mask,
>> > -       SA5_performant_intr_pending,
>> > -       SA5_performant_completed,
>> > +       .submit_command = SA5_submit_command_ioaccel2,
>> > +       .set_intr_mask = SA5_performant_intr_mask,
>> > +       .intr_pending = SA5_performant_intr_pending,
>> > +       .command_completed = SA5_performant_completed,
>> >  };
>> >
>> >  static struct access_method SA5_performant_access = {
>> > -       SA5_submit_command,
>> > -       SA5_performant_intr_mask,
>> > -       SA5_performant_intr_pending,
>> > -       SA5_performant_completed,
>> > +       .submit_command = SA5_submit_command,
>> > +       .set_intr_mask = SA5_performant_intr_mask,
>> > +       .intr_pending = SA5_performant_intr_pending,
>> > +       .command_completed = SA5_performant_completed,
>> >  };
>> >
>> >  static struct access_method SA5_performant_access_no_read = {
>> > -       SA5_submit_command_no_read,
>> > -       SA5_performant_intr_mask,
>> > -       SA5_performant_intr_pending,
>> > -       SA5_performant_completed,
>> > +       .submit_command = SA5_submit_command_no_read,
>> > +       .set_intr_mask = SA5_performant_intr_mask,
>> > +       .intr_pending = SA5_performant_intr_pending,
>> > +       .command_completed = SA5_performant_completed,
>> >  };
>> >
>> >  struct board_type {
>> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
>> > index 4310154..605d035 100644
>> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
>> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
>> > @@ -147,7 +147,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
>> >         int added = (mode == LCK_NL);
>> >         int overlaps = 0;
>> >         int splitted = 0;
>> > -       const struct ldlm_callback_suite null_cbs = { NULL };
>> > +       const struct ldlm_callback_suite null_cbs = { };
>> >
>> >         CDEBUG(D_DLMTRACE,
>> >                "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
>> > diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
>> > index 329d78c..9756f9e 100644
>> > --- a/drivers/staging/lustre/lustre/libcfs/module.c
>> > +++ b/drivers/staging/lustre/lustre/libcfs/module.c
>> > @@ -322,11 +322,11 @@ out:
>> >  }
>> >
>> >  struct cfs_psdev_ops libcfs_psdev_ops = {
>> > -       libcfs_psdev_open,
>> > -       libcfs_psdev_release,
>> > -       NULL,
>> > -       NULL,
>> > -       libcfs_ioctl
>> > +       .p_open = libcfs_psdev_open,
>> > +       .p_close = libcfs_psdev_release,
>> > +       .p_read = NULL,
>> > +       .p_write = NULL,
>> > +       .p_ioctl = libcfs_ioctl
>> >  };
>> >
>> >  static int proc_call_handler(void *data, int write, loff_t *ppos,
>> > diff --git a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
>> > index a01147f..5d896f8 100644
>> > --- a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
>> > +++ b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
>> > @@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo)
>> >
>> >  #ifdef CONFIG_FB_MATROX_MYSTIQUE
>> >  struct matrox_switch matrox_mystique = {
>> > -       MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore,
>> > +       .preinit = MGA1064_preinit,
>> > +       .reset = MGA1064_reset,
>> > +       .init = MGA1064_init,
>> > +       .restore = MGA1064_restore,
>> >  };
>> >  EXPORT_SYMBOL(matrox_mystique);
>> >  #endif
>> >
>> >  #ifdef CONFIG_FB_MATROX_G
>> >  struct matrox_switch matrox_G100 = {
>> > -       MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore,
>> > +       .preinit = MGAG100_preinit,
>> > +       .reset = MGAG100_reset,
>> > +       .init = MGAG100_init,
>> > +       .restore = MGAG100_restore,
>> >  };
>> >  EXPORT_SYMBOL(matrox_G100);
>> >  #endif
>> > diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
>> > index 195ad7c..09743fc 100644
>> > --- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
>> > +++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
>> > @@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo)
>> >  }
>> >
>> >  struct matrox_switch matrox_millennium = {
>> > -       Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore
>> > +       .preinit = Ti3026_preinit,
>> > +       .reset = Ti3026_reset,
>> > +       .init = Ti3026_init,
>> > +       .restore = Ti3026_restore
>> >  };
>> >  EXPORT_SYMBOL(matrox_millennium);
>> >  #endif
>> > diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
>> > index aca73dd..e3c558d 100644
>> > --- a/fs/reiserfs/item_ops.c
>> > +++ b/fs/reiserfs/item_ops.c
>> > @@ -724,18 +724,18 @@ static void errcatch_print_vi(struct virtual_item *vi)
>> >  }
>> >
>> >  static struct item_operations errcatch_ops = {
>> > -       errcatch_bytes_number,
>> > -       errcatch_decrement_key,
>> > -       errcatch_is_left_mergeable,
>> > -       errcatch_print_item,
>> > -       errcatch_check_item,
>> > -
>> > -       errcatch_create_vi,
>> > -       errcatch_check_left,
>> > -       errcatch_check_right,
>> > -       errcatch_part_size,
>> > -       errcatch_unit_num,
>> > -       errcatch_print_vi
>> > +       .bytes_number = errcatch_bytes_number,
>> > +       .decrement_key = errcatch_decrement_key,
>> > +       .is_left_mergeable = errcatch_is_left_mergeable,
>> > +       .print_item = errcatch_print_item,
>> > +       .check_item = errcatch_check_item,
>> > +
>> > +       .create_vi = errcatch_create_vi,
>> > +       .check_left = errcatch_check_left,
>> > +       .check_right = errcatch_check_right,
>> > +       .part_size = errcatch_part_size,
>> > +       .unit_num = errcatch_unit_num,
>> > +       .print_vi = errcatch_print_vi
>> >  };
>> >
>> >  #if ! (TYPE_STAT_DATA == 0 && TYPE_INDIRECT == 1 && TYPE_DIRECT == 2 && TYPE_DIRENTRY == 3)
>> > diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
>> > index 14d7b83..a1edf56 100644
>> > --- a/include/linux/rbtree_augmented.h
>> > +++ b/include/linux/rbtree_augmented.h
>> > @@ -90,7 +90,9 @@ rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new)     \
>> >         old->rbaugmented = rbcompute(old);                              \
>> >  }                                                                      \
>> >  rbstatic const struct rb_augment_callbacks rbname = {                  \
>> > -       rbname ## _propagate, rbname ## _copy, rbname ## _rotate        \
>> > +       .propagate = rbname ## _propagate,                              \
>> > +       .copy = rbname ## _copy,                                        \
>> > +       .rotate = rbname ## _rotate                                     \
>> >  };
>> >
>> >
>> > diff --git a/lib/rbtree.c b/lib/rbtree.c
>> > index 1356454..70ce6c6 100644
>> > --- a/lib/rbtree.c
>> > +++ b/lib/rbtree.c
>> > @@ -412,7 +412,9 @@ static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {}
>> >  static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {}
>> >
>> >  static const struct rb_augment_callbacks dummy_callbacks = {
>> > -       dummy_propagate, dummy_copy, dummy_rotate
>> > +       .propagate = dummy_propagate,
>> > +       .copy = dummy_copy,
>> > +       .rotate = dummy_rotate
>> >  };
>> >
>> >  void rb_insert_color(struct rb_node *node, struct rb_root *root)
>> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> > index 838ca8bb..7432a90 100644
>> > --- a/mm/page_alloc.c
>> > +++ b/mm/page_alloc.c
>> > @@ -561,7 +561,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page,
>> >                 __mod_zone_freepage_state(zone, (1 << order), migratetype);
>> >  }
>> >  #else
>> > -struct page_ext_operations debug_guardpage_ops = { NULL, };
>> > +struct page_ext_operations debug_guardpage_ops = { .need = NULL, .init = NULL };
>> >  static inline void set_page_guard(struct zone *zone, struct page *page,
>> >                                 unsigned int order, int migratetype) {}
>> >  static inline void clear_page_guard(struct zone *zone, struct page *page,
>> > diff --git a/net/atm/lec.c b/net/atm/lec.c
>> > index cd3b379..977a3c9 100644
>> > --- a/net/atm/lec.c
>> > +++ b/net/atm/lec.c
>> > @@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
>> >  }
>> >
>> >  static struct lane2_ops lane2_ops = {
>> > -       lane2_resolve,          /* resolve,             spec 3.1.3 */
>> > -       lane2_associate_req,    /* associate_req,       spec 3.1.4 */
>> > -       NULL                    /* associate indicator, spec 3.1.5 */
>> > +       .resolve = lane2_resolve,
>> > +       .associate_req = lane2_associate_req,
>> > +       .associate_indicator = NULL
>> >  };
>> >
>> >  static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
>> > diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
>> > index 9e60e74..637c96e 100644
>> > --- a/net/atm/mpoa_caches.c
>> > +++ b/net/atm/mpoa_caches.c
>> > @@ -535,30 +535,29 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
>> >
>> >
>> >  static const struct in_cache_ops ingress_ops = {
>> > -       in_cache_add_entry,               /* add_entry       */
>> > -       in_cache_get,                     /* get             */
>> > -       in_cache_get_with_mask,           /* get_with_mask   */
>> > -       in_cache_get_by_vcc,              /* get_by_vcc      */
>> > -       in_cache_put,                     /* put             */
>> > -       in_cache_remove_entry,            /* remove_entry    */
>> > -       cache_hit,                        /* cache_hit       */
>> > -       clear_count_and_expired,          /* clear_count     */
>> > -       check_resolving_entries,          /* check_resolving */
>> > -       refresh_entries,                  /* refresh         */
>> > -       in_destroy_cache                  /* destroy_cache   */
>> > +       .add_entry = in_cache_add_entry,
>> > +       .get = in_cache_get,
>> > +       .get_with_mask = in_cache_get_with_mask,
>> > +       .get_by_vcc = in_cache_get_by_vcc,
>> > +       .put = in_cache_put,
>> > +       .remove_entry = in_cache_remove_entry,
>> > +       .cache_hit = cache_hit,
>> > +       .clear_count = clear_count_and_expired,
>> > +       .check_resolving = check_resolving_entries,
>> > +       .refresh = refresh_entries,
>> >  };
>> >
>> >  static const struct eg_cache_ops egress_ops = {
>> > -       eg_cache_add_entry,               /* add_entry        */
>> > -       eg_cache_get_by_cache_id,         /* get_by_cache_id  */
>> > -       eg_cache_get_by_tag,              /* get_by_tag       */
>> > -       eg_cache_get_by_vcc,              /* get_by_vcc       */
>> > -       eg_cache_get_by_src_ip,           /* get_by_src_ip    */
>> > -       eg_cache_put,                     /* put              */
>> > -       eg_cache_remove_entry,            /* remove_entry     */
>> > -       update_eg_cache_entry,            /* update           */
>> > -       clear_expired,                    /* clear_expired    */
>> > -       eg_destroy_cache                  /* destroy_cache    */
>> > +       .add_entry = eg_cache_add_entry,
>> > +       .get_by_cache_id = eg_cache_get_by_cache_id,
>> > +       .get_by_tag = eg_cache_get_by_tag,
>> > +       .get_by_vcc = eg_cache_get_by_vcc,
>> > +       .get_by_src_ip = eg_cache_get_by_src_ip,
>> > +       .put = eg_cache_put,
>> > +       .remove_entry = eg_cache_remove_entry,
>> > +       .update = update_eg_cache_entry,
>> > +       .clear_expired = clear_expired,
>> > +       .destroy_cache = eg_destroy_cache
>> >  };
>> >
>> >
>> > diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
>> > index fd8cf02..1406db4 100644
>> > --- a/net/vmw_vsock/vmci_transport_notify.c
>> > +++ b/net/vmw_vsock/vmci_transport_notify.c
>> > @@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
>> >
>> >  /* Socket control packet based operations. */
>> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
>> > -       vmci_transport_notify_pkt_socket_init,
>> > -       vmci_transport_notify_pkt_socket_destruct,
>> > -       vmci_transport_notify_pkt_poll_in,
>> > -       vmci_transport_notify_pkt_poll_out,
>> > -       vmci_transport_notify_pkt_handle_pkt,
>> > -       vmci_transport_notify_pkt_recv_init,
>> > -       vmci_transport_notify_pkt_recv_pre_block,
>> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
>> > -       vmci_transport_notify_pkt_recv_post_dequeue,
>> > -       vmci_transport_notify_pkt_send_init,
>> > -       vmci_transport_notify_pkt_send_pre_block,
>> > -       vmci_transport_notify_pkt_send_pre_enqueue,
>> > -       vmci_transport_notify_pkt_send_post_enqueue,
>> > -       vmci_transport_notify_pkt_process_request,
>> > -       vmci_transport_notify_pkt_process_negotiate,
>> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
>> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
>> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
>> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
>> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
>> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
>> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
>> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
>> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
>> > +       .send_init = vmci_transport_notify_pkt_send_init,
>> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
>> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
>> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
>> > +       .process_request = vmci_transport_notify_pkt_process_request,
>> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
>> >  };
>> > diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
>> > index 21e591d..f3a0afc 100644
>> > --- a/net/vmw_vsock/vmci_transport_notify_qstate.c
>> > +++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
>> > @@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue(
>> >
>> >  /* Socket always on control packet based operations. */
>> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
>> > -       vmci_transport_notify_pkt_socket_init,
>> > -       vmci_transport_notify_pkt_socket_destruct,
>> > -       vmci_transport_notify_pkt_poll_in,
>> > -       vmci_transport_notify_pkt_poll_out,
>> > -       vmci_transport_notify_pkt_handle_pkt,
>> > -       vmci_transport_notify_pkt_recv_init,
>> > -       vmci_transport_notify_pkt_recv_pre_block,
>> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
>> > -       vmci_transport_notify_pkt_recv_post_dequeue,
>> > -       vmci_transport_notify_pkt_send_init,
>> > -       vmci_transport_notify_pkt_send_pre_block,
>> > -       vmci_transport_notify_pkt_send_pre_enqueue,
>> > -       vmci_transport_notify_pkt_send_post_enqueue,
>> > -       vmci_transport_notify_pkt_process_request,
>> > -       vmci_transport_notify_pkt_process_negotiate,
>> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
>> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
>> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
>> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
>> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
>> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
>> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
>> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
>> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
>> > +       .send_init = vmci_transport_notify_pkt_send_init,
>> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
>> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
>> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
>> > +       .process_request = vmci_transport_notify_pkt_process_request,
>> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
>> >  };
>> > diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
>> > index a020920..55579f6 100644
>> > --- a/sound/synth/emux/emux_seq.c
>> > +++ b/sound/synth/emux/emux_seq.c
>> > @@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
>> >   * MIDI emulation operators
>> >   */
>> >  static struct snd_midi_op emux_ops = {
>> > -       snd_emux_note_on,
>> > -       snd_emux_note_off,
>> > -       snd_emux_key_press,
>> > -       snd_emux_terminate_note,
>> > -       snd_emux_control,
>> > -       snd_emux_nrpn,
>> > -       snd_emux_sysex,
>> > +       .note_on = snd_emux_note_on,
>> > +       .note_off = snd_emux_note_off,
>> > +       .key_press = snd_emux_key_press,
>> > +       .note_terminate = snd_emux_terminate_note,
>> > +       .control = snd_emux_control,
>> > +       .nrpn = snd_emux_nrpn,
>> > +       .sysex = snd_emux_sysex,
>> >  };
>> >
>> >
>> > --
>> > 1.9.1
>> >
>>
>>
>>
>> --
>> Kees Cook
>> Chrome OS & Brillo Security
>>



-- 
Kees Cook
Chrome OS & Brillo Security

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

* [kernel-hardening] Re: [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs
  2016-06-13 18:15       ` Kees Cook
@ 2016-06-13 19:57         ` Julia Lawall
  2016-06-13 20:26           ` Kees Cook
  2016-06-13 20:28         ` Leibowitz, Michael
  1 sibling, 1 reply; 21+ messages in thread
From: Julia Lawall @ 2016-06-13 19:57 UTC (permalink / raw)
  To: Kees Cook
  Cc: Michael Leibowitz, Brad Spengler, kernel-hardening, Emese Revfy,
	PaX Team

On Mon, 13 Jun 2016, Kees Cook wrote:

> On Mon, Jun 13, 2016 at 7:32 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> > On Thu, 5 May 2016, Kees Cook wrote:
> >
> >> On Thu, May 5, 2016 at 10:21 AM, Michael Leibowitz
> >> <michael.leibowitz@intel.com> wrote:
> >> > Due to randomization of structs, the in order struct intialization
> >> > style is replaced with explicit field style.
> >> >
> >> > struct foo_t my_foo = {
> >> >        one,
> >> >        two,
> >> >        three
> >> > };
> >> >
> >> > becomes
> >> >
> >> > struct foo_t my_foo = {
> >> >        .one = one,
> >> >        .two = two,
> >> >        .three = three
> >> > };
> >>
> >> Can a coccinelle script be written to do this also? It might be useful
> >> to keep that around.
> >
> > Is this needed for all kinds of structure initializations, ie for both
> > local and global variables, or only for global variables?
> 
> It's needed for any structure that has been globally defined. As in,
> any use of a struct must be using C99 since that structure may be
> randomized (in any context: global, local).

I'm not sure to understand what it means for a structure to be globally 
defined.  If the code is:

int f(...) {
  struct foo x = { 3, 4, 5, };
  ...
}

is it correct that it does not need to use C99?

thanks,
julia

> Michael, what's the state of this series? What're your next steps?
> 
> -Kees
> 
> >
> > thanks,
> > julia
> >
> >>
> >> >
> >> > Additionally, tag paravirt related structures to explicitly not be
> >> > randomized, as the structure layout is important.
> >>
> >> This might need to be split out? It's logically separate. Also, I
> >> think this needs to come before the plugin, since the plugin isn't
> >> usable until this patch is in place.
> >>
> >> -Kees
> >>
> >> >
> >> > This feature is ported over from grsecurity.  This is largely
> >> > unchanged from the Original code written by the PaX Team and Spender.
> >> >
> >> > Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
> >> > ---
> >> >  arch/x86/include/asm/floppy.h                   | 20 ++---
> >> >  arch/x86/include/asm/paravirt_types.h           | 18 +++--
> >> >  drivers/acpi/acpica/hwxfsleep.c                 | 11 +--
> >> >  drivers/block/cciss.h                           | 30 ++++----
> >> >  drivers/gpu/drm/nouveau/nouveau_ttm.c           | 28 +++----
> >> >  drivers/gpu/drm/ttm/ttm_bo_manager.c            | 10 +--
> >> >  drivers/gpu/drm/virtio/virtgpu_ttm.c            | 10 +--
> >> >  drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   | 10 +--
> >> >  drivers/infiniband/hw/nes/nes_cm.c              | 22 +++---
> >> >  drivers/isdn/gigaset/bas-gigaset.c              | 32 ++++----
> >> >  drivers/isdn/gigaset/ser-gigaset.c              | 32 ++++----
> >> >  drivers/isdn/gigaset/usb-gigaset.c              | 32 ++++----
> >> >  drivers/isdn/i4l/isdn_concap.c                  |  6 +-
> >> >  drivers/isdn/i4l/isdn_x25iface.c                | 16 ++--
> >> >  drivers/media/pci/solo6x10/solo6x10-g723.c      |  2 +-
> >> >  drivers/net/ethernet/brocade/bna/bna_enet.c     |  8 +-
> >> >  drivers/net/wan/lmc/lmc_media.c                 | 97 +++++++++++++------------
> >> >  drivers/scsi/bfa/bfa_fcs.c                      | 19 ++++-
> >> >  drivers/scsi/bfa/bfa_fcs_lport.c                | 29 +++++---
> >> >  drivers/scsi/bfa/bfa_modules.h                  | 12 +--
> >> >  drivers/scsi/hpsa.h                             | 40 +++++-----
> >> >  drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |  2 +-
> >> >  drivers/staging/lustre/lustre/libcfs/module.c   | 10 +--
> >> >  drivers/video/fbdev/matrox/matroxfb_DAC1064.c   | 10 ++-
> >> >  drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |  5 +-
> >> >  fs/reiserfs/item_ops.c                          | 24 +++---
> >> >  include/linux/rbtree_augmented.h                |  4 +-
> >> >  lib/rbtree.c                                    |  4 +-
> >> >  mm/page_alloc.c                                 |  2 +-
> >> >  net/atm/lec.c                                   |  6 +-
> >> >  net/atm/mpoa_caches.c                           | 41 +++++------
> >> >  net/vmw_vsock/vmci_transport_notify.c           | 30 ++++----
> >> >  net/vmw_vsock/vmci_transport_notify_qstate.c    | 30 ++++----
> >> >  sound/synth/emux/emux_seq.c                     | 14 ++--
> >> >  34 files changed, 352 insertions(+), 314 deletions(-)
> >> >
> >> > diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
> >> > index 1c7eefe..d0e4702 100644
> >> > --- a/arch/x86/include/asm/floppy.h
> >> > +++ b/arch/x86/include/asm/floppy.h
> >> > @@ -229,18 +229,18 @@ static struct fd_routine_l {
> >> >         int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
> >> >  } fd_routine[] = {
> >> >         {
> >> > -               request_dma,
> >> > -               free_dma,
> >> > -               get_dma_residue,
> >> > -               dma_mem_alloc,
> >> > -               hard_dma_setup
> >> > +               ._request_dma = request_dma,
> >> > +               ._free_dma = free_dma,
> >> > +               ._get_dma_residue = get_dma_residue,
> >> > +               ._dma_mem_alloc = dma_mem_alloc,
> >> > +               ._dma_setup = hard_dma_setup
> >> >         },
> >> >         {
> >> > -               vdma_request_dma,
> >> > -               vdma_nop,
> >> > -               vdma_get_dma_residue,
> >> > -               vdma_mem_alloc,
> >> > -               vdma_dma_setup
> >> > +               ._request_dma = vdma_request_dma,
> >> > +               ._free_dma = vdma_nop,
> >> > +               ._get_dma_residue = vdma_get_dma_residue,
> >> > +               ._dma_mem_alloc = vdma_mem_alloc,
> >> > +               ._dma_setup = vdma_dma_setup
> >> >         }
> >> >  };
> >> >
> >> > diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
> >> > index 77db561..927c396 100644
> >> > --- a/arch/x86/include/asm/paravirt_types.h
> >> > +++ b/arch/x86/include/asm/paravirt_types.h
> >> > @@ -89,7 +89,7 @@ struct pv_init_ops {
> >> >          */
> >> >         unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
> >> >                           unsigned long addr, unsigned len);
> >> > -};
> >> > +} __no_randomize_layout;
> >> >
> >> >
> >> >  struct pv_lazy_ops {
> >> > @@ -97,12 +97,12 @@ struct pv_lazy_ops {
> >> >         void (*enter)(void);
> >> >         void (*leave)(void);
> >> >         void (*flush)(void);
> >> > -};
> >> > +} __no_randomize_layout;
> >> >
> >> >  struct pv_time_ops {
> >> >         unsigned long long (*sched_clock)(void);
> >> >         unsigned long long (*steal_clock)(int cpu);
> >> > -};
> >> > +} __no_randomize_layout;
> >> >
> >> >  struct pv_cpu_ops {
> >> >         /* hooks for various privileged instructions */
> >> > @@ -178,7 +178,7 @@ struct pv_cpu_ops {
> >> >
> >> >         void (*start_context_switch)(struct task_struct *prev);
> >> >         void (*end_context_switch)(struct task_struct *next);
> >> > -};
> >> > +} __no_randomize_layout;
> >> >
> >> >  struct pv_irq_ops {
> >> >         /*
> >> > @@ -201,7 +201,7 @@ struct pv_irq_ops {
> >> >  #ifdef CONFIG_X86_64
> >> >         void (*adjust_exception_frame)(void);
> >> >  #endif
> >> > -};
> >> > +} __no_randomize_layout;
> >> >
> >> >  struct pv_mmu_ops {
> >> >         unsigned long (*read_cr2)(void);
> >> > @@ -296,7 +296,7 @@ struct pv_mmu_ops {
> >> >            an mfn.  We can tell which is which from the index. */
> >> >         void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
> >> >                            phys_addr_t phys, pgprot_t flags);
> >> > -};
> >> > +} __no_randomize_layout;
> >> >
> >> >  struct arch_spinlock;
> >> >  #ifdef CONFIG_SMP
> >> > @@ -322,7 +322,9 @@ struct pv_lock_ops {
> >> >
> >> >  /* This contains all the paravirt structures: we get a convenient
> >> >   * number for each function using the offset which we use to indicate
> >> > - * what to patch. */
> >> > + * what to patch.
> >> > + * shouldn't be randomized due to the "NEAT TRICK" in paravirt.c
> >> > + */
> >> >  struct paravirt_patch_template {
> >> >         struct pv_init_ops pv_init_ops;
> >> >         struct pv_time_ops pv_time_ops;
> >> > @@ -330,7 +332,7 @@ struct paravirt_patch_template {
> >> >         struct pv_irq_ops pv_irq_ops;
> >> >         struct pv_mmu_ops pv_mmu_ops;
> >> >         struct pv_lock_ops pv_lock_ops;
> >> > -};
> >> > +} __no_randomize_layout;
> >> >
> >> >  extern struct pv_info pv_info;
> >> >  extern struct pv_init_ops pv_init_ops;
> >> > diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
> >> > index f76e0ea..4b83315 100644
> >> > --- a/drivers/acpi/acpica/hwxfsleep.c
> >> > +++ b/drivers/acpi/acpica/hwxfsleep.c
> >> > @@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
> >> >  /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
> >> >
> >> >  static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
> >> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
> >> > -        acpi_hw_extended_sleep},
> >> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
> >> > -        acpi_hw_extended_wake_prep},
> >> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake}
> >> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
> >> > +        .extended_function = acpi_hw_extended_sleep},
> >> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
> >> > +        .extended_function = acpi_hw_extended_wake_prep},
> >> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake),
> >> > +        .extended_function = acpi_hw_extended_wake}
> >> >  };
> >> >
> >> >  /*
> >> > diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
> >> > index 7fda30e..428766d 100644
> >> > --- a/drivers/block/cciss.h
> >> > +++ b/drivers/block/cciss.h
> >> > @@ -402,27 +402,27 @@ static bool SA5_performant_intr_pending(ctlr_info_t *h)
> >> >  }
> >> >
> >> >  static struct access_method SA5_access = {
> >> > -       SA5_submit_command,
> >> > -       SA5_intr_mask,
> >> > -       SA5_fifo_full,
> >> > -       SA5_intr_pending,
> >> > -       SA5_completed,
> >> > +       .submit_command = SA5_submit_command,
> >> > +       .set_intr_mask = SA5_intr_mask,
> >> > +       .fifo_full = SA5_fifo_full,
> >> > +       .intr_pending = SA5_intr_pending,
> >> > +       .command_completed = SA5_completed,
> >> >  };
> >> >
> >> >  static struct access_method SA5B_access = {
> >> > -        SA5_submit_command,
> >> > -        SA5B_intr_mask,
> >> > -        SA5_fifo_full,
> >> > -        SA5B_intr_pending,
> >> > -        SA5_completed,
> >> > +       .submit_command = SA5_submit_command,
> >> > +       .set_intr_mask = SA5B_intr_mask,
> >> > +       .fifo_full = SA5_fifo_full,
> >> > +       .intr_pending = SA5B_intr_pending,
> >> > +       .command_completed = SA5_completed,
> >> >  };
> >> >
> >> >  static struct access_method SA5_performant_access = {
> >> > -       SA5_submit_command,
> >> > -       SA5_performant_intr_mask,
> >> > -       SA5_fifo_full,
> >> > -       SA5_performant_intr_pending,
> >> > -       SA5_performant_completed,
> >> > +       .submit_command = SA5_submit_command,
> >> > +       .set_intr_mask = SA5_performant_intr_mask,
> >> > +       .fifo_full = SA5_fifo_full,
> >> > +       .intr_pending = SA5_performant_intr_pending,
> >> > +       .command_completed = SA5_performant_completed,
> >> >  };
> >> >
> >> >  struct board_type {
> >> > diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> >> > index d2e7d20..7bbe51f 100644
> >> > --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> >> > +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> >> > @@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
> >> >  }
> >> >
> >> >  const struct ttm_mem_type_manager_func nouveau_vram_manager = {
> >> > -       nouveau_vram_manager_init,
> >> > -       nouveau_vram_manager_fini,
> >> > -       nouveau_vram_manager_new,
> >> > -       nouveau_vram_manager_del,
> >> > +       .init = nouveau_vram_manager_init,
> >> > +       .takedown = nouveau_vram_manager_fini,
> >> > +       .get_node = nouveau_vram_manager_new,
> >> > +       .put_node = nouveau_vram_manager_del,
> >> >  };
> >> >
> >> >  static int
> >> > @@ -183,11 +183,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
> >> >  }
> >> >
> >> >  const struct ttm_mem_type_manager_func nouveau_gart_manager = {
> >> > -       nouveau_gart_manager_init,
> >> > -       nouveau_gart_manager_fini,
> >> > -       nouveau_gart_manager_new,
> >> > -       nouveau_gart_manager_del,
> >> > -       nouveau_gart_manager_debug
> >> > +       .init = nouveau_gart_manager_init,
> >> > +       .takedown = nouveau_gart_manager_fini,
> >> > +       .get_node = nouveau_gart_manager_new,
> >> > +       .put_node = nouveau_gart_manager_del,
> >> > +       .debug = nouveau_gart_manager_debug
> >> >  };
> >> >
> >> >  /*XXX*/
> >> > @@ -256,11 +256,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
> >> >  }
> >> >
> >> >  const struct ttm_mem_type_manager_func nv04_gart_manager = {
> >> > -       nv04_gart_manager_init,
> >> > -       nv04_gart_manager_fini,
> >> > -       nv04_gart_manager_new,
> >> > -       nv04_gart_manager_del,
> >> > -       nv04_gart_manager_debug
> >> > +       .init = nv04_gart_manager_init,
> >> > +       .takedown = nv04_gart_manager_fini,
> >> > +       .get_node = nv04_gart_manager_new,
> >> > +       .put_node = nv04_gart_manager_del,
> >> > +       .debug = nv04_gart_manager_debug
> >> >  };
> >> >
> >> >  int
> >> > diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
> >> > index aa0bd05..aea6a01 100644
> >> > --- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
> >> > +++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
> >> > @@ -148,10 +148,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
> >> >  }
> >> >
> >> >  const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
> >> > -       ttm_bo_man_init,
> >> > -       ttm_bo_man_takedown,
> >> > -       ttm_bo_man_get_node,
> >> > -       ttm_bo_man_put_node,
> >> > -       ttm_bo_man_debug
> >> > +       .init = ttm_bo_man_init,
> >> > +       .takedown = ttm_bo_man_takedown,
> >> > +       .get_node = ttm_bo_man_get_node,
> >> > +       .put_node = ttm_bo_man_put_node,
> >> > +       .debug = ttm_bo_man_debug
> >> >  };
> >> >  EXPORT_SYMBOL(ttm_bo_manager_func);
> >> > diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
> >> > index 9fd924c..e5ec4ef 100644
> >> > --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
> >> > +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
> >> > @@ -198,11 +198,11 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
> >> >  }
> >> >
> >> >  static const struct ttm_mem_type_manager_func virtio_gpu_bo_manager_func = {
> >> > -       ttm_bo_man_init,
> >> > -       ttm_bo_man_takedown,
> >> > -       ttm_bo_man_get_node,
> >> > -       ttm_bo_man_put_node,
> >> > -       ttm_bo_man_debug
> >> > +       .init = ttm_bo_man_init,
> >> > +       .takedown = ttm_bo_man_takedown,
> >> > +       .get_node = ttm_bo_man_get_node,
> >> > +       .put_node = ttm_bo_man_put_node,
> >> > +       .debug = ttm_bo_man_debug
> >> >  };
> >> >
> >> >  static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
> >> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> >> > index 170b61b..fec7348 100644
> >> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> >> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> >> > @@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
> >> >  }
> >> >
> >> >  const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
> >> > -       vmw_gmrid_man_init,
> >> > -       vmw_gmrid_man_takedown,
> >> > -       vmw_gmrid_man_get_node,
> >> > -       vmw_gmrid_man_put_node,
> >> > -       vmw_gmrid_man_debug
> >> > +       .init = vmw_gmrid_man_init,
> >> > +       .takedown = vmw_gmrid_man_takedown,
> >> > +       .get_node = vmw_gmrid_man_get_node,
> >> > +       .put_node = vmw_gmrid_man_put_node,
> >> > +       .debug = vmw_gmrid_man_debug
> >> >  };
> >> > diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
> >> > index cb9f0f2..8b1f654 100644
> >> > --- a/drivers/infiniband/hw/nes/nes_cm.c
> >> > +++ b/drivers/infiniband/hw/nes/nes_cm.c
> >> > @@ -135,17 +135,17 @@ static void record_ird_ord(struct nes_cm_node *, u16, u16);
> >> >  /* instance of function pointers for client API */
> >> >  /* set address of this instance to cm_core->cm_ops at cm_core alloc */
> >> >  static const struct nes_cm_ops nes_cm_api = {
> >> > -       mini_cm_accelerated,
> >> > -       mini_cm_listen,
> >> > -       mini_cm_del_listen,
> >> > -       mini_cm_connect,
> >> > -       mini_cm_close,
> >> > -       mini_cm_accept,
> >> > -       mini_cm_reject,
> >> > -       mini_cm_recv_pkt,
> >> > -       mini_cm_dealloc_core,
> >> > -       mini_cm_get,
> >> > -       mini_cm_set
> >> > +       .accelerated = mini_cm_accelerated,
> >> > +       .listen = mini_cm_listen,
> >> > +       .stop_listener = mini_cm_del_listen,
> >> > +       .connect = mini_cm_connect,
> >> > +       .close = mini_cm_close,
> >> > +       .accept = mini_cm_accept,
> >> > +       .reject = mini_cm_reject,
> >> > +       .recv_pkt = mini_cm_recv_pkt,
> >> > +       .destroy_cm_core = mini_cm_dealloc_core,
> >> > +       .get = mini_cm_get,
> >> > +       .set = mini_cm_set
> >> >  };
> >> >
> >> >  static struct nes_cm_core *g_cm_core;
> >> > diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
> >> > index aecec6d..11e13c5 100644
> >> > --- a/drivers/isdn/gigaset/bas-gigaset.c
> >> > +++ b/drivers/isdn/gigaset/bas-gigaset.c
> >> > @@ -2565,22 +2565,22 @@ static int gigaset_post_reset(struct usb_interface *intf)
> >> >
> >> >
> >> >  static const struct gigaset_ops gigops = {
> >> > -       gigaset_write_cmd,
> >> > -       gigaset_write_room,
> >> > -       gigaset_chars_in_buffer,
> >> > -       gigaset_brkchars,
> >> > -       gigaset_init_bchannel,
> >> > -       gigaset_close_bchannel,
> >> > -       gigaset_initbcshw,
> >> > -       gigaset_freebcshw,
> >> > -       gigaset_reinitbcshw,
> >> > -       gigaset_initcshw,
> >> > -       gigaset_freecshw,
> >> > -       gigaset_set_modem_ctrl,
> >> > -       gigaset_baud_rate,
> >> > -       gigaset_set_line_ctrl,
> >> > -       gigaset_isoc_send_skb,
> >> > -       gigaset_isoc_input,
> >> > +       .write_cmd = gigaset_write_cmd,
> >> > +       .write_room = gigaset_write_room,
> >> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> >> > +       .brkchars = gigaset_brkchars,
> >> > +       .init_bchannel = gigaset_init_bchannel,
> >> > +       .close_bchannel = gigaset_close_bchannel,
> >> > +       .initbcshw = gigaset_initbcshw,
> >> > +       .freebcshw = gigaset_freebcshw,
> >> > +       .reinitbcshw = gigaset_reinitbcshw,
> >> > +       .initcshw = gigaset_initcshw,
> >> > +       .freecshw = gigaset_freecshw,
> >> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> >> > +       .baud_rate = gigaset_baud_rate,
> >> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> >> > +       .send_skb = gigaset_isoc_send_skb,
> >> > +       .handle_input = gigaset_isoc_input,
> >> >  };
> >> >
> >> >  /* bas_gigaset_init
> >> > diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
> >> > index d1f8ab9..c0412f2 100644
> >> > --- a/drivers/isdn/gigaset/ser-gigaset.c
> >> > +++ b/drivers/isdn/gigaset/ser-gigaset.c
> >> > @@ -445,22 +445,22 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
> >> >  }
> >> >
> >> >  static const struct gigaset_ops ops = {
> >> > -       gigaset_write_cmd,
> >> > -       gigaset_write_room,
> >> > -       gigaset_chars_in_buffer,
> >> > -       gigaset_brkchars,
> >> > -       gigaset_init_bchannel,
> >> > -       gigaset_close_bchannel,
> >> > -       gigaset_initbcshw,
> >> > -       gigaset_freebcshw,
> >> > -       gigaset_reinitbcshw,
> >> > -       gigaset_initcshw,
> >> > -       gigaset_freecshw,
> >> > -       gigaset_set_modem_ctrl,
> >> > -       gigaset_baud_rate,
> >> > -       gigaset_set_line_ctrl,
> >> > -       gigaset_m10x_send_skb,  /* asyncdata.c */
> >> > -       gigaset_m10x_input,     /* asyncdata.c */
> >> > +       .write_cmd = gigaset_write_cmd,
> >> > +       .write_room = gigaset_write_room,
> >> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> >> > +       .brkchars = gigaset_brkchars,
> >> > +       .init_bchannel = gigaset_init_bchannel,
> >> > +       .close_bchannel = gigaset_close_bchannel,
> >> > +       .initbcshw = gigaset_initbcshw,
> >> > +       .freebcshw = gigaset_freebcshw,
> >> > +       .reinitbcshw = gigaset_reinitbcshw,
> >> > +       .initcshw = gigaset_initcshw,
> >> > +       .freecshw = gigaset_freecshw,
> >> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> >> > +       .baud_rate = gigaset_baud_rate,
> >> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> >> > +       .send_skb = gigaset_m10x_send_skb,      /* asyncdata.c */
> >> > +       .handle_input = gigaset_m10x_input,     /* asyncdata.c */
> >> >  };
> >> >
> >> >
> >> > diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
> >> > index 5f306e2..eade36d 100644
> >> > --- a/drivers/isdn/gigaset/usb-gigaset.c
> >> > +++ b/drivers/isdn/gigaset/usb-gigaset.c
> >> > @@ -862,22 +862,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
> >> >  }
> >> >
> >> >  static const struct gigaset_ops ops = {
> >> > -       gigaset_write_cmd,
> >> > -       gigaset_write_room,
> >> > -       gigaset_chars_in_buffer,
> >> > -       gigaset_brkchars,
> >> > -       gigaset_init_bchannel,
> >> > -       gigaset_close_bchannel,
> >> > -       gigaset_initbcshw,
> >> > -       gigaset_freebcshw,
> >> > -       gigaset_reinitbcshw,
> >> > -       gigaset_initcshw,
> >> > -       gigaset_freecshw,
> >> > -       gigaset_set_modem_ctrl,
> >> > -       gigaset_baud_rate,
> >> > -       gigaset_set_line_ctrl,
> >> > -       gigaset_m10x_send_skb,
> >> > -       gigaset_m10x_input,
> >> > +       .write_cmd = gigaset_write_cmd,
> >> > +       .write_room = gigaset_write_room,
> >> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> >> > +       .brkchars = gigaset_brkchars,
> >> > +       .init_bchannel = gigaset_init_bchannel,
> >> > +       .close_bchannel = gigaset_close_bchannel,
> >> > +       .initbcshw = gigaset_initbcshw,
> >> > +       .freebcshw = gigaset_freebcshw,
> >> > +       .reinitbcshw = gigaset_reinitbcshw,
> >> > +       .initcshw = gigaset_initcshw,
> >> > +       .freecshw = gigaset_freecshw,
> >> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> >> > +       .baud_rate = gigaset_baud_rate,
> >> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> >> > +       .send_skb = gigaset_m10x_send_skb,
> >> > +       .handle_input = gigaset_m10x_input,
> >> >  };
> >> >
> >> >  /*
> >> > diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
> >> > index 91d5730..336523e 100644
> >> > --- a/drivers/isdn/i4l/isdn_concap.c
> >> > +++ b/drivers/isdn/i4l/isdn_concap.c
> >> > @@ -80,9 +80,9 @@ static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
> >> >  }
> >> >
> >> >  struct concap_device_ops isdn_concap_reliable_dl_dops = {
> >> > -       &isdn_concap_dl_data_req,
> >> > -       &isdn_concap_dl_connect_req,
> >> > -       &isdn_concap_dl_disconn_req
> >> > +       .data_req = &isdn_concap_dl_data_req,
> >> > +       .connect_req = &isdn_concap_dl_connect_req,
> >> > +       .disconn_req = &isdn_concap_dl_disconn_req
> >> >  };
> >> >
> >> >  /* The following should better go into a dedicated source file such that
> >> > diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
> >> > index e2d4e58..40cd045 100644
> >> > --- a/drivers/isdn/i4l/isdn_x25iface.c
> >> > +++ b/drivers/isdn/i4l/isdn_x25iface.c
> >> > @@ -53,14 +53,14 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *);
> >> >
> >> >
> >> >  static struct concap_proto_ops ix25_pops = {
> >> > -       &isdn_x25iface_proto_new,
> >> > -       &isdn_x25iface_proto_del,
> >> > -       &isdn_x25iface_proto_restart,
> >> > -       &isdn_x25iface_proto_close,
> >> > -       &isdn_x25iface_xmit,
> >> > -       &isdn_x25iface_receive,
> >> > -       &isdn_x25iface_connect_ind,
> >> > -       &isdn_x25iface_disconn_ind
> >> > +       .proto_new = &isdn_x25iface_proto_new,
> >> > +       .proto_del = &isdn_x25iface_proto_del,
> >> > +       .restart = &isdn_x25iface_proto_restart,
> >> > +       .close = &isdn_x25iface_proto_close,
> >> > +       .encap_and_xmit = &isdn_x25iface_xmit,
> >> > +       .data_ind = &isdn_x25iface_receive,
> >> > +       .connect_ind = &isdn_x25iface_connect_ind,
> >> > +       .disconn_ind = &isdn_x25iface_disconn_ind
> >> >  };
> >> >
> >> >  /* error message helper function */
> >> > diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
> >> > index 4a37a1c..7e82dfd 100644
> >> > --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> >> > +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> >> > @@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
> >> >
> >> >  int solo_g723_init(struct solo_dev *solo_dev)
> >> >  {
> >> > -       static struct snd_device_ops ops = { NULL };
> >> > +       static struct snd_device_ops ops = { };
> >> >         struct snd_card *card;
> >> >         struct snd_kcontrol_new kctl;
> >> >         char name[32];
> >> > diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c
> >> > index 4e5c387..bba8173 100644
> >> > --- a/drivers/net/ethernet/brocade/bna/bna_enet.c
> >> > +++ b/drivers/net/ethernet/brocade/bna/bna_enet.c
> >> > @@ -1676,10 +1676,10 @@ bna_cb_ioceth_reset(void *arg)
> >> >  }
> >> >
> >> >  static struct bfa_ioc_cbfn bna_ioceth_cbfn = {
> >> > -       bna_cb_ioceth_enable,
> >> > -       bna_cb_ioceth_disable,
> >> > -       bna_cb_ioceth_hbfail,
> >> > -       bna_cb_ioceth_reset
> >> > +       .enable_cbfn = bna_cb_ioceth_enable,
> >> > +       .disable_cbfn = bna_cb_ioceth_disable,
> >> > +       .hbfail_cbfn = bna_cb_ioceth_hbfail,
> >> > +       .reset_cbfn = bna_cb_ioceth_reset
> >> >  };
> >> >
> >> >  static void bna_attr_init(struct bna_ioceth *ioceth)
> >> > diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
> >> > index 5920c99..ff2e4a5 100644
> >> > --- a/drivers/net/wan/lmc/lmc_media.c
> >> > +++ b/drivers/net/wan/lmc/lmc_media.c
> >> > @@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int);
> >> >  static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
> >> >
> >> >  lmc_media_t lmc_ds3_media = {
> >> > -  lmc_ds3_init,                        /* special media init stuff */
> >> > -  lmc_ds3_default,             /* reset to default state */
> >> > -  lmc_ds3_set_status,          /* reset status to state provided */
> >> > -  lmc_dummy_set_1,             /* set clock source */
> >> > -  lmc_dummy_set2_1,            /* set line speed */
> >> > -  lmc_ds3_set_100ft,           /* set cable length */
> >> > -  lmc_ds3_set_scram,           /* set scrambler */
> >> > -  lmc_ds3_get_link_status,     /* get link status */
> >> > -  lmc_dummy_set_1,             /* set link status */
> >> > -  lmc_ds3_set_crc_length,      /* set CRC length */
> >> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> >> > -  lmc_ds3_watchdog
> >> > +  .init = lmc_ds3_init,                                /* special media init stuff */
> >> > +  .defaults = lmc_ds3_default,                 /* reset to default state */
> >> > +  .set_status = lmc_ds3_set_status,            /* reset status to state provided */
> >> > +  .set_clock_source = lmc_dummy_set_1,         /* set clock source */
> >> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> >> > +  .set_cable_length = lmc_ds3_set_100ft,       /* set cable length */
> >> > +  .set_scrambler = lmc_ds3_set_scram,          /* set scrambler */
> >> > +  .get_link_status = lmc_ds3_get_link_status,  /* get link status */
> >> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
> >> > +  .set_crc_length = lmc_ds3_set_crc_length,    /* set CRC length */
> >> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> >> > +  .watchdog = lmc_ds3_watchdog
> >> >  };
> >> >
> >> >  lmc_media_t lmc_hssi_media = {
> >> > -  lmc_hssi_init,               /* special media init stuff */
> >> > -  lmc_hssi_default,            /* reset to default state */
> >> > -  lmc_hssi_set_status,         /* reset status to state provided */
> >> > -  lmc_hssi_set_clock,          /* set clock source */
> >> > -  lmc_dummy_set2_1,            /* set line speed */
> >> > -  lmc_dummy_set_1,             /* set cable length */
> >> > -  lmc_dummy_set_1,             /* set scrambler */
> >> > -  lmc_hssi_get_link_status,    /* get link status */
> >> > -  lmc_hssi_set_link_status,    /* set link status */
> >> > -  lmc_hssi_set_crc_length,     /* set CRC length */
> >> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> >> > -  lmc_hssi_watchdog
> >> > +  .init = lmc_hssi_init,                       /* special media init stuff */
> >> > +  .defaults = lmc_hssi_default,                        /* reset to default state */
> >> > +  .set_status = lmc_hssi_set_status,           /* reset status to state provided */
> >> > +  .set_clock_source = lmc_hssi_set_clock,      /* set clock source */
> >> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> >> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> >> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> >> > +  .get_link_status = lmc_hssi_get_link_status, /* get link status */
> >> > +  .set_link_status = lmc_hssi_set_link_status, /* set link status */
> >> > +  .set_crc_length = lmc_hssi_set_crc_length,   /* set CRC length */
> >> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> >> > +  .watchdog = lmc_hssi_watchdog
> >> >  };
> >> >
> >> > -lmc_media_t lmc_ssi_media = { lmc_ssi_init,    /* special media init stuff */
> >> > -  lmc_ssi_default,             /* reset to default state */
> >> > -  lmc_ssi_set_status,          /* reset status to state provided */
> >> > -  lmc_ssi_set_clock,           /* set clock source */
> >> > -  lmc_ssi_set_speed,           /* set line speed */
> >> > -  lmc_dummy_set_1,             /* set cable length */
> >> > -  lmc_dummy_set_1,             /* set scrambler */
> >> > -  lmc_ssi_get_link_status,     /* get link status */
> >> > -  lmc_ssi_set_link_status,     /* set link status */
> >> > -  lmc_ssi_set_crc_length,      /* set CRC length */
> >> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> >> > -  lmc_ssi_watchdog
> >> > +lmc_media_t lmc_ssi_media = {
> >> > +  .init = lmc_ssi_init,                                /* special media init stuff */
> >> > +  .defaults = lmc_ssi_default,                 /* reset to default state */
> >> > +  .set_status = lmc_ssi_set_status,            /* reset status to state provided */
> >> > +  .set_clock_source = lmc_ssi_set_clock,       /* set clock source */
> >> > +  .set_speed = lmc_ssi_set_speed,              /* set line speed */
> >> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> >> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> >> > +  .get_link_status = lmc_ssi_get_link_status,  /* get link status */
> >> > +  .set_link_status = lmc_ssi_set_link_status,  /* set link status */
> >> > +  .set_crc_length = lmc_ssi_set_crc_length,    /* set CRC length */
> >> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> >> > +  .watchdog = lmc_ssi_watchdog
> >> >  };
> >> >
> >> >  lmc_media_t lmc_t1_media = {
> >> > -  lmc_t1_init,                 /* special media init stuff */
> >> > -  lmc_t1_default,              /* reset to default state */
> >> > -  lmc_t1_set_status,           /* reset status to state provided */
> >> > -  lmc_t1_set_clock,            /* set clock source */
> >> > -  lmc_dummy_set2_1,            /* set line speed */
> >> > -  lmc_dummy_set_1,             /* set cable length */
> >> > -  lmc_dummy_set_1,             /* set scrambler */
> >> > -  lmc_t1_get_link_status,      /* get link status */
> >> > -  lmc_dummy_set_1,             /* set link status */
> >> > -  lmc_t1_set_crc_length,       /* set CRC length */
> >> > -  lmc_t1_set_circuit_type,     /* set T1 or E1 circuit type */
> >> > -  lmc_t1_watchdog
> >> > +  .init = lmc_t1_init,                         /* special media init stuff */
> >> > +  .defaults = lmc_t1_default,                  /* reset to default state */
> >> > +  .set_status = lmc_t1_set_status,             /* reset status to state provided */
> >> > +  .set_clock_source = lmc_t1_set_clock,                /* set clock source */
> >> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> >> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> >> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> >> > +  .get_link_status = lmc_t1_get_link_status,   /* get link status */
> >> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
> >> > +  .set_crc_length = lmc_t1_set_crc_length,     /* set CRC length */
> >> > +  .set_circuit_type = lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
> >> > +  .watchdog = lmc_t1_watchdog
> >> >  };
> >> >
> >> >  static void
> >> > diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
> >> > index 1e7e139..c2031dd 100644
> >> > --- a/drivers/scsi/bfa/bfa_fcs.c
> >> > +++ b/drivers/scsi/bfa/bfa_fcs.c
> >> > @@ -39,10 +39,21 @@ struct bfa_fcs_mod_s {
> >> >  #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
> >> >
> >> >  static struct bfa_fcs_mod_s fcs_modules[] = {
> >> > -       { bfa_fcs_port_attach, NULL, NULL },
> >> > -       { bfa_fcs_uf_attach, NULL, NULL },
> >> > -       { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
> >> > -         bfa_fcs_fabric_modexit },
> >> > +       {
> >> > +               .attach = bfa_fcs_port_attach,
> >> > +               .modinit = NULL,
> >> > +               .modexit = NULL
> >> > +       },
> >> > +       {
> >> > +               .attach = bfa_fcs_uf_attach,
> >> > +               .modinit = NULL,
> >> > +               .modexit = NULL
> >> > +       },
> >> > +       {
> >> > +               .attach = bfa_fcs_fabric_attach,
> >> > +               .modinit = bfa_fcs_fabric_modinit,
> >> > +               .modexit = bfa_fcs_fabric_modexit
> >> > +       },
> >> >  };
> >> >
> >> >  /*
> >> > diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
> >> > index 7733ad5..e5edbce 100644
> >> > --- a/drivers/scsi/bfa/bfa_fcs_lport.c
> >> > +++ b/drivers/scsi/bfa/bfa_fcs_lport.c
> >> > @@ -90,15 +90,26 @@ static struct {
> >> >         void            (*offline) (struct bfa_fcs_lport_s *port);
> >> >  } __port_action[] = {
> >> >         {
> >> > -       bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
> >> > -                       bfa_fcs_lport_unknown_offline}, {
> >> > -       bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
> >> > -                       bfa_fcs_lport_fab_offline}, {
> >> > -       bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
> >> > -                       bfa_fcs_lport_n2n_offline}, {
> >> > -       bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
> >> > -                       bfa_fcs_lport_loop_offline},
> >> > -       };
> >> > +               .init = bfa_fcs_lport_unknown_init,
> >> > +               .online = bfa_fcs_lport_unknown_online,
> >> > +               .offline = bfa_fcs_lport_unknown_offline
> >> > +       },
> >> > +       {
> >> > +               .init = bfa_fcs_lport_fab_init,
> >> > +               .online = bfa_fcs_lport_fab_online,
> >> > +               .offline = bfa_fcs_lport_fab_offline
> >> > +       },
> >> > +       {
> >> > +               .init = bfa_fcs_lport_n2n_init,
> >> > +               .online = bfa_fcs_lport_n2n_online,
> >> > +               .offline = bfa_fcs_lport_n2n_offline
> >> > +       },
> >> > +       {
> >> > +               .init = bfa_fcs_lport_loop_init,
> >> > +               .online = bfa_fcs_lport_loop_online,
> >> > +               .offline = bfa_fcs_lport_loop_offline
> >> > +       },
> >> > +};
> >> >
> >> >  /*
> >> >   *  fcs_port_sm FCS logical port state machine
> >> > diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
> >> > index 53135f2..640621b 100644
> >> > --- a/drivers/scsi/bfa/bfa_modules.h
> >> > +++ b/drivers/scsi/bfa/bfa_modules.h
> >> > @@ -79,12 +79,12 @@ enum {
> >> >                                                                         \
> >> >         extern struct bfa_module_s hal_mod_ ## __mod;                   \
> >> >         struct bfa_module_s hal_mod_ ## __mod = {                       \
> >> > -               bfa_ ## __mod ## _meminfo,                              \
> >> > -               bfa_ ## __mod ## _attach,                               \
> >> > -               bfa_ ## __mod ## _detach,                               \
> >> > -               bfa_ ## __mod ## _start,                                \
> >> > -               bfa_ ## __mod ## _stop,                                 \
> >> > -               bfa_ ## __mod ## _iocdisable,                           \
> >> > +               .meminfo = bfa_ ## __mod ## _meminfo,                   \
> >> > +               .attach = bfa_ ## __mod ## _attach,                     \
> >> > +               .detach = bfa_ ## __mod ## _detach,                     \
> >> > +               .start = bfa_ ## __mod ## _start,                       \
> >> > +               .stop = bfa_ ## __mod ## _stop,                         \
> >> > +               .iocdisable = bfa_ ## __mod ## _iocdisable,             \
> >> >         }
> >> >
> >> >  #define BFA_CACHELINE_SZ       (256)
> >> > diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
> >> > index fdd39fc..b734478 100644
> >> > --- a/drivers/scsi/hpsa.h
> >> > +++ b/drivers/scsi/hpsa.h
> >> > @@ -577,38 +577,38 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
> >> >  }
> >> >
> >> >  static struct access_method SA5_access = {
> >> > -       SA5_submit_command,
> >> > -       SA5_intr_mask,
> >> > -       SA5_intr_pending,
> >> > -       SA5_completed,
> >> > +       .submit_command = SA5_submit_command,
> >> > +       .set_intr_mask = SA5_intr_mask,
> >> > +       .intr_pending = SA5_intr_pending,
> >> > +       .command_completed = SA5_completed,
> >> >  };
> >> >
> >> >  static struct access_method SA5_ioaccel_mode1_access = {
> >> > -       SA5_submit_command,
> >> > -       SA5_performant_intr_mask,
> >> > -       SA5_ioaccel_mode1_intr_pending,
> >> > -       SA5_ioaccel_mode1_completed,
> >> > +       .submit_command = SA5_submit_command,
> >> > +       .set_intr_mask = SA5_performant_intr_mask,
> >> > +       .intr_pending = SA5_ioaccel_mode1_intr_pending,
> >> > +       .command_completed = SA5_ioaccel_mode1_completed,
> >> >  };
> >> >
> >> >  static struct access_method SA5_ioaccel_mode2_access = {
> >> > -       SA5_submit_command_ioaccel2,
> >> > -       SA5_performant_intr_mask,
> >> > -       SA5_performant_intr_pending,
> >> > -       SA5_performant_completed,
> >> > +       .submit_command = SA5_submit_command_ioaccel2,
> >> > +       .set_intr_mask = SA5_performant_intr_mask,
> >> > +       .intr_pending = SA5_performant_intr_pending,
> >> > +       .command_completed = SA5_performant_completed,
> >> >  };
> >> >
> >> >  static struct access_method SA5_performant_access = {
> >> > -       SA5_submit_command,
> >> > -       SA5_performant_intr_mask,
> >> > -       SA5_performant_intr_pending,
> >> > -       SA5_performant_completed,
> >> > +       .submit_command = SA5_submit_command,
> >> > +       .set_intr_mask = SA5_performant_intr_mask,
> >> > +       .intr_pending = SA5_performant_intr_pending,
> >> > +       .command_completed = SA5_performant_completed,
> >> >  };
> >> >
> >> >  static struct access_method SA5_performant_access_no_read = {
> >> > -       SA5_submit_command_no_read,
> >> > -       SA5_performant_intr_mask,
> >> > -       SA5_performant_intr_pending,
> >> > -       SA5_performant_completed,
> >> > +       .submit_command = SA5_submit_command_no_read,
> >> > +       .set_intr_mask = SA5_performant_intr_mask,
> >> > +       .intr_pending = SA5_performant_intr_pending,
> >> > +       .command_completed = SA5_performant_completed,
> >> >  };
> >> >
> >> >  struct board_type {
> >> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> >> > index 4310154..605d035 100644
> >> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> >> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> >> > @@ -147,7 +147,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
> >> >         int added = (mode == LCK_NL);
> >> >         int overlaps = 0;
> >> >         int splitted = 0;
> >> > -       const struct ldlm_callback_suite null_cbs = { NULL };
> >> > +       const struct ldlm_callback_suite null_cbs = { };
> >> >
> >> >         CDEBUG(D_DLMTRACE,
> >> >                "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
> >> > diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
> >> > index 329d78c..9756f9e 100644
> >> > --- a/drivers/staging/lustre/lustre/libcfs/module.c
> >> > +++ b/drivers/staging/lustre/lustre/libcfs/module.c
> >> > @@ -322,11 +322,11 @@ out:
> >> >  }
> >> >
> >> >  struct cfs_psdev_ops libcfs_psdev_ops = {
> >> > -       libcfs_psdev_open,
> >> > -       libcfs_psdev_release,
> >> > -       NULL,
> >> > -       NULL,
> >> > -       libcfs_ioctl
> >> > +       .p_open = libcfs_psdev_open,
> >> > +       .p_close = libcfs_psdev_release,
> >> > +       .p_read = NULL,
> >> > +       .p_write = NULL,
> >> > +       .p_ioctl = libcfs_ioctl
> >> >  };
> >> >
> >> >  static int proc_call_handler(void *data, int write, loff_t *ppos,
> >> > diff --git a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> >> > index a01147f..5d896f8 100644
> >> > --- a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> >> > +++ b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> >> > @@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo)
> >> >
> >> >  #ifdef CONFIG_FB_MATROX_MYSTIQUE
> >> >  struct matrox_switch matrox_mystique = {
> >> > -       MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore,
> >> > +       .preinit = MGA1064_preinit,
> >> > +       .reset = MGA1064_reset,
> >> > +       .init = MGA1064_init,
> >> > +       .restore = MGA1064_restore,
> >> >  };
> >> >  EXPORT_SYMBOL(matrox_mystique);
> >> >  #endif
> >> >
> >> >  #ifdef CONFIG_FB_MATROX_G
> >> >  struct matrox_switch matrox_G100 = {
> >> > -       MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore,
> >> > +       .preinit = MGAG100_preinit,
> >> > +       .reset = MGAG100_reset,
> >> > +       .init = MGAG100_init,
> >> > +       .restore = MGAG100_restore,
> >> >  };
> >> >  EXPORT_SYMBOL(matrox_G100);
> >> >  #endif
> >> > diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> >> > index 195ad7c..09743fc 100644
> >> > --- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> >> > +++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> >> > @@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo)
> >> >  }
> >> >
> >> >  struct matrox_switch matrox_millennium = {
> >> > -       Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore
> >> > +       .preinit = Ti3026_preinit,
> >> > +       .reset = Ti3026_reset,
> >> > +       .init = Ti3026_init,
> >> > +       .restore = Ti3026_restore
> >> >  };
> >> >  EXPORT_SYMBOL(matrox_millennium);
> >> >  #endif
> >> > diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
> >> > index aca73dd..e3c558d 100644
> >> > --- a/fs/reiserfs/item_ops.c
> >> > +++ b/fs/reiserfs/item_ops.c
> >> > @@ -724,18 +724,18 @@ static void errcatch_print_vi(struct virtual_item *vi)
> >> >  }
> >> >
> >> >  static struct item_operations errcatch_ops = {
> >> > -       errcatch_bytes_number,
> >> > -       errcatch_decrement_key,
> >> > -       errcatch_is_left_mergeable,
> >> > -       errcatch_print_item,
> >> > -       errcatch_check_item,
> >> > -
> >> > -       errcatch_create_vi,
> >> > -       errcatch_check_left,
> >> > -       errcatch_check_right,
> >> > -       errcatch_part_size,
> >> > -       errcatch_unit_num,
> >> > -       errcatch_print_vi
> >> > +       .bytes_number = errcatch_bytes_number,
> >> > +       .decrement_key = errcatch_decrement_key,
> >> > +       .is_left_mergeable = errcatch_is_left_mergeable,
> >> > +       .print_item = errcatch_print_item,
> >> > +       .check_item = errcatch_check_item,
> >> > +
> >> > +       .create_vi = errcatch_create_vi,
> >> > +       .check_left = errcatch_check_left,
> >> > +       .check_right = errcatch_check_right,
> >> > +       .part_size = errcatch_part_size,
> >> > +       .unit_num = errcatch_unit_num,
> >> > +       .print_vi = errcatch_print_vi
> >> >  };
> >> >
> >> >  #if ! (TYPE_STAT_DATA == 0 && TYPE_INDIRECT == 1 && TYPE_DIRECT == 2 && TYPE_DIRENTRY == 3)
> >> > diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
> >> > index 14d7b83..a1edf56 100644
> >> > --- a/include/linux/rbtree_augmented.h
> >> > +++ b/include/linux/rbtree_augmented.h
> >> > @@ -90,7 +90,9 @@ rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new)     \
> >> >         old->rbaugmented = rbcompute(old);                              \
> >> >  }                                                                      \
> >> >  rbstatic const struct rb_augment_callbacks rbname = {                  \
> >> > -       rbname ## _propagate, rbname ## _copy, rbname ## _rotate        \
> >> > +       .propagate = rbname ## _propagate,                              \
> >> > +       .copy = rbname ## _copy,                                        \
> >> > +       .rotate = rbname ## _rotate                                     \
> >> >  };
> >> >
> >> >
> >> > diff --git a/lib/rbtree.c b/lib/rbtree.c
> >> > index 1356454..70ce6c6 100644
> >> > --- a/lib/rbtree.c
> >> > +++ b/lib/rbtree.c
> >> > @@ -412,7 +412,9 @@ static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {}
> >> >  static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {}
> >> >
> >> >  static const struct rb_augment_callbacks dummy_callbacks = {
> >> > -       dummy_propagate, dummy_copy, dummy_rotate
> >> > +       .propagate = dummy_propagate,
> >> > +       .copy = dummy_copy,
> >> > +       .rotate = dummy_rotate
> >> >  };
> >> >
> >> >  void rb_insert_color(struct rb_node *node, struct rb_root *root)
> >> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> >> > index 838ca8bb..7432a90 100644
> >> > --- a/mm/page_alloc.c
> >> > +++ b/mm/page_alloc.c
> >> > @@ -561,7 +561,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page,
> >> >                 __mod_zone_freepage_state(zone, (1 << order), migratetype);
> >> >  }
> >> >  #else
> >> > -struct page_ext_operations debug_guardpage_ops = { NULL, };
> >> > +struct page_ext_operations debug_guardpage_ops = { .need = NULL, .init = NULL };
> >> >  static inline void set_page_guard(struct zone *zone, struct page *page,
> >> >                                 unsigned int order, int migratetype) {}
> >> >  static inline void clear_page_guard(struct zone *zone, struct page *page,
> >> > diff --git a/net/atm/lec.c b/net/atm/lec.c
> >> > index cd3b379..977a3c9 100644
> >> > --- a/net/atm/lec.c
> >> > +++ b/net/atm/lec.c
> >> > @@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
> >> >  }
> >> >
> >> >  static struct lane2_ops lane2_ops = {
> >> > -       lane2_resolve,          /* resolve,             spec 3.1.3 */
> >> > -       lane2_associate_req,    /* associate_req,       spec 3.1.4 */
> >> > -       NULL                    /* associate indicator, spec 3.1.5 */
> >> > +       .resolve = lane2_resolve,
> >> > +       .associate_req = lane2_associate_req,
> >> > +       .associate_indicator = NULL
> >> >  };
> >> >
> >> >  static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
> >> > diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
> >> > index 9e60e74..637c96e 100644
> >> > --- a/net/atm/mpoa_caches.c
> >> > +++ b/net/atm/mpoa_caches.c
> >> > @@ -535,30 +535,29 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
> >> >
> >> >
> >> >  static const struct in_cache_ops ingress_ops = {
> >> > -       in_cache_add_entry,               /* add_entry       */
> >> > -       in_cache_get,                     /* get             */
> >> > -       in_cache_get_with_mask,           /* get_with_mask   */
> >> > -       in_cache_get_by_vcc,              /* get_by_vcc      */
> >> > -       in_cache_put,                     /* put             */
> >> > -       in_cache_remove_entry,            /* remove_entry    */
> >> > -       cache_hit,                        /* cache_hit       */
> >> > -       clear_count_and_expired,          /* clear_count     */
> >> > -       check_resolving_entries,          /* check_resolving */
> >> > -       refresh_entries,                  /* refresh         */
> >> > -       in_destroy_cache                  /* destroy_cache   */
> >> > +       .add_entry = in_cache_add_entry,
> >> > +       .get = in_cache_get,
> >> > +       .get_with_mask = in_cache_get_with_mask,
> >> > +       .get_by_vcc = in_cache_get_by_vcc,
> >> > +       .put = in_cache_put,
> >> > +       .remove_entry = in_cache_remove_entry,
> >> > +       .cache_hit = cache_hit,
> >> > +       .clear_count = clear_count_and_expired,
> >> > +       .check_resolving = check_resolving_entries,
> >> > +       .refresh = refresh_entries,
> >> >  };
> >> >
> >> >  static const struct eg_cache_ops egress_ops = {
> >> > -       eg_cache_add_entry,               /* add_entry        */
> >> > -       eg_cache_get_by_cache_id,         /* get_by_cache_id  */
> >> > -       eg_cache_get_by_tag,              /* get_by_tag       */
> >> > -       eg_cache_get_by_vcc,              /* get_by_vcc       */
> >> > -       eg_cache_get_by_src_ip,           /* get_by_src_ip    */
> >> > -       eg_cache_put,                     /* put              */
> >> > -       eg_cache_remove_entry,            /* remove_entry     */
> >> > -       update_eg_cache_entry,            /* update           */
> >> > -       clear_expired,                    /* clear_expired    */
> >> > -       eg_destroy_cache                  /* destroy_cache    */
> >> > +       .add_entry = eg_cache_add_entry,
> >> > +       .get_by_cache_id = eg_cache_get_by_cache_id,
> >> > +       .get_by_tag = eg_cache_get_by_tag,
> >> > +       .get_by_vcc = eg_cache_get_by_vcc,
> >> > +       .get_by_src_ip = eg_cache_get_by_src_ip,
> >> > +       .put = eg_cache_put,
> >> > +       .remove_entry = eg_cache_remove_entry,
> >> > +       .update = update_eg_cache_entry,
> >> > +       .clear_expired = clear_expired,
> >> > +       .destroy_cache = eg_destroy_cache
> >> >  };
> >> >
> >> >
> >> > diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
> >> > index fd8cf02..1406db4 100644
> >> > --- a/net/vmw_vsock/vmci_transport_notify.c
> >> > +++ b/net/vmw_vsock/vmci_transport_notify.c
> >> > @@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
> >> >
> >> >  /* Socket control packet based operations. */
> >> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
> >> > -       vmci_transport_notify_pkt_socket_init,
> >> > -       vmci_transport_notify_pkt_socket_destruct,
> >> > -       vmci_transport_notify_pkt_poll_in,
> >> > -       vmci_transport_notify_pkt_poll_out,
> >> > -       vmci_transport_notify_pkt_handle_pkt,
> >> > -       vmci_transport_notify_pkt_recv_init,
> >> > -       vmci_transport_notify_pkt_recv_pre_block,
> >> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
> >> > -       vmci_transport_notify_pkt_recv_post_dequeue,
> >> > -       vmci_transport_notify_pkt_send_init,
> >> > -       vmci_transport_notify_pkt_send_pre_block,
> >> > -       vmci_transport_notify_pkt_send_pre_enqueue,
> >> > -       vmci_transport_notify_pkt_send_post_enqueue,
> >> > -       vmci_transport_notify_pkt_process_request,
> >> > -       vmci_transport_notify_pkt_process_negotiate,
> >> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
> >> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
> >> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
> >> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
> >> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
> >> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
> >> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
> >> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
> >> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
> >> > +       .send_init = vmci_transport_notify_pkt_send_init,
> >> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
> >> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
> >> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
> >> > +       .process_request = vmci_transport_notify_pkt_process_request,
> >> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
> >> >  };
> >> > diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
> >> > index 21e591d..f3a0afc 100644
> >> > --- a/net/vmw_vsock/vmci_transport_notify_qstate.c
> >> > +++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
> >> > @@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue(
> >> >
> >> >  /* Socket always on control packet based operations. */
> >> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
> >> > -       vmci_transport_notify_pkt_socket_init,
> >> > -       vmci_transport_notify_pkt_socket_destruct,
> >> > -       vmci_transport_notify_pkt_poll_in,
> >> > -       vmci_transport_notify_pkt_poll_out,
> >> > -       vmci_transport_notify_pkt_handle_pkt,
> >> > -       vmci_transport_notify_pkt_recv_init,
> >> > -       vmci_transport_notify_pkt_recv_pre_block,
> >> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
> >> > -       vmci_transport_notify_pkt_recv_post_dequeue,
> >> > -       vmci_transport_notify_pkt_send_init,
> >> > -       vmci_transport_notify_pkt_send_pre_block,
> >> > -       vmci_transport_notify_pkt_send_pre_enqueue,
> >> > -       vmci_transport_notify_pkt_send_post_enqueue,
> >> > -       vmci_transport_notify_pkt_process_request,
> >> > -       vmci_transport_notify_pkt_process_negotiate,
> >> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
> >> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
> >> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
> >> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
> >> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
> >> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
> >> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
> >> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
> >> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
> >> > +       .send_init = vmci_transport_notify_pkt_send_init,
> >> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
> >> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
> >> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
> >> > +       .process_request = vmci_transport_notify_pkt_process_request,
> >> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
> >> >  };
> >> > diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
> >> > index a020920..55579f6 100644
> >> > --- a/sound/synth/emux/emux_seq.c
> >> > +++ b/sound/synth/emux/emux_seq.c
> >> > @@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
> >> >   * MIDI emulation operators
> >> >   */
> >> >  static struct snd_midi_op emux_ops = {
> >> > -       snd_emux_note_on,
> >> > -       snd_emux_note_off,
> >> > -       snd_emux_key_press,
> >> > -       snd_emux_terminate_note,
> >> > -       snd_emux_control,
> >> > -       snd_emux_nrpn,
> >> > -       snd_emux_sysex,
> >> > +       .note_on = snd_emux_note_on,
> >> > +       .note_off = snd_emux_note_off,
> >> > +       .key_press = snd_emux_key_press,
> >> > +       .note_terminate = snd_emux_terminate_note,
> >> > +       .control = snd_emux_control,
> >> > +       .nrpn = snd_emux_nrpn,
> >> > +       .sysex = snd_emux_sysex,
> >> >  };
> >> >
> >> >
> >> > --
> >> > 1.9.1
> >> >
> >>
> >>
> >>
> >> --
> >> Kees Cook
> >> Chrome OS & Brillo Security
> >>
> 
> 
> 
> -- 
> Kees Cook
> Chrome OS & Brillo Security
> 

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

* [kernel-hardening] Re: [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs
  2016-06-13 19:57         ` Julia Lawall
@ 2016-06-13 20:26           ` Kees Cook
  2016-06-13 20:30             ` Julia Lawall
  0 siblings, 1 reply; 21+ messages in thread
From: Kees Cook @ 2016-06-13 20:26 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Michael Leibowitz, Brad Spengler, kernel-hardening, Emese Revfy,
	PaX Team

On Mon, Jun 13, 2016 at 12:57 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> On Mon, 13 Jun 2016, Kees Cook wrote:
>
>> On Mon, Jun 13, 2016 at 7:32 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> > On Thu, 5 May 2016, Kees Cook wrote:
>> >
>> >> On Thu, May 5, 2016 at 10:21 AM, Michael Leibowitz
>> >> <michael.leibowitz@intel.com> wrote:
>> >> > Due to randomization of structs, the in order struct intialization
>> >> > style is replaced with explicit field style.
>> >> >
>> >> > struct foo_t my_foo = {
>> >> >        one,
>> >> >        two,
>> >> >        three
>> >> > };
>> >> >
>> >> > becomes
>> >> >
>> >> > struct foo_t my_foo = {
>> >> >        .one = one,
>> >> >        .two = two,
>> >> >        .three = three
>> >> > };
>> >>
>> >> Can a coccinelle script be written to do this also? It might be useful
>> >> to keep that around.
>> >
>> > Is this needed for all kinds of structure initializations, ie for both
>> > local and global variables, or only for global variables?
>>
>> It's needed for any structure that has been globally defined. As in,
>> any use of a struct must be using C99 since that structure may be
>> randomized (in any context: global, local).
>
> I'm not sure to understand what it means for a structure to be globally
> defined.  If the code is:
>
> int f(...) {
>   struct foo x = { 3, 4, 5, };
>   ...
> }
>
> is it correct that it does not need to use C99?

As I understand it, your example will need to use C99 initialization.

-Kees

>
> thanks,
> julia
>
>> Michael, what's the state of this series? What're your next steps?
>>
>> -Kees
>>
>> >
>> > thanks,
>> > julia
>> >
>> >>
>> >> >
>> >> > Additionally, tag paravirt related structures to explicitly not be
>> >> > randomized, as the structure layout is important.
>> >>
>> >> This might need to be split out? It's logically separate. Also, I
>> >> think this needs to come before the plugin, since the plugin isn't
>> >> usable until this patch is in place.
>> >>
>> >> -Kees
>> >>
>> >> >
>> >> > This feature is ported over from grsecurity.  This is largely
>> >> > unchanged from the Original code written by the PaX Team and Spender.
>> >> >
>> >> > Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
>> >> > ---
>> >> >  arch/x86/include/asm/floppy.h                   | 20 ++---
>> >> >  arch/x86/include/asm/paravirt_types.h           | 18 +++--
>> >> >  drivers/acpi/acpica/hwxfsleep.c                 | 11 +--
>> >> >  drivers/block/cciss.h                           | 30 ++++----
>> >> >  drivers/gpu/drm/nouveau/nouveau_ttm.c           | 28 +++----
>> >> >  drivers/gpu/drm/ttm/ttm_bo_manager.c            | 10 +--
>> >> >  drivers/gpu/drm/virtio/virtgpu_ttm.c            | 10 +--
>> >> >  drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   | 10 +--
>> >> >  drivers/infiniband/hw/nes/nes_cm.c              | 22 +++---
>> >> >  drivers/isdn/gigaset/bas-gigaset.c              | 32 ++++----
>> >> >  drivers/isdn/gigaset/ser-gigaset.c              | 32 ++++----
>> >> >  drivers/isdn/gigaset/usb-gigaset.c              | 32 ++++----
>> >> >  drivers/isdn/i4l/isdn_concap.c                  |  6 +-
>> >> >  drivers/isdn/i4l/isdn_x25iface.c                | 16 ++--
>> >> >  drivers/media/pci/solo6x10/solo6x10-g723.c      |  2 +-
>> >> >  drivers/net/ethernet/brocade/bna/bna_enet.c     |  8 +-
>> >> >  drivers/net/wan/lmc/lmc_media.c                 | 97 +++++++++++++------------
>> >> >  drivers/scsi/bfa/bfa_fcs.c                      | 19 ++++-
>> >> >  drivers/scsi/bfa/bfa_fcs_lport.c                | 29 +++++---
>> >> >  drivers/scsi/bfa/bfa_modules.h                  | 12 +--
>> >> >  drivers/scsi/hpsa.h                             | 40 +++++-----
>> >> >  drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |  2 +-
>> >> >  drivers/staging/lustre/lustre/libcfs/module.c   | 10 +--
>> >> >  drivers/video/fbdev/matrox/matroxfb_DAC1064.c   | 10 ++-
>> >> >  drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |  5 +-
>> >> >  fs/reiserfs/item_ops.c                          | 24 +++---
>> >> >  include/linux/rbtree_augmented.h                |  4 +-
>> >> >  lib/rbtree.c                                    |  4 +-
>> >> >  mm/page_alloc.c                                 |  2 +-
>> >> >  net/atm/lec.c                                   |  6 +-
>> >> >  net/atm/mpoa_caches.c                           | 41 +++++------
>> >> >  net/vmw_vsock/vmci_transport_notify.c           | 30 ++++----
>> >> >  net/vmw_vsock/vmci_transport_notify_qstate.c    | 30 ++++----
>> >> >  sound/synth/emux/emux_seq.c                     | 14 ++--
>> >> >  34 files changed, 352 insertions(+), 314 deletions(-)
>> >> >
>> >> > diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
>> >> > index 1c7eefe..d0e4702 100644
>> >> > --- a/arch/x86/include/asm/floppy.h
>> >> > +++ b/arch/x86/include/asm/floppy.h
>> >> > @@ -229,18 +229,18 @@ static struct fd_routine_l {
>> >> >         int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
>> >> >  } fd_routine[] = {
>> >> >         {
>> >> > -               request_dma,
>> >> > -               free_dma,
>> >> > -               get_dma_residue,
>> >> > -               dma_mem_alloc,
>> >> > -               hard_dma_setup
>> >> > +               ._request_dma = request_dma,
>> >> > +               ._free_dma = free_dma,
>> >> > +               ._get_dma_residue = get_dma_residue,
>> >> > +               ._dma_mem_alloc = dma_mem_alloc,
>> >> > +               ._dma_setup = hard_dma_setup
>> >> >         },
>> >> >         {
>> >> > -               vdma_request_dma,
>> >> > -               vdma_nop,
>> >> > -               vdma_get_dma_residue,
>> >> > -               vdma_mem_alloc,
>> >> > -               vdma_dma_setup
>> >> > +               ._request_dma = vdma_request_dma,
>> >> > +               ._free_dma = vdma_nop,
>> >> > +               ._get_dma_residue = vdma_get_dma_residue,
>> >> > +               ._dma_mem_alloc = vdma_mem_alloc,
>> >> > +               ._dma_setup = vdma_dma_setup
>> >> >         }
>> >> >  };
>> >> >
>> >> > diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
>> >> > index 77db561..927c396 100644
>> >> > --- a/arch/x86/include/asm/paravirt_types.h
>> >> > +++ b/arch/x86/include/asm/paravirt_types.h
>> >> > @@ -89,7 +89,7 @@ struct pv_init_ops {
>> >> >          */
>> >> >         unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
>> >> >                           unsigned long addr, unsigned len);
>> >> > -};
>> >> > +} __no_randomize_layout;
>> >> >
>> >> >
>> >> >  struct pv_lazy_ops {
>> >> > @@ -97,12 +97,12 @@ struct pv_lazy_ops {
>> >> >         void (*enter)(void);
>> >> >         void (*leave)(void);
>> >> >         void (*flush)(void);
>> >> > -};
>> >> > +} __no_randomize_layout;
>> >> >
>> >> >  struct pv_time_ops {
>> >> >         unsigned long long (*sched_clock)(void);
>> >> >         unsigned long long (*steal_clock)(int cpu);
>> >> > -};
>> >> > +} __no_randomize_layout;
>> >> >
>> >> >  struct pv_cpu_ops {
>> >> >         /* hooks for various privileged instructions */
>> >> > @@ -178,7 +178,7 @@ struct pv_cpu_ops {
>> >> >
>> >> >         void (*start_context_switch)(struct task_struct *prev);
>> >> >         void (*end_context_switch)(struct task_struct *next);
>> >> > -};
>> >> > +} __no_randomize_layout;
>> >> >
>> >> >  struct pv_irq_ops {
>> >> >         /*
>> >> > @@ -201,7 +201,7 @@ struct pv_irq_ops {
>> >> >  #ifdef CONFIG_X86_64
>> >> >         void (*adjust_exception_frame)(void);
>> >> >  #endif
>> >> > -};
>> >> > +} __no_randomize_layout;
>> >> >
>> >> >  struct pv_mmu_ops {
>> >> >         unsigned long (*read_cr2)(void);
>> >> > @@ -296,7 +296,7 @@ struct pv_mmu_ops {
>> >> >            an mfn.  We can tell which is which from the index. */
>> >> >         void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
>> >> >                            phys_addr_t phys, pgprot_t flags);
>> >> > -};
>> >> > +} __no_randomize_layout;
>> >> >
>> >> >  struct arch_spinlock;
>> >> >  #ifdef CONFIG_SMP
>> >> > @@ -322,7 +322,9 @@ struct pv_lock_ops {
>> >> >
>> >> >  /* This contains all the paravirt structures: we get a convenient
>> >> >   * number for each function using the offset which we use to indicate
>> >> > - * what to patch. */
>> >> > + * what to patch.
>> >> > + * shouldn't be randomized due to the "NEAT TRICK" in paravirt.c
>> >> > + */
>> >> >  struct paravirt_patch_template {
>> >> >         struct pv_init_ops pv_init_ops;
>> >> >         struct pv_time_ops pv_time_ops;
>> >> > @@ -330,7 +332,7 @@ struct paravirt_patch_template {
>> >> >         struct pv_irq_ops pv_irq_ops;
>> >> >         struct pv_mmu_ops pv_mmu_ops;
>> >> >         struct pv_lock_ops pv_lock_ops;
>> >> > -};
>> >> > +} __no_randomize_layout;
>> >> >
>> >> >  extern struct pv_info pv_info;
>> >> >  extern struct pv_init_ops pv_init_ops;
>> >> > diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
>> >> > index f76e0ea..4b83315 100644
>> >> > --- a/drivers/acpi/acpica/hwxfsleep.c
>> >> > +++ b/drivers/acpi/acpica/hwxfsleep.c
>> >> > @@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
>> >> >  /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
>> >> >
>> >> >  static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
>> >> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
>> >> > -        acpi_hw_extended_sleep},
>> >> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
>> >> > -        acpi_hw_extended_wake_prep},
>> >> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake}
>> >> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
>> >> > +        .extended_function = acpi_hw_extended_sleep},
>> >> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
>> >> > +        .extended_function = acpi_hw_extended_wake_prep},
>> >> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake),
>> >> > +        .extended_function = acpi_hw_extended_wake}
>> >> >  };
>> >> >
>> >> >  /*
>> >> > diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
>> >> > index 7fda30e..428766d 100644
>> >> > --- a/drivers/block/cciss.h
>> >> > +++ b/drivers/block/cciss.h
>> >> > @@ -402,27 +402,27 @@ static bool SA5_performant_intr_pending(ctlr_info_t *h)
>> >> >  }
>> >> >
>> >> >  static struct access_method SA5_access = {
>> >> > -       SA5_submit_command,
>> >> > -       SA5_intr_mask,
>> >> > -       SA5_fifo_full,
>> >> > -       SA5_intr_pending,
>> >> > -       SA5_completed,
>> >> > +       .submit_command = SA5_submit_command,
>> >> > +       .set_intr_mask = SA5_intr_mask,
>> >> > +       .fifo_full = SA5_fifo_full,
>> >> > +       .intr_pending = SA5_intr_pending,
>> >> > +       .command_completed = SA5_completed,
>> >> >  };
>> >> >
>> >> >  static struct access_method SA5B_access = {
>> >> > -        SA5_submit_command,
>> >> > -        SA5B_intr_mask,
>> >> > -        SA5_fifo_full,
>> >> > -        SA5B_intr_pending,
>> >> > -        SA5_completed,
>> >> > +       .submit_command = SA5_submit_command,
>> >> > +       .set_intr_mask = SA5B_intr_mask,
>> >> > +       .fifo_full = SA5_fifo_full,
>> >> > +       .intr_pending = SA5B_intr_pending,
>> >> > +       .command_completed = SA5_completed,
>> >> >  };
>> >> >
>> >> >  static struct access_method SA5_performant_access = {
>> >> > -       SA5_submit_command,
>> >> > -       SA5_performant_intr_mask,
>> >> > -       SA5_fifo_full,
>> >> > -       SA5_performant_intr_pending,
>> >> > -       SA5_performant_completed,
>> >> > +       .submit_command = SA5_submit_command,
>> >> > +       .set_intr_mask = SA5_performant_intr_mask,
>> >> > +       .fifo_full = SA5_fifo_full,
>> >> > +       .intr_pending = SA5_performant_intr_pending,
>> >> > +       .command_completed = SA5_performant_completed,
>> >> >  };
>> >> >
>> >> >  struct board_type {
>> >> > diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
>> >> > index d2e7d20..7bbe51f 100644
>> >> > --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
>> >> > +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
>> >> > @@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
>> >> >  }
>> >> >
>> >> >  const struct ttm_mem_type_manager_func nouveau_vram_manager = {
>> >> > -       nouveau_vram_manager_init,
>> >> > -       nouveau_vram_manager_fini,
>> >> > -       nouveau_vram_manager_new,
>> >> > -       nouveau_vram_manager_del,
>> >> > +       .init = nouveau_vram_manager_init,
>> >> > +       .takedown = nouveau_vram_manager_fini,
>> >> > +       .get_node = nouveau_vram_manager_new,
>> >> > +       .put_node = nouveau_vram_manager_del,
>> >> >  };
>> >> >
>> >> >  static int
>> >> > @@ -183,11 +183,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
>> >> >  }
>> >> >
>> >> >  const struct ttm_mem_type_manager_func nouveau_gart_manager = {
>> >> > -       nouveau_gart_manager_init,
>> >> > -       nouveau_gart_manager_fini,
>> >> > -       nouveau_gart_manager_new,
>> >> > -       nouveau_gart_manager_del,
>> >> > -       nouveau_gart_manager_debug
>> >> > +       .init = nouveau_gart_manager_init,
>> >> > +       .takedown = nouveau_gart_manager_fini,
>> >> > +       .get_node = nouveau_gart_manager_new,
>> >> > +       .put_node = nouveau_gart_manager_del,
>> >> > +       .debug = nouveau_gart_manager_debug
>> >> >  };
>> >> >
>> >> >  /*XXX*/
>> >> > @@ -256,11 +256,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
>> >> >  }
>> >> >
>> >> >  const struct ttm_mem_type_manager_func nv04_gart_manager = {
>> >> > -       nv04_gart_manager_init,
>> >> > -       nv04_gart_manager_fini,
>> >> > -       nv04_gart_manager_new,
>> >> > -       nv04_gart_manager_del,
>> >> > -       nv04_gart_manager_debug
>> >> > +       .init = nv04_gart_manager_init,
>> >> > +       .takedown = nv04_gart_manager_fini,
>> >> > +       .get_node = nv04_gart_manager_new,
>> >> > +       .put_node = nv04_gart_manager_del,
>> >> > +       .debug = nv04_gart_manager_debug
>> >> >  };
>> >> >
>> >> >  int
>> >> > diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
>> >> > index aa0bd05..aea6a01 100644
>> >> > --- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
>> >> > +++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
>> >> > @@ -148,10 +148,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
>> >> >  }
>> >> >
>> >> >  const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
>> >> > -       ttm_bo_man_init,
>> >> > -       ttm_bo_man_takedown,
>> >> > -       ttm_bo_man_get_node,
>> >> > -       ttm_bo_man_put_node,
>> >> > -       ttm_bo_man_debug
>> >> > +       .init = ttm_bo_man_init,
>> >> > +       .takedown = ttm_bo_man_takedown,
>> >> > +       .get_node = ttm_bo_man_get_node,
>> >> > +       .put_node = ttm_bo_man_put_node,
>> >> > +       .debug = ttm_bo_man_debug
>> >> >  };
>> >> >  EXPORT_SYMBOL(ttm_bo_manager_func);
>> >> > diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
>> >> > index 9fd924c..e5ec4ef 100644
>> >> > --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
>> >> > +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
>> >> > @@ -198,11 +198,11 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
>> >> >  }
>> >> >
>> >> >  static const struct ttm_mem_type_manager_func virtio_gpu_bo_manager_func = {
>> >> > -       ttm_bo_man_init,
>> >> > -       ttm_bo_man_takedown,
>> >> > -       ttm_bo_man_get_node,
>> >> > -       ttm_bo_man_put_node,
>> >> > -       ttm_bo_man_debug
>> >> > +       .init = ttm_bo_man_init,
>> >> > +       .takedown = ttm_bo_man_takedown,
>> >> > +       .get_node = ttm_bo_man_get_node,
>> >> > +       .put_node = ttm_bo_man_put_node,
>> >> > +       .debug = ttm_bo_man_debug
>> >> >  };
>> >> >
>> >> >  static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
>> >> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
>> >> > index 170b61b..fec7348 100644
>> >> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
>> >> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
>> >> > @@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
>> >> >  }
>> >> >
>> >> >  const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
>> >> > -       vmw_gmrid_man_init,
>> >> > -       vmw_gmrid_man_takedown,
>> >> > -       vmw_gmrid_man_get_node,
>> >> > -       vmw_gmrid_man_put_node,
>> >> > -       vmw_gmrid_man_debug
>> >> > +       .init = vmw_gmrid_man_init,
>> >> > +       .takedown = vmw_gmrid_man_takedown,
>> >> > +       .get_node = vmw_gmrid_man_get_node,
>> >> > +       .put_node = vmw_gmrid_man_put_node,
>> >> > +       .debug = vmw_gmrid_man_debug
>> >> >  };
>> >> > diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
>> >> > index cb9f0f2..8b1f654 100644
>> >> > --- a/drivers/infiniband/hw/nes/nes_cm.c
>> >> > +++ b/drivers/infiniband/hw/nes/nes_cm.c
>> >> > @@ -135,17 +135,17 @@ static void record_ird_ord(struct nes_cm_node *, u16, u16);
>> >> >  /* instance of function pointers for client API */
>> >> >  /* set address of this instance to cm_core->cm_ops at cm_core alloc */
>> >> >  static const struct nes_cm_ops nes_cm_api = {
>> >> > -       mini_cm_accelerated,
>> >> > -       mini_cm_listen,
>> >> > -       mini_cm_del_listen,
>> >> > -       mini_cm_connect,
>> >> > -       mini_cm_close,
>> >> > -       mini_cm_accept,
>> >> > -       mini_cm_reject,
>> >> > -       mini_cm_recv_pkt,
>> >> > -       mini_cm_dealloc_core,
>> >> > -       mini_cm_get,
>> >> > -       mini_cm_set
>> >> > +       .accelerated = mini_cm_accelerated,
>> >> > +       .listen = mini_cm_listen,
>> >> > +       .stop_listener = mini_cm_del_listen,
>> >> > +       .connect = mini_cm_connect,
>> >> > +       .close = mini_cm_close,
>> >> > +       .accept = mini_cm_accept,
>> >> > +       .reject = mini_cm_reject,
>> >> > +       .recv_pkt = mini_cm_recv_pkt,
>> >> > +       .destroy_cm_core = mini_cm_dealloc_core,
>> >> > +       .get = mini_cm_get,
>> >> > +       .set = mini_cm_set
>> >> >  };
>> >> >
>> >> >  static struct nes_cm_core *g_cm_core;
>> >> > diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
>> >> > index aecec6d..11e13c5 100644
>> >> > --- a/drivers/isdn/gigaset/bas-gigaset.c
>> >> > +++ b/drivers/isdn/gigaset/bas-gigaset.c
>> >> > @@ -2565,22 +2565,22 @@ static int gigaset_post_reset(struct usb_interface *intf)
>> >> >
>> >> >
>> >> >  static const struct gigaset_ops gigops = {
>> >> > -       gigaset_write_cmd,
>> >> > -       gigaset_write_room,
>> >> > -       gigaset_chars_in_buffer,
>> >> > -       gigaset_brkchars,
>> >> > -       gigaset_init_bchannel,
>> >> > -       gigaset_close_bchannel,
>> >> > -       gigaset_initbcshw,
>> >> > -       gigaset_freebcshw,
>> >> > -       gigaset_reinitbcshw,
>> >> > -       gigaset_initcshw,
>> >> > -       gigaset_freecshw,
>> >> > -       gigaset_set_modem_ctrl,
>> >> > -       gigaset_baud_rate,
>> >> > -       gigaset_set_line_ctrl,
>> >> > -       gigaset_isoc_send_skb,
>> >> > -       gigaset_isoc_input,
>> >> > +       .write_cmd = gigaset_write_cmd,
>> >> > +       .write_room = gigaset_write_room,
>> >> > +       .chars_in_buffer = gigaset_chars_in_buffer,
>> >> > +       .brkchars = gigaset_brkchars,
>> >> > +       .init_bchannel = gigaset_init_bchannel,
>> >> > +       .close_bchannel = gigaset_close_bchannel,
>> >> > +       .initbcshw = gigaset_initbcshw,
>> >> > +       .freebcshw = gigaset_freebcshw,
>> >> > +       .reinitbcshw = gigaset_reinitbcshw,
>> >> > +       .initcshw = gigaset_initcshw,
>> >> > +       .freecshw = gigaset_freecshw,
>> >> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
>> >> > +       .baud_rate = gigaset_baud_rate,
>> >> > +       .set_line_ctrl = gigaset_set_line_ctrl,
>> >> > +       .send_skb = gigaset_isoc_send_skb,
>> >> > +       .handle_input = gigaset_isoc_input,
>> >> >  };
>> >> >
>> >> >  /* bas_gigaset_init
>> >> > diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
>> >> > index d1f8ab9..c0412f2 100644
>> >> > --- a/drivers/isdn/gigaset/ser-gigaset.c
>> >> > +++ b/drivers/isdn/gigaset/ser-gigaset.c
>> >> > @@ -445,22 +445,22 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
>> >> >  }
>> >> >
>> >> >  static const struct gigaset_ops ops = {
>> >> > -       gigaset_write_cmd,
>> >> > -       gigaset_write_room,
>> >> > -       gigaset_chars_in_buffer,
>> >> > -       gigaset_brkchars,
>> >> > -       gigaset_init_bchannel,
>> >> > -       gigaset_close_bchannel,
>> >> > -       gigaset_initbcshw,
>> >> > -       gigaset_freebcshw,
>> >> > -       gigaset_reinitbcshw,
>> >> > -       gigaset_initcshw,
>> >> > -       gigaset_freecshw,
>> >> > -       gigaset_set_modem_ctrl,
>> >> > -       gigaset_baud_rate,
>> >> > -       gigaset_set_line_ctrl,
>> >> > -       gigaset_m10x_send_skb,  /* asyncdata.c */
>> >> > -       gigaset_m10x_input,     /* asyncdata.c */
>> >> > +       .write_cmd = gigaset_write_cmd,
>> >> > +       .write_room = gigaset_write_room,
>> >> > +       .chars_in_buffer = gigaset_chars_in_buffer,
>> >> > +       .brkchars = gigaset_brkchars,
>> >> > +       .init_bchannel = gigaset_init_bchannel,
>> >> > +       .close_bchannel = gigaset_close_bchannel,
>> >> > +       .initbcshw = gigaset_initbcshw,
>> >> > +       .freebcshw = gigaset_freebcshw,
>> >> > +       .reinitbcshw = gigaset_reinitbcshw,
>> >> > +       .initcshw = gigaset_initcshw,
>> >> > +       .freecshw = gigaset_freecshw,
>> >> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
>> >> > +       .baud_rate = gigaset_baud_rate,
>> >> > +       .set_line_ctrl = gigaset_set_line_ctrl,
>> >> > +       .send_skb = gigaset_m10x_send_skb,      /* asyncdata.c */
>> >> > +       .handle_input = gigaset_m10x_input,     /* asyncdata.c */
>> >> >  };
>> >> >
>> >> >
>> >> > diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
>> >> > index 5f306e2..eade36d 100644
>> >> > --- a/drivers/isdn/gigaset/usb-gigaset.c
>> >> > +++ b/drivers/isdn/gigaset/usb-gigaset.c
>> >> > @@ -862,22 +862,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
>> >> >  }
>> >> >
>> >> >  static const struct gigaset_ops ops = {
>> >> > -       gigaset_write_cmd,
>> >> > -       gigaset_write_room,
>> >> > -       gigaset_chars_in_buffer,
>> >> > -       gigaset_brkchars,
>> >> > -       gigaset_init_bchannel,
>> >> > -       gigaset_close_bchannel,
>> >> > -       gigaset_initbcshw,
>> >> > -       gigaset_freebcshw,
>> >> > -       gigaset_reinitbcshw,
>> >> > -       gigaset_initcshw,
>> >> > -       gigaset_freecshw,
>> >> > -       gigaset_set_modem_ctrl,
>> >> > -       gigaset_baud_rate,
>> >> > -       gigaset_set_line_ctrl,
>> >> > -       gigaset_m10x_send_skb,
>> >> > -       gigaset_m10x_input,
>> >> > +       .write_cmd = gigaset_write_cmd,
>> >> > +       .write_room = gigaset_write_room,
>> >> > +       .chars_in_buffer = gigaset_chars_in_buffer,
>> >> > +       .brkchars = gigaset_brkchars,
>> >> > +       .init_bchannel = gigaset_init_bchannel,
>> >> > +       .close_bchannel = gigaset_close_bchannel,
>> >> > +       .initbcshw = gigaset_initbcshw,
>> >> > +       .freebcshw = gigaset_freebcshw,
>> >> > +       .reinitbcshw = gigaset_reinitbcshw,
>> >> > +       .initcshw = gigaset_initcshw,
>> >> > +       .freecshw = gigaset_freecshw,
>> >> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
>> >> > +       .baud_rate = gigaset_baud_rate,
>> >> > +       .set_line_ctrl = gigaset_set_line_ctrl,
>> >> > +       .send_skb = gigaset_m10x_send_skb,
>> >> > +       .handle_input = gigaset_m10x_input,
>> >> >  };
>> >> >
>> >> >  /*
>> >> > diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
>> >> > index 91d5730..336523e 100644
>> >> > --- a/drivers/isdn/i4l/isdn_concap.c
>> >> > +++ b/drivers/isdn/i4l/isdn_concap.c
>> >> > @@ -80,9 +80,9 @@ static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
>> >> >  }
>> >> >
>> >> >  struct concap_device_ops isdn_concap_reliable_dl_dops = {
>> >> > -       &isdn_concap_dl_data_req,
>> >> > -       &isdn_concap_dl_connect_req,
>> >> > -       &isdn_concap_dl_disconn_req
>> >> > +       .data_req = &isdn_concap_dl_data_req,
>> >> > +       .connect_req = &isdn_concap_dl_connect_req,
>> >> > +       .disconn_req = &isdn_concap_dl_disconn_req
>> >> >  };
>> >> >
>> >> >  /* The following should better go into a dedicated source file such that
>> >> > diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
>> >> > index e2d4e58..40cd045 100644
>> >> > --- a/drivers/isdn/i4l/isdn_x25iface.c
>> >> > +++ b/drivers/isdn/i4l/isdn_x25iface.c
>> >> > @@ -53,14 +53,14 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *);
>> >> >
>> >> >
>> >> >  static struct concap_proto_ops ix25_pops = {
>> >> > -       &isdn_x25iface_proto_new,
>> >> > -       &isdn_x25iface_proto_del,
>> >> > -       &isdn_x25iface_proto_restart,
>> >> > -       &isdn_x25iface_proto_close,
>> >> > -       &isdn_x25iface_xmit,
>> >> > -       &isdn_x25iface_receive,
>> >> > -       &isdn_x25iface_connect_ind,
>> >> > -       &isdn_x25iface_disconn_ind
>> >> > +       .proto_new = &isdn_x25iface_proto_new,
>> >> > +       .proto_del = &isdn_x25iface_proto_del,
>> >> > +       .restart = &isdn_x25iface_proto_restart,
>> >> > +       .close = &isdn_x25iface_proto_close,
>> >> > +       .encap_and_xmit = &isdn_x25iface_xmit,
>> >> > +       .data_ind = &isdn_x25iface_receive,
>> >> > +       .connect_ind = &isdn_x25iface_connect_ind,
>> >> > +       .disconn_ind = &isdn_x25iface_disconn_ind
>> >> >  };
>> >> >
>> >> >  /* error message helper function */
>> >> > diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
>> >> > index 4a37a1c..7e82dfd 100644
>> >> > --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
>> >> > +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
>> >> > @@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
>> >> >
>> >> >  int solo_g723_init(struct solo_dev *solo_dev)
>> >> >  {
>> >> > -       static struct snd_device_ops ops = { NULL };
>> >> > +       static struct snd_device_ops ops = { };
>> >> >         struct snd_card *card;
>> >> >         struct snd_kcontrol_new kctl;
>> >> >         char name[32];
>> >> > diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c
>> >> > index 4e5c387..bba8173 100644
>> >> > --- a/drivers/net/ethernet/brocade/bna/bna_enet.c
>> >> > +++ b/drivers/net/ethernet/brocade/bna/bna_enet.c
>> >> > @@ -1676,10 +1676,10 @@ bna_cb_ioceth_reset(void *arg)
>> >> >  }
>> >> >
>> >> >  static struct bfa_ioc_cbfn bna_ioceth_cbfn = {
>> >> > -       bna_cb_ioceth_enable,
>> >> > -       bna_cb_ioceth_disable,
>> >> > -       bna_cb_ioceth_hbfail,
>> >> > -       bna_cb_ioceth_reset
>> >> > +       .enable_cbfn = bna_cb_ioceth_enable,
>> >> > +       .disable_cbfn = bna_cb_ioceth_disable,
>> >> > +       .hbfail_cbfn = bna_cb_ioceth_hbfail,
>> >> > +       .reset_cbfn = bna_cb_ioceth_reset
>> >> >  };
>> >> >
>> >> >  static void bna_attr_init(struct bna_ioceth *ioceth)
>> >> > diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
>> >> > index 5920c99..ff2e4a5 100644
>> >> > --- a/drivers/net/wan/lmc/lmc_media.c
>> >> > +++ b/drivers/net/wan/lmc/lmc_media.c
>> >> > @@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int);
>> >> >  static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
>> >> >
>> >> >  lmc_media_t lmc_ds3_media = {
>> >> > -  lmc_ds3_init,                        /* special media init stuff */
>> >> > -  lmc_ds3_default,             /* reset to default state */
>> >> > -  lmc_ds3_set_status,          /* reset status to state provided */
>> >> > -  lmc_dummy_set_1,             /* set clock source */
>> >> > -  lmc_dummy_set2_1,            /* set line speed */
>> >> > -  lmc_ds3_set_100ft,           /* set cable length */
>> >> > -  lmc_ds3_set_scram,           /* set scrambler */
>> >> > -  lmc_ds3_get_link_status,     /* get link status */
>> >> > -  lmc_dummy_set_1,             /* set link status */
>> >> > -  lmc_ds3_set_crc_length,      /* set CRC length */
>> >> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
>> >> > -  lmc_ds3_watchdog
>> >> > +  .init = lmc_ds3_init,                                /* special media init stuff */
>> >> > +  .defaults = lmc_ds3_default,                 /* reset to default state */
>> >> > +  .set_status = lmc_ds3_set_status,            /* reset status to state provided */
>> >> > +  .set_clock_source = lmc_dummy_set_1,         /* set clock source */
>> >> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
>> >> > +  .set_cable_length = lmc_ds3_set_100ft,       /* set cable length */
>> >> > +  .set_scrambler = lmc_ds3_set_scram,          /* set scrambler */
>> >> > +  .get_link_status = lmc_ds3_get_link_status,  /* get link status */
>> >> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
>> >> > +  .set_crc_length = lmc_ds3_set_crc_length,    /* set CRC length */
>> >> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
>> >> > +  .watchdog = lmc_ds3_watchdog
>> >> >  };
>> >> >
>> >> >  lmc_media_t lmc_hssi_media = {
>> >> > -  lmc_hssi_init,               /* special media init stuff */
>> >> > -  lmc_hssi_default,            /* reset to default state */
>> >> > -  lmc_hssi_set_status,         /* reset status to state provided */
>> >> > -  lmc_hssi_set_clock,          /* set clock source */
>> >> > -  lmc_dummy_set2_1,            /* set line speed */
>> >> > -  lmc_dummy_set_1,             /* set cable length */
>> >> > -  lmc_dummy_set_1,             /* set scrambler */
>> >> > -  lmc_hssi_get_link_status,    /* get link status */
>> >> > -  lmc_hssi_set_link_status,    /* set link status */
>> >> > -  lmc_hssi_set_crc_length,     /* set CRC length */
>> >> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
>> >> > -  lmc_hssi_watchdog
>> >> > +  .init = lmc_hssi_init,                       /* special media init stuff */
>> >> > +  .defaults = lmc_hssi_default,                        /* reset to default state */
>> >> > +  .set_status = lmc_hssi_set_status,           /* reset status to state provided */
>> >> > +  .set_clock_source = lmc_hssi_set_clock,      /* set clock source */
>> >> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
>> >> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
>> >> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
>> >> > +  .get_link_status = lmc_hssi_get_link_status, /* get link status */
>> >> > +  .set_link_status = lmc_hssi_set_link_status, /* set link status */
>> >> > +  .set_crc_length = lmc_hssi_set_crc_length,   /* set CRC length */
>> >> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
>> >> > +  .watchdog = lmc_hssi_watchdog
>> >> >  };
>> >> >
>> >> > -lmc_media_t lmc_ssi_media = { lmc_ssi_init,    /* special media init stuff */
>> >> > -  lmc_ssi_default,             /* reset to default state */
>> >> > -  lmc_ssi_set_status,          /* reset status to state provided */
>> >> > -  lmc_ssi_set_clock,           /* set clock source */
>> >> > -  lmc_ssi_set_speed,           /* set line speed */
>> >> > -  lmc_dummy_set_1,             /* set cable length */
>> >> > -  lmc_dummy_set_1,             /* set scrambler */
>> >> > -  lmc_ssi_get_link_status,     /* get link status */
>> >> > -  lmc_ssi_set_link_status,     /* set link status */
>> >> > -  lmc_ssi_set_crc_length,      /* set CRC length */
>> >> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
>> >> > -  lmc_ssi_watchdog
>> >> > +lmc_media_t lmc_ssi_media = {
>> >> > +  .init = lmc_ssi_init,                                /* special media init stuff */
>> >> > +  .defaults = lmc_ssi_default,                 /* reset to default state */
>> >> > +  .set_status = lmc_ssi_set_status,            /* reset status to state provided */
>> >> > +  .set_clock_source = lmc_ssi_set_clock,       /* set clock source */
>> >> > +  .set_speed = lmc_ssi_set_speed,              /* set line speed */
>> >> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
>> >> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
>> >> > +  .get_link_status = lmc_ssi_get_link_status,  /* get link status */
>> >> > +  .set_link_status = lmc_ssi_set_link_status,  /* set link status */
>> >> > +  .set_crc_length = lmc_ssi_set_crc_length,    /* set CRC length */
>> >> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
>> >> > +  .watchdog = lmc_ssi_watchdog
>> >> >  };
>> >> >
>> >> >  lmc_media_t lmc_t1_media = {
>> >> > -  lmc_t1_init,                 /* special media init stuff */
>> >> > -  lmc_t1_default,              /* reset to default state */
>> >> > -  lmc_t1_set_status,           /* reset status to state provided */
>> >> > -  lmc_t1_set_clock,            /* set clock source */
>> >> > -  lmc_dummy_set2_1,            /* set line speed */
>> >> > -  lmc_dummy_set_1,             /* set cable length */
>> >> > -  lmc_dummy_set_1,             /* set scrambler */
>> >> > -  lmc_t1_get_link_status,      /* get link status */
>> >> > -  lmc_dummy_set_1,             /* set link status */
>> >> > -  lmc_t1_set_crc_length,       /* set CRC length */
>> >> > -  lmc_t1_set_circuit_type,     /* set T1 or E1 circuit type */
>> >> > -  lmc_t1_watchdog
>> >> > +  .init = lmc_t1_init,                         /* special media init stuff */
>> >> > +  .defaults = lmc_t1_default,                  /* reset to default state */
>> >> > +  .set_status = lmc_t1_set_status,             /* reset status to state provided */
>> >> > +  .set_clock_source = lmc_t1_set_clock,                /* set clock source */
>> >> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
>> >> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
>> >> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
>> >> > +  .get_link_status = lmc_t1_get_link_status,   /* get link status */
>> >> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
>> >> > +  .set_crc_length = lmc_t1_set_crc_length,     /* set CRC length */
>> >> > +  .set_circuit_type = lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
>> >> > +  .watchdog = lmc_t1_watchdog
>> >> >  };
>> >> >
>> >> >  static void
>> >> > diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
>> >> > index 1e7e139..c2031dd 100644
>> >> > --- a/drivers/scsi/bfa/bfa_fcs.c
>> >> > +++ b/drivers/scsi/bfa/bfa_fcs.c
>> >> > @@ -39,10 +39,21 @@ struct bfa_fcs_mod_s {
>> >> >  #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
>> >> >
>> >> >  static struct bfa_fcs_mod_s fcs_modules[] = {
>> >> > -       { bfa_fcs_port_attach, NULL, NULL },
>> >> > -       { bfa_fcs_uf_attach, NULL, NULL },
>> >> > -       { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
>> >> > -         bfa_fcs_fabric_modexit },
>> >> > +       {
>> >> > +               .attach = bfa_fcs_port_attach,
>> >> > +               .modinit = NULL,
>> >> > +               .modexit = NULL
>> >> > +       },
>> >> > +       {
>> >> > +               .attach = bfa_fcs_uf_attach,
>> >> > +               .modinit = NULL,
>> >> > +               .modexit = NULL
>> >> > +       },
>> >> > +       {
>> >> > +               .attach = bfa_fcs_fabric_attach,
>> >> > +               .modinit = bfa_fcs_fabric_modinit,
>> >> > +               .modexit = bfa_fcs_fabric_modexit
>> >> > +       },
>> >> >  };
>> >> >
>> >> >  /*
>> >> > diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
>> >> > index 7733ad5..e5edbce 100644
>> >> > --- a/drivers/scsi/bfa/bfa_fcs_lport.c
>> >> > +++ b/drivers/scsi/bfa/bfa_fcs_lport.c
>> >> > @@ -90,15 +90,26 @@ static struct {
>> >> >         void            (*offline) (struct bfa_fcs_lport_s *port);
>> >> >  } __port_action[] = {
>> >> >         {
>> >> > -       bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
>> >> > -                       bfa_fcs_lport_unknown_offline}, {
>> >> > -       bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
>> >> > -                       bfa_fcs_lport_fab_offline}, {
>> >> > -       bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
>> >> > -                       bfa_fcs_lport_n2n_offline}, {
>> >> > -       bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
>> >> > -                       bfa_fcs_lport_loop_offline},
>> >> > -       };
>> >> > +               .init = bfa_fcs_lport_unknown_init,
>> >> > +               .online = bfa_fcs_lport_unknown_online,
>> >> > +               .offline = bfa_fcs_lport_unknown_offline
>> >> > +       },
>> >> > +       {
>> >> > +               .init = bfa_fcs_lport_fab_init,
>> >> > +               .online = bfa_fcs_lport_fab_online,
>> >> > +               .offline = bfa_fcs_lport_fab_offline
>> >> > +       },
>> >> > +       {
>> >> > +               .init = bfa_fcs_lport_n2n_init,
>> >> > +               .online = bfa_fcs_lport_n2n_online,
>> >> > +               .offline = bfa_fcs_lport_n2n_offline
>> >> > +       },
>> >> > +       {
>> >> > +               .init = bfa_fcs_lport_loop_init,
>> >> > +               .online = bfa_fcs_lport_loop_online,
>> >> > +               .offline = bfa_fcs_lport_loop_offline
>> >> > +       },
>> >> > +};
>> >> >
>> >> >  /*
>> >> >   *  fcs_port_sm FCS logical port state machine
>> >> > diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
>> >> > index 53135f2..640621b 100644
>> >> > --- a/drivers/scsi/bfa/bfa_modules.h
>> >> > +++ b/drivers/scsi/bfa/bfa_modules.h
>> >> > @@ -79,12 +79,12 @@ enum {
>> >> >                                                                         \
>> >> >         extern struct bfa_module_s hal_mod_ ## __mod;                   \
>> >> >         struct bfa_module_s hal_mod_ ## __mod = {                       \
>> >> > -               bfa_ ## __mod ## _meminfo,                              \
>> >> > -               bfa_ ## __mod ## _attach,                               \
>> >> > -               bfa_ ## __mod ## _detach,                               \
>> >> > -               bfa_ ## __mod ## _start,                                \
>> >> > -               bfa_ ## __mod ## _stop,                                 \
>> >> > -               bfa_ ## __mod ## _iocdisable,                           \
>> >> > +               .meminfo = bfa_ ## __mod ## _meminfo,                   \
>> >> > +               .attach = bfa_ ## __mod ## _attach,                     \
>> >> > +               .detach = bfa_ ## __mod ## _detach,                     \
>> >> > +               .start = bfa_ ## __mod ## _start,                       \
>> >> > +               .stop = bfa_ ## __mod ## _stop,                         \
>> >> > +               .iocdisable = bfa_ ## __mod ## _iocdisable,             \
>> >> >         }
>> >> >
>> >> >  #define BFA_CACHELINE_SZ       (256)
>> >> > diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
>> >> > index fdd39fc..b734478 100644
>> >> > --- a/drivers/scsi/hpsa.h
>> >> > +++ b/drivers/scsi/hpsa.h
>> >> > @@ -577,38 +577,38 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
>> >> >  }
>> >> >
>> >> >  static struct access_method SA5_access = {
>> >> > -       SA5_submit_command,
>> >> > -       SA5_intr_mask,
>> >> > -       SA5_intr_pending,
>> >> > -       SA5_completed,
>> >> > +       .submit_command = SA5_submit_command,
>> >> > +       .set_intr_mask = SA5_intr_mask,
>> >> > +       .intr_pending = SA5_intr_pending,
>> >> > +       .command_completed = SA5_completed,
>> >> >  };
>> >> >
>> >> >  static struct access_method SA5_ioaccel_mode1_access = {
>> >> > -       SA5_submit_command,
>> >> > -       SA5_performant_intr_mask,
>> >> > -       SA5_ioaccel_mode1_intr_pending,
>> >> > -       SA5_ioaccel_mode1_completed,
>> >> > +       .submit_command = SA5_submit_command,
>> >> > +       .set_intr_mask = SA5_performant_intr_mask,
>> >> > +       .intr_pending = SA5_ioaccel_mode1_intr_pending,
>> >> > +       .command_completed = SA5_ioaccel_mode1_completed,
>> >> >  };
>> >> >
>> >> >  static struct access_method SA5_ioaccel_mode2_access = {
>> >> > -       SA5_submit_command_ioaccel2,
>> >> > -       SA5_performant_intr_mask,
>> >> > -       SA5_performant_intr_pending,
>> >> > -       SA5_performant_completed,
>> >> > +       .submit_command = SA5_submit_command_ioaccel2,
>> >> > +       .set_intr_mask = SA5_performant_intr_mask,
>> >> > +       .intr_pending = SA5_performant_intr_pending,
>> >> > +       .command_completed = SA5_performant_completed,
>> >> >  };
>> >> >
>> >> >  static struct access_method SA5_performant_access = {
>> >> > -       SA5_submit_command,
>> >> > -       SA5_performant_intr_mask,
>> >> > -       SA5_performant_intr_pending,
>> >> > -       SA5_performant_completed,
>> >> > +       .submit_command = SA5_submit_command,
>> >> > +       .set_intr_mask = SA5_performant_intr_mask,
>> >> > +       .intr_pending = SA5_performant_intr_pending,
>> >> > +       .command_completed = SA5_performant_completed,
>> >> >  };
>> >> >
>> >> >  static struct access_method SA5_performant_access_no_read = {
>> >> > -       SA5_submit_command_no_read,
>> >> > -       SA5_performant_intr_mask,
>> >> > -       SA5_performant_intr_pending,
>> >> > -       SA5_performant_completed,
>> >> > +       .submit_command = SA5_submit_command_no_read,
>> >> > +       .set_intr_mask = SA5_performant_intr_mask,
>> >> > +       .intr_pending = SA5_performant_intr_pending,
>> >> > +       .command_completed = SA5_performant_completed,
>> >> >  };
>> >> >
>> >> >  struct board_type {
>> >> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
>> >> > index 4310154..605d035 100644
>> >> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
>> >> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
>> >> > @@ -147,7 +147,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
>> >> >         int added = (mode == LCK_NL);
>> >> >         int overlaps = 0;
>> >> >         int splitted = 0;
>> >> > -       const struct ldlm_callback_suite null_cbs = { NULL };
>> >> > +       const struct ldlm_callback_suite null_cbs = { };
>> >> >
>> >> >         CDEBUG(D_DLMTRACE,
>> >> >                "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
>> >> > diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
>> >> > index 329d78c..9756f9e 100644
>> >> > --- a/drivers/staging/lustre/lustre/libcfs/module.c
>> >> > +++ b/drivers/staging/lustre/lustre/libcfs/module.c
>> >> > @@ -322,11 +322,11 @@ out:
>> >> >  }
>> >> >
>> >> >  struct cfs_psdev_ops libcfs_psdev_ops = {
>> >> > -       libcfs_psdev_open,
>> >> > -       libcfs_psdev_release,
>> >> > -       NULL,
>> >> > -       NULL,
>> >> > -       libcfs_ioctl
>> >> > +       .p_open = libcfs_psdev_open,
>> >> > +       .p_close = libcfs_psdev_release,
>> >> > +       .p_read = NULL,
>> >> > +       .p_write = NULL,
>> >> > +       .p_ioctl = libcfs_ioctl
>> >> >  };
>> >> >
>> >> >  static int proc_call_handler(void *data, int write, loff_t *ppos,
>> >> > diff --git a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
>> >> > index a01147f..5d896f8 100644
>> >> > --- a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
>> >> > +++ b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
>> >> > @@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo)
>> >> >
>> >> >  #ifdef CONFIG_FB_MATROX_MYSTIQUE
>> >> >  struct matrox_switch matrox_mystique = {
>> >> > -       MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore,
>> >> > +       .preinit = MGA1064_preinit,
>> >> > +       .reset = MGA1064_reset,
>> >> > +       .init = MGA1064_init,
>> >> > +       .restore = MGA1064_restore,
>> >> >  };
>> >> >  EXPORT_SYMBOL(matrox_mystique);
>> >> >  #endif
>> >> >
>> >> >  #ifdef CONFIG_FB_MATROX_G
>> >> >  struct matrox_switch matrox_G100 = {
>> >> > -       MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore,
>> >> > +       .preinit = MGAG100_preinit,
>> >> > +       .reset = MGAG100_reset,
>> >> > +       .init = MGAG100_init,
>> >> > +       .restore = MGAG100_restore,
>> >> >  };
>> >> >  EXPORT_SYMBOL(matrox_G100);
>> >> >  #endif
>> >> > diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
>> >> > index 195ad7c..09743fc 100644
>> >> > --- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
>> >> > +++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
>> >> > @@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo)
>> >> >  }
>> >> >
>> >> >  struct matrox_switch matrox_millennium = {
>> >> > -       Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore
>> >> > +       .preinit = Ti3026_preinit,
>> >> > +       .reset = Ti3026_reset,
>> >> > +       .init = Ti3026_init,
>> >> > +       .restore = Ti3026_restore
>> >> >  };
>> >> >  EXPORT_SYMBOL(matrox_millennium);
>> >> >  #endif
>> >> > diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
>> >> > index aca73dd..e3c558d 100644
>> >> > --- a/fs/reiserfs/item_ops.c
>> >> > +++ b/fs/reiserfs/item_ops.c
>> >> > @@ -724,18 +724,18 @@ static void errcatch_print_vi(struct virtual_item *vi)
>> >> >  }
>> >> >
>> >> >  static struct item_operations errcatch_ops = {
>> >> > -       errcatch_bytes_number,
>> >> > -       errcatch_decrement_key,
>> >> > -       errcatch_is_left_mergeable,
>> >> > -       errcatch_print_item,
>> >> > -       errcatch_check_item,
>> >> > -
>> >> > -       errcatch_create_vi,
>> >> > -       errcatch_check_left,
>> >> > -       errcatch_check_right,
>> >> > -       errcatch_part_size,
>> >> > -       errcatch_unit_num,
>> >> > -       errcatch_print_vi
>> >> > +       .bytes_number = errcatch_bytes_number,
>> >> > +       .decrement_key = errcatch_decrement_key,
>> >> > +       .is_left_mergeable = errcatch_is_left_mergeable,
>> >> > +       .print_item = errcatch_print_item,
>> >> > +       .check_item = errcatch_check_item,
>> >> > +
>> >> > +       .create_vi = errcatch_create_vi,
>> >> > +       .check_left = errcatch_check_left,
>> >> > +       .check_right = errcatch_check_right,
>> >> > +       .part_size = errcatch_part_size,
>> >> > +       .unit_num = errcatch_unit_num,
>> >> > +       .print_vi = errcatch_print_vi
>> >> >  };
>> >> >
>> >> >  #if ! (TYPE_STAT_DATA == 0 && TYPE_INDIRECT == 1 && TYPE_DIRECT == 2 && TYPE_DIRENTRY == 3)
>> >> > diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
>> >> > index 14d7b83..a1edf56 100644
>> >> > --- a/include/linux/rbtree_augmented.h
>> >> > +++ b/include/linux/rbtree_augmented.h
>> >> > @@ -90,7 +90,9 @@ rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new)     \
>> >> >         old->rbaugmented = rbcompute(old);                              \
>> >> >  }                                                                      \
>> >> >  rbstatic const struct rb_augment_callbacks rbname = {                  \
>> >> > -       rbname ## _propagate, rbname ## _copy, rbname ## _rotate        \
>> >> > +       .propagate = rbname ## _propagate,                              \
>> >> > +       .copy = rbname ## _copy,                                        \
>> >> > +       .rotate = rbname ## _rotate                                     \
>> >> >  };
>> >> >
>> >> >
>> >> > diff --git a/lib/rbtree.c b/lib/rbtree.c
>> >> > index 1356454..70ce6c6 100644
>> >> > --- a/lib/rbtree.c
>> >> > +++ b/lib/rbtree.c
>> >> > @@ -412,7 +412,9 @@ static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {}
>> >> >  static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {}
>> >> >
>> >> >  static const struct rb_augment_callbacks dummy_callbacks = {
>> >> > -       dummy_propagate, dummy_copy, dummy_rotate
>> >> > +       .propagate = dummy_propagate,
>> >> > +       .copy = dummy_copy,
>> >> > +       .rotate = dummy_rotate
>> >> >  };
>> >> >
>> >> >  void rb_insert_color(struct rb_node *node, struct rb_root *root)
>> >> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> >> > index 838ca8bb..7432a90 100644
>> >> > --- a/mm/page_alloc.c
>> >> > +++ b/mm/page_alloc.c
>> >> > @@ -561,7 +561,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page,
>> >> >                 __mod_zone_freepage_state(zone, (1 << order), migratetype);
>> >> >  }
>> >> >  #else
>> >> > -struct page_ext_operations debug_guardpage_ops = { NULL, };
>> >> > +struct page_ext_operations debug_guardpage_ops = { .need = NULL, .init = NULL };
>> >> >  static inline void set_page_guard(struct zone *zone, struct page *page,
>> >> >                                 unsigned int order, int migratetype) {}
>> >> >  static inline void clear_page_guard(struct zone *zone, struct page *page,
>> >> > diff --git a/net/atm/lec.c b/net/atm/lec.c
>> >> > index cd3b379..977a3c9 100644
>> >> > --- a/net/atm/lec.c
>> >> > +++ b/net/atm/lec.c
>> >> > @@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
>> >> >  }
>> >> >
>> >> >  static struct lane2_ops lane2_ops = {
>> >> > -       lane2_resolve,          /* resolve,             spec 3.1.3 */
>> >> > -       lane2_associate_req,    /* associate_req,       spec 3.1.4 */
>> >> > -       NULL                    /* associate indicator, spec 3.1.5 */
>> >> > +       .resolve = lane2_resolve,
>> >> > +       .associate_req = lane2_associate_req,
>> >> > +       .associate_indicator = NULL
>> >> >  };
>> >> >
>> >> >  static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
>> >> > diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
>> >> > index 9e60e74..637c96e 100644
>> >> > --- a/net/atm/mpoa_caches.c
>> >> > +++ b/net/atm/mpoa_caches.c
>> >> > @@ -535,30 +535,29 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
>> >> >
>> >> >
>> >> >  static const struct in_cache_ops ingress_ops = {
>> >> > -       in_cache_add_entry,               /* add_entry       */
>> >> > -       in_cache_get,                     /* get             */
>> >> > -       in_cache_get_with_mask,           /* get_with_mask   */
>> >> > -       in_cache_get_by_vcc,              /* get_by_vcc      */
>> >> > -       in_cache_put,                     /* put             */
>> >> > -       in_cache_remove_entry,            /* remove_entry    */
>> >> > -       cache_hit,                        /* cache_hit       */
>> >> > -       clear_count_and_expired,          /* clear_count     */
>> >> > -       check_resolving_entries,          /* check_resolving */
>> >> > -       refresh_entries,                  /* refresh         */
>> >> > -       in_destroy_cache                  /* destroy_cache   */
>> >> > +       .add_entry = in_cache_add_entry,
>> >> > +       .get = in_cache_get,
>> >> > +       .get_with_mask = in_cache_get_with_mask,
>> >> > +       .get_by_vcc = in_cache_get_by_vcc,
>> >> > +       .put = in_cache_put,
>> >> > +       .remove_entry = in_cache_remove_entry,
>> >> > +       .cache_hit = cache_hit,
>> >> > +       .clear_count = clear_count_and_expired,
>> >> > +       .check_resolving = check_resolving_entries,
>> >> > +       .refresh = refresh_entries,
>> >> >  };
>> >> >
>> >> >  static const struct eg_cache_ops egress_ops = {
>> >> > -       eg_cache_add_entry,               /* add_entry        */
>> >> > -       eg_cache_get_by_cache_id,         /* get_by_cache_id  */
>> >> > -       eg_cache_get_by_tag,              /* get_by_tag       */
>> >> > -       eg_cache_get_by_vcc,              /* get_by_vcc       */
>> >> > -       eg_cache_get_by_src_ip,           /* get_by_src_ip    */
>> >> > -       eg_cache_put,                     /* put              */
>> >> > -       eg_cache_remove_entry,            /* remove_entry     */
>> >> > -       update_eg_cache_entry,            /* update           */
>> >> > -       clear_expired,                    /* clear_expired    */
>> >> > -       eg_destroy_cache                  /* destroy_cache    */
>> >> > +       .add_entry = eg_cache_add_entry,
>> >> > +       .get_by_cache_id = eg_cache_get_by_cache_id,
>> >> > +       .get_by_tag = eg_cache_get_by_tag,
>> >> > +       .get_by_vcc = eg_cache_get_by_vcc,
>> >> > +       .get_by_src_ip = eg_cache_get_by_src_ip,
>> >> > +       .put = eg_cache_put,
>> >> > +       .remove_entry = eg_cache_remove_entry,
>> >> > +       .update = update_eg_cache_entry,
>> >> > +       .clear_expired = clear_expired,
>> >> > +       .destroy_cache = eg_destroy_cache
>> >> >  };
>> >> >
>> >> >
>> >> > diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
>> >> > index fd8cf02..1406db4 100644
>> >> > --- a/net/vmw_vsock/vmci_transport_notify.c
>> >> > +++ b/net/vmw_vsock/vmci_transport_notify.c
>> >> > @@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
>> >> >
>> >> >  /* Socket control packet based operations. */
>> >> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
>> >> > -       vmci_transport_notify_pkt_socket_init,
>> >> > -       vmci_transport_notify_pkt_socket_destruct,
>> >> > -       vmci_transport_notify_pkt_poll_in,
>> >> > -       vmci_transport_notify_pkt_poll_out,
>> >> > -       vmci_transport_notify_pkt_handle_pkt,
>> >> > -       vmci_transport_notify_pkt_recv_init,
>> >> > -       vmci_transport_notify_pkt_recv_pre_block,
>> >> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
>> >> > -       vmci_transport_notify_pkt_recv_post_dequeue,
>> >> > -       vmci_transport_notify_pkt_send_init,
>> >> > -       vmci_transport_notify_pkt_send_pre_block,
>> >> > -       vmci_transport_notify_pkt_send_pre_enqueue,
>> >> > -       vmci_transport_notify_pkt_send_post_enqueue,
>> >> > -       vmci_transport_notify_pkt_process_request,
>> >> > -       vmci_transport_notify_pkt_process_negotiate,
>> >> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
>> >> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
>> >> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
>> >> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
>> >> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
>> >> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
>> >> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
>> >> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
>> >> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
>> >> > +       .send_init = vmci_transport_notify_pkt_send_init,
>> >> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
>> >> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
>> >> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
>> >> > +       .process_request = vmci_transport_notify_pkt_process_request,
>> >> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
>> >> >  };
>> >> > diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
>> >> > index 21e591d..f3a0afc 100644
>> >> > --- a/net/vmw_vsock/vmci_transport_notify_qstate.c
>> >> > +++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
>> >> > @@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue(
>> >> >
>> >> >  /* Socket always on control packet based operations. */
>> >> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
>> >> > -       vmci_transport_notify_pkt_socket_init,
>> >> > -       vmci_transport_notify_pkt_socket_destruct,
>> >> > -       vmci_transport_notify_pkt_poll_in,
>> >> > -       vmci_transport_notify_pkt_poll_out,
>> >> > -       vmci_transport_notify_pkt_handle_pkt,
>> >> > -       vmci_transport_notify_pkt_recv_init,
>> >> > -       vmci_transport_notify_pkt_recv_pre_block,
>> >> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
>> >> > -       vmci_transport_notify_pkt_recv_post_dequeue,
>> >> > -       vmci_transport_notify_pkt_send_init,
>> >> > -       vmci_transport_notify_pkt_send_pre_block,
>> >> > -       vmci_transport_notify_pkt_send_pre_enqueue,
>> >> > -       vmci_transport_notify_pkt_send_post_enqueue,
>> >> > -       vmci_transport_notify_pkt_process_request,
>> >> > -       vmci_transport_notify_pkt_process_negotiate,
>> >> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
>> >> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
>> >> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
>> >> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
>> >> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
>> >> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
>> >> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
>> >> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
>> >> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
>> >> > +       .send_init = vmci_transport_notify_pkt_send_init,
>> >> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
>> >> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
>> >> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
>> >> > +       .process_request = vmci_transport_notify_pkt_process_request,
>> >> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
>> >> >  };
>> >> > diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
>> >> > index a020920..55579f6 100644
>> >> > --- a/sound/synth/emux/emux_seq.c
>> >> > +++ b/sound/synth/emux/emux_seq.c
>> >> > @@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
>> >> >   * MIDI emulation operators
>> >> >   */
>> >> >  static struct snd_midi_op emux_ops = {
>> >> > -       snd_emux_note_on,
>> >> > -       snd_emux_note_off,
>> >> > -       snd_emux_key_press,
>> >> > -       snd_emux_terminate_note,
>> >> > -       snd_emux_control,
>> >> > -       snd_emux_nrpn,
>> >> > -       snd_emux_sysex,
>> >> > +       .note_on = snd_emux_note_on,
>> >> > +       .note_off = snd_emux_note_off,
>> >> > +       .key_press = snd_emux_key_press,
>> >> > +       .note_terminate = snd_emux_terminate_note,
>> >> > +       .control = snd_emux_control,
>> >> > +       .nrpn = snd_emux_nrpn,
>> >> > +       .sysex = snd_emux_sysex,
>> >> >  };
>> >> >
>> >> >
>> >> > --
>> >> > 1.9.1
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Kees Cook
>> >> Chrome OS & Brillo Security
>> >>
>>
>>
>>
>> --
>> Kees Cook
>> Chrome OS & Brillo Security
>>



-- 
Kees Cook
Chrome OS & Brillo Security

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

* [kernel-hardening] Re: [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs
  2016-06-13 18:15       ` Kees Cook
  2016-06-13 19:57         ` Julia Lawall
@ 2016-06-13 20:28         ` Leibowitz, Michael
  1 sibling, 0 replies; 21+ messages in thread
From: Leibowitz, Michael @ 2016-06-13 20:28 UTC (permalink / raw)
  To: Kees Cook
  Cc: Julia Lawall, Brad Spengler, kernel-hardening, Emese Revfy, PaX Team

On Mon, Jun 13, 2016 at 11:15 AM, Kees Cook <keescook@chromium.org> wrote:
> On Mon, Jun 13, 2016 at 7:32 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> On Thu, 5 May 2016, Kees Cook wrote:
>>
>>> On Thu, May 5, 2016 at 10:21 AM, Michael Leibowitz
>>> <michael.leibowitz@intel.com> wrote:
>>> > Due to randomization of structs, the in order struct intialization
>>> > style is replaced with explicit field style.
>>> >
>>> > struct foo_t my_foo = {
>>> >        one,
>>> >        two,
>>> >        three
>>> > };
>>> >
>>> > becomes
>>> >
>>> > struct foo_t my_foo = {
>>> >        .one = one,
>>> >        .two = two,
>>> >        .three = three
>>> > };
>>>
>>> Can a coccinelle script be written to do this also? It might be useful
>>> to keep that around.
>>
>> Is this needed for all kinds of structure initializations, ie for both
>> local and global variables, or only for global variables?
>
> It's needed for any structure that has been globally defined. As in,
> any use of a struct must be using C99 since that structure may be
> randomized (in any context: global, local).
>
> Michael, what's the state of this series? What're your next steps?

I expect to have a new patch set addressing comments shortly.

Cheers

>
> -Kees
>
>>
>> thanks,
>> julia
>>
>>>
>>> >
>>> > Additionally, tag paravirt related structures to explicitly not be
>>> > randomized, as the structure layout is important.
>>>
>>> This might need to be split out? It's logically separate. Also, I
>>> think this needs to come before the plugin, since the plugin isn't
>>> usable until this patch is in place.
>>>
>>> -Kees
>>>
>>> >
>>> > This feature is ported over from grsecurity.  This is largely
>>> > unchanged from the Original code written by the PaX Team and Spender.
>>> >
>>> > Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
>>> > ---
>>> >  arch/x86/include/asm/floppy.h                   | 20 ++---
>>> >  arch/x86/include/asm/paravirt_types.h           | 18 +++--
>>> >  drivers/acpi/acpica/hwxfsleep.c                 | 11 +--
>>> >  drivers/block/cciss.h                           | 30 ++++----
>>> >  drivers/gpu/drm/nouveau/nouveau_ttm.c           | 28 +++----
>>> >  drivers/gpu/drm/ttm/ttm_bo_manager.c            | 10 +--
>>> >  drivers/gpu/drm/virtio/virtgpu_ttm.c            | 10 +--
>>> >  drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   | 10 +--
>>> >  drivers/infiniband/hw/nes/nes_cm.c              | 22 +++---
>>> >  drivers/isdn/gigaset/bas-gigaset.c              | 32 ++++----
>>> >  drivers/isdn/gigaset/ser-gigaset.c              | 32 ++++----
>>> >  drivers/isdn/gigaset/usb-gigaset.c              | 32 ++++----
>>> >  drivers/isdn/i4l/isdn_concap.c                  |  6 +-
>>> >  drivers/isdn/i4l/isdn_x25iface.c                | 16 ++--
>>> >  drivers/media/pci/solo6x10/solo6x10-g723.c      |  2 +-
>>> >  drivers/net/ethernet/brocade/bna/bna_enet.c     |  8 +-
>>> >  drivers/net/wan/lmc/lmc_media.c                 | 97 +++++++++++++------------
>>> >  drivers/scsi/bfa/bfa_fcs.c                      | 19 ++++-
>>> >  drivers/scsi/bfa/bfa_fcs_lport.c                | 29 +++++---
>>> >  drivers/scsi/bfa/bfa_modules.h                  | 12 +--
>>> >  drivers/scsi/hpsa.h                             | 40 +++++-----
>>> >  drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |  2 +-
>>> >  drivers/staging/lustre/lustre/libcfs/module.c   | 10 +--
>>> >  drivers/video/fbdev/matrox/matroxfb_DAC1064.c   | 10 ++-
>>> >  drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |  5 +-
>>> >  fs/reiserfs/item_ops.c                          | 24 +++---
>>> >  include/linux/rbtree_augmented.h                |  4 +-
>>> >  lib/rbtree.c                                    |  4 +-
>>> >  mm/page_alloc.c                                 |  2 +-
>>> >  net/atm/lec.c                                   |  6 +-
>>> >  net/atm/mpoa_caches.c                           | 41 +++++------
>>> >  net/vmw_vsock/vmci_transport_notify.c           | 30 ++++----
>>> >  net/vmw_vsock/vmci_transport_notify_qstate.c    | 30 ++++----
>>> >  sound/synth/emux/emux_seq.c                     | 14 ++--
>>> >  34 files changed, 352 insertions(+), 314 deletions(-)
>>> >
>>> > diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
>>> > index 1c7eefe..d0e4702 100644
>>> > --- a/arch/x86/include/asm/floppy.h
>>> > +++ b/arch/x86/include/asm/floppy.h
>>> > @@ -229,18 +229,18 @@ static struct fd_routine_l {
>>> >         int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
>>> >  } fd_routine[] = {
>>> >         {
>>> > -               request_dma,
>>> > -               free_dma,
>>> > -               get_dma_residue,
>>> > -               dma_mem_alloc,
>>> > -               hard_dma_setup
>>> > +               ._request_dma = request_dma,
>>> > +               ._free_dma = free_dma,
>>> > +               ._get_dma_residue = get_dma_residue,
>>> > +               ._dma_mem_alloc = dma_mem_alloc,
>>> > +               ._dma_setup = hard_dma_setup
>>> >         },
>>> >         {
>>> > -               vdma_request_dma,
>>> > -               vdma_nop,
>>> > -               vdma_get_dma_residue,
>>> > -               vdma_mem_alloc,
>>> > -               vdma_dma_setup
>>> > +               ._request_dma = vdma_request_dma,
>>> > +               ._free_dma = vdma_nop,
>>> > +               ._get_dma_residue = vdma_get_dma_residue,
>>> > +               ._dma_mem_alloc = vdma_mem_alloc,
>>> > +               ._dma_setup = vdma_dma_setup
>>> >         }
>>> >  };
>>> >
>>> > diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
>>> > index 77db561..927c396 100644
>>> > --- a/arch/x86/include/asm/paravirt_types.h
>>> > +++ b/arch/x86/include/asm/paravirt_types.h
>>> > @@ -89,7 +89,7 @@ struct pv_init_ops {
>>> >          */
>>> >         unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
>>> >                           unsigned long addr, unsigned len);
>>> > -};
>>> > +} __no_randomize_layout;
>>> >
>>> >
>>> >  struct pv_lazy_ops {
>>> > @@ -97,12 +97,12 @@ struct pv_lazy_ops {
>>> >         void (*enter)(void);
>>> >         void (*leave)(void);
>>> >         void (*flush)(void);
>>> > -};
>>> > +} __no_randomize_layout;
>>> >
>>> >  struct pv_time_ops {
>>> >         unsigned long long (*sched_clock)(void);
>>> >         unsigned long long (*steal_clock)(int cpu);
>>> > -};
>>> > +} __no_randomize_layout;
>>> >
>>> >  struct pv_cpu_ops {
>>> >         /* hooks for various privileged instructions */
>>> > @@ -178,7 +178,7 @@ struct pv_cpu_ops {
>>> >
>>> >         void (*start_context_switch)(struct task_struct *prev);
>>> >         void (*end_context_switch)(struct task_struct *next);
>>> > -};
>>> > +} __no_randomize_layout;
>>> >
>>> >  struct pv_irq_ops {
>>> >         /*
>>> > @@ -201,7 +201,7 @@ struct pv_irq_ops {
>>> >  #ifdef CONFIG_X86_64
>>> >         void (*adjust_exception_frame)(void);
>>> >  #endif
>>> > -};
>>> > +} __no_randomize_layout;
>>> >
>>> >  struct pv_mmu_ops {
>>> >         unsigned long (*read_cr2)(void);
>>> > @@ -296,7 +296,7 @@ struct pv_mmu_ops {
>>> >            an mfn.  We can tell which is which from the index. */
>>> >         void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
>>> >                            phys_addr_t phys, pgprot_t flags);
>>> > -};
>>> > +} __no_randomize_layout;
>>> >
>>> >  struct arch_spinlock;
>>> >  #ifdef CONFIG_SMP
>>> > @@ -322,7 +322,9 @@ struct pv_lock_ops {
>>> >
>>> >  /* This contains all the paravirt structures: we get a convenient
>>> >   * number for each function using the offset which we use to indicate
>>> > - * what to patch. */
>>> > + * what to patch.
>>> > + * shouldn't be randomized due to the "NEAT TRICK" in paravirt.c
>>> > + */
>>> >  struct paravirt_patch_template {
>>> >         struct pv_init_ops pv_init_ops;
>>> >         struct pv_time_ops pv_time_ops;
>>> > @@ -330,7 +332,7 @@ struct paravirt_patch_template {
>>> >         struct pv_irq_ops pv_irq_ops;
>>> >         struct pv_mmu_ops pv_mmu_ops;
>>> >         struct pv_lock_ops pv_lock_ops;
>>> > -};
>>> > +} __no_randomize_layout;
>>> >
>>> >  extern struct pv_info pv_info;
>>> >  extern struct pv_init_ops pv_init_ops;
>>> > diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
>>> > index f76e0ea..4b83315 100644
>>> > --- a/drivers/acpi/acpica/hwxfsleep.c
>>> > +++ b/drivers/acpi/acpica/hwxfsleep.c
>>> > @@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
>>> >  /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
>>> >
>>> >  static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
>>> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
>>> > -        acpi_hw_extended_sleep},
>>> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
>>> > -        acpi_hw_extended_wake_prep},
>>> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake}
>>> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
>>> > +        .extended_function = acpi_hw_extended_sleep},
>>> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
>>> > +        .extended_function = acpi_hw_extended_wake_prep},
>>> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake),
>>> > +        .extended_function = acpi_hw_extended_wake}
>>> >  };
>>> >
>>> >  /*
>>> > diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
>>> > index 7fda30e..428766d 100644
>>> > --- a/drivers/block/cciss.h
>>> > +++ b/drivers/block/cciss.h
>>> > @@ -402,27 +402,27 @@ static bool SA5_performant_intr_pending(ctlr_info_t *h)
>>> >  }
>>> >
>>> >  static struct access_method SA5_access = {
>>> > -       SA5_submit_command,
>>> > -       SA5_intr_mask,
>>> > -       SA5_fifo_full,
>>> > -       SA5_intr_pending,
>>> > -       SA5_completed,
>>> > +       .submit_command = SA5_submit_command,
>>> > +       .set_intr_mask = SA5_intr_mask,
>>> > +       .fifo_full = SA5_fifo_full,
>>> > +       .intr_pending = SA5_intr_pending,
>>> > +       .command_completed = SA5_completed,
>>> >  };
>>> >
>>> >  static struct access_method SA5B_access = {
>>> > -        SA5_submit_command,
>>> > -        SA5B_intr_mask,
>>> > -        SA5_fifo_full,
>>> > -        SA5B_intr_pending,
>>> > -        SA5_completed,
>>> > +       .submit_command = SA5_submit_command,
>>> > +       .set_intr_mask = SA5B_intr_mask,
>>> > +       .fifo_full = SA5_fifo_full,
>>> > +       .intr_pending = SA5B_intr_pending,
>>> > +       .command_completed = SA5_completed,
>>> >  };
>>> >
>>> >  static struct access_method SA5_performant_access = {
>>> > -       SA5_submit_command,
>>> > -       SA5_performant_intr_mask,
>>> > -       SA5_fifo_full,
>>> > -       SA5_performant_intr_pending,
>>> > -       SA5_performant_completed,
>>> > +       .submit_command = SA5_submit_command,
>>> > +       .set_intr_mask = SA5_performant_intr_mask,
>>> > +       .fifo_full = SA5_fifo_full,
>>> > +       .intr_pending = SA5_performant_intr_pending,
>>> > +       .command_completed = SA5_performant_completed,
>>> >  };
>>> >
>>> >  struct board_type {
>>> > diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
>>> > index d2e7d20..7bbe51f 100644
>>> > --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
>>> > +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
>>> > @@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
>>> >  }
>>> >
>>> >  const struct ttm_mem_type_manager_func nouveau_vram_manager = {
>>> > -       nouveau_vram_manager_init,
>>> > -       nouveau_vram_manager_fini,
>>> > -       nouveau_vram_manager_new,
>>> > -       nouveau_vram_manager_del,
>>> > +       .init = nouveau_vram_manager_init,
>>> > +       .takedown = nouveau_vram_manager_fini,
>>> > +       .get_node = nouveau_vram_manager_new,
>>> > +       .put_node = nouveau_vram_manager_del,
>>> >  };
>>> >
>>> >  static int
>>> > @@ -183,11 +183,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
>>> >  }
>>> >
>>> >  const struct ttm_mem_type_manager_func nouveau_gart_manager = {
>>> > -       nouveau_gart_manager_init,
>>> > -       nouveau_gart_manager_fini,
>>> > -       nouveau_gart_manager_new,
>>> > -       nouveau_gart_manager_del,
>>> > -       nouveau_gart_manager_debug
>>> > +       .init = nouveau_gart_manager_init,
>>> > +       .takedown = nouveau_gart_manager_fini,
>>> > +       .get_node = nouveau_gart_manager_new,
>>> > +       .put_node = nouveau_gart_manager_del,
>>> > +       .debug = nouveau_gart_manager_debug
>>> >  };
>>> >
>>> >  /*XXX*/
>>> > @@ -256,11 +256,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
>>> >  }
>>> >
>>> >  const struct ttm_mem_type_manager_func nv04_gart_manager = {
>>> > -       nv04_gart_manager_init,
>>> > -       nv04_gart_manager_fini,
>>> > -       nv04_gart_manager_new,
>>> > -       nv04_gart_manager_del,
>>> > -       nv04_gart_manager_debug
>>> > +       .init = nv04_gart_manager_init,
>>> > +       .takedown = nv04_gart_manager_fini,
>>> > +       .get_node = nv04_gart_manager_new,
>>> > +       .put_node = nv04_gart_manager_del,
>>> > +       .debug = nv04_gart_manager_debug
>>> >  };
>>> >
>>> >  int
>>> > diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
>>> > index aa0bd05..aea6a01 100644
>>> > --- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
>>> > +++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
>>> > @@ -148,10 +148,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
>>> >  }
>>> >
>>> >  const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
>>> > -       ttm_bo_man_init,
>>> > -       ttm_bo_man_takedown,
>>> > -       ttm_bo_man_get_node,
>>> > -       ttm_bo_man_put_node,
>>> > -       ttm_bo_man_debug
>>> > +       .init = ttm_bo_man_init,
>>> > +       .takedown = ttm_bo_man_takedown,
>>> > +       .get_node = ttm_bo_man_get_node,
>>> > +       .put_node = ttm_bo_man_put_node,
>>> > +       .debug = ttm_bo_man_debug
>>> >  };
>>> >  EXPORT_SYMBOL(ttm_bo_manager_func);
>>> > diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
>>> > index 9fd924c..e5ec4ef 100644
>>> > --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
>>> > +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
>>> > @@ -198,11 +198,11 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
>>> >  }
>>> >
>>> >  static const struct ttm_mem_type_manager_func virtio_gpu_bo_manager_func = {
>>> > -       ttm_bo_man_init,
>>> > -       ttm_bo_man_takedown,
>>> > -       ttm_bo_man_get_node,
>>> > -       ttm_bo_man_put_node,
>>> > -       ttm_bo_man_debug
>>> > +       .init = ttm_bo_man_init,
>>> > +       .takedown = ttm_bo_man_takedown,
>>> > +       .get_node = ttm_bo_man_get_node,
>>> > +       .put_node = ttm_bo_man_put_node,
>>> > +       .debug = ttm_bo_man_debug
>>> >  };
>>> >
>>> >  static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
>>> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
>>> > index 170b61b..fec7348 100644
>>> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
>>> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
>>> > @@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
>>> >  }
>>> >
>>> >  const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
>>> > -       vmw_gmrid_man_init,
>>> > -       vmw_gmrid_man_takedown,
>>> > -       vmw_gmrid_man_get_node,
>>> > -       vmw_gmrid_man_put_node,
>>> > -       vmw_gmrid_man_debug
>>> > +       .init = vmw_gmrid_man_init,
>>> > +       .takedown = vmw_gmrid_man_takedown,
>>> > +       .get_node = vmw_gmrid_man_get_node,
>>> > +       .put_node = vmw_gmrid_man_put_node,
>>> > +       .debug = vmw_gmrid_man_debug
>>> >  };
>>> > diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
>>> > index cb9f0f2..8b1f654 100644
>>> > --- a/drivers/infiniband/hw/nes/nes_cm.c
>>> > +++ b/drivers/infiniband/hw/nes/nes_cm.c
>>> > @@ -135,17 +135,17 @@ static void record_ird_ord(struct nes_cm_node *, u16, u16);
>>> >  /* instance of function pointers for client API */
>>> >  /* set address of this instance to cm_core->cm_ops at cm_core alloc */
>>> >  static const struct nes_cm_ops nes_cm_api = {
>>> > -       mini_cm_accelerated,
>>> > -       mini_cm_listen,
>>> > -       mini_cm_del_listen,
>>> > -       mini_cm_connect,
>>> > -       mini_cm_close,
>>> > -       mini_cm_accept,
>>> > -       mini_cm_reject,
>>> > -       mini_cm_recv_pkt,
>>> > -       mini_cm_dealloc_core,
>>> > -       mini_cm_get,
>>> > -       mini_cm_set
>>> > +       .accelerated = mini_cm_accelerated,
>>> > +       .listen = mini_cm_listen,
>>> > +       .stop_listener = mini_cm_del_listen,
>>> > +       .connect = mini_cm_connect,
>>> > +       .close = mini_cm_close,
>>> > +       .accept = mini_cm_accept,
>>> > +       .reject = mini_cm_reject,
>>> > +       .recv_pkt = mini_cm_recv_pkt,
>>> > +       .destroy_cm_core = mini_cm_dealloc_core,
>>> > +       .get = mini_cm_get,
>>> > +       .set = mini_cm_set
>>> >  };
>>> >
>>> >  static struct nes_cm_core *g_cm_core;
>>> > diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
>>> > index aecec6d..11e13c5 100644
>>> > --- a/drivers/isdn/gigaset/bas-gigaset.c
>>> > +++ b/drivers/isdn/gigaset/bas-gigaset.c
>>> > @@ -2565,22 +2565,22 @@ static int gigaset_post_reset(struct usb_interface *intf)
>>> >
>>> >
>>> >  static const struct gigaset_ops gigops = {
>>> > -       gigaset_write_cmd,
>>> > -       gigaset_write_room,
>>> > -       gigaset_chars_in_buffer,
>>> > -       gigaset_brkchars,
>>> > -       gigaset_init_bchannel,
>>> > -       gigaset_close_bchannel,
>>> > -       gigaset_initbcshw,
>>> > -       gigaset_freebcshw,
>>> > -       gigaset_reinitbcshw,
>>> > -       gigaset_initcshw,
>>> > -       gigaset_freecshw,
>>> > -       gigaset_set_modem_ctrl,
>>> > -       gigaset_baud_rate,
>>> > -       gigaset_set_line_ctrl,
>>> > -       gigaset_isoc_send_skb,
>>> > -       gigaset_isoc_input,
>>> > +       .write_cmd = gigaset_write_cmd,
>>> > +       .write_room = gigaset_write_room,
>>> > +       .chars_in_buffer = gigaset_chars_in_buffer,
>>> > +       .brkchars = gigaset_brkchars,
>>> > +       .init_bchannel = gigaset_init_bchannel,
>>> > +       .close_bchannel = gigaset_close_bchannel,
>>> > +       .initbcshw = gigaset_initbcshw,
>>> > +       .freebcshw = gigaset_freebcshw,
>>> > +       .reinitbcshw = gigaset_reinitbcshw,
>>> > +       .initcshw = gigaset_initcshw,
>>> > +       .freecshw = gigaset_freecshw,
>>> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
>>> > +       .baud_rate = gigaset_baud_rate,
>>> > +       .set_line_ctrl = gigaset_set_line_ctrl,
>>> > +       .send_skb = gigaset_isoc_send_skb,
>>> > +       .handle_input = gigaset_isoc_input,
>>> >  };
>>> >
>>> >  /* bas_gigaset_init
>>> > diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
>>> > index d1f8ab9..c0412f2 100644
>>> > --- a/drivers/isdn/gigaset/ser-gigaset.c
>>> > +++ b/drivers/isdn/gigaset/ser-gigaset.c
>>> > @@ -445,22 +445,22 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
>>> >  }
>>> >
>>> >  static const struct gigaset_ops ops = {
>>> > -       gigaset_write_cmd,
>>> > -       gigaset_write_room,
>>> > -       gigaset_chars_in_buffer,
>>> > -       gigaset_brkchars,
>>> > -       gigaset_init_bchannel,
>>> > -       gigaset_close_bchannel,
>>> > -       gigaset_initbcshw,
>>> > -       gigaset_freebcshw,
>>> > -       gigaset_reinitbcshw,
>>> > -       gigaset_initcshw,
>>> > -       gigaset_freecshw,
>>> > -       gigaset_set_modem_ctrl,
>>> > -       gigaset_baud_rate,
>>> > -       gigaset_set_line_ctrl,
>>> > -       gigaset_m10x_send_skb,  /* asyncdata.c */
>>> > -       gigaset_m10x_input,     /* asyncdata.c */
>>> > +       .write_cmd = gigaset_write_cmd,
>>> > +       .write_room = gigaset_write_room,
>>> > +       .chars_in_buffer = gigaset_chars_in_buffer,
>>> > +       .brkchars = gigaset_brkchars,
>>> > +       .init_bchannel = gigaset_init_bchannel,
>>> > +       .close_bchannel = gigaset_close_bchannel,
>>> > +       .initbcshw = gigaset_initbcshw,
>>> > +       .freebcshw = gigaset_freebcshw,
>>> > +       .reinitbcshw = gigaset_reinitbcshw,
>>> > +       .initcshw = gigaset_initcshw,
>>> > +       .freecshw = gigaset_freecshw,
>>> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
>>> > +       .baud_rate = gigaset_baud_rate,
>>> > +       .set_line_ctrl = gigaset_set_line_ctrl,
>>> > +       .send_skb = gigaset_m10x_send_skb,      /* asyncdata.c */
>>> > +       .handle_input = gigaset_m10x_input,     /* asyncdata.c */
>>> >  };
>>> >
>>> >
>>> > diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
>>> > index 5f306e2..eade36d 100644
>>> > --- a/drivers/isdn/gigaset/usb-gigaset.c
>>> > +++ b/drivers/isdn/gigaset/usb-gigaset.c
>>> > @@ -862,22 +862,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
>>> >  }
>>> >
>>> >  static const struct gigaset_ops ops = {
>>> > -       gigaset_write_cmd,
>>> > -       gigaset_write_room,
>>> > -       gigaset_chars_in_buffer,
>>> > -       gigaset_brkchars,
>>> > -       gigaset_init_bchannel,
>>> > -       gigaset_close_bchannel,
>>> > -       gigaset_initbcshw,
>>> > -       gigaset_freebcshw,
>>> > -       gigaset_reinitbcshw,
>>> > -       gigaset_initcshw,
>>> > -       gigaset_freecshw,
>>> > -       gigaset_set_modem_ctrl,
>>> > -       gigaset_baud_rate,
>>> > -       gigaset_set_line_ctrl,
>>> > -       gigaset_m10x_send_skb,
>>> > -       gigaset_m10x_input,
>>> > +       .write_cmd = gigaset_write_cmd,
>>> > +       .write_room = gigaset_write_room,
>>> > +       .chars_in_buffer = gigaset_chars_in_buffer,
>>> > +       .brkchars = gigaset_brkchars,
>>> > +       .init_bchannel = gigaset_init_bchannel,
>>> > +       .close_bchannel = gigaset_close_bchannel,
>>> > +       .initbcshw = gigaset_initbcshw,
>>> > +       .freebcshw = gigaset_freebcshw,
>>> > +       .reinitbcshw = gigaset_reinitbcshw,
>>> > +       .initcshw = gigaset_initcshw,
>>> > +       .freecshw = gigaset_freecshw,
>>> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
>>> > +       .baud_rate = gigaset_baud_rate,
>>> > +       .set_line_ctrl = gigaset_set_line_ctrl,
>>> > +       .send_skb = gigaset_m10x_send_skb,
>>> > +       .handle_input = gigaset_m10x_input,
>>> >  };
>>> >
>>> >  /*
>>> > diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
>>> > index 91d5730..336523e 100644
>>> > --- a/drivers/isdn/i4l/isdn_concap.c
>>> > +++ b/drivers/isdn/i4l/isdn_concap.c
>>> > @@ -80,9 +80,9 @@ static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
>>> >  }
>>> >
>>> >  struct concap_device_ops isdn_concap_reliable_dl_dops = {
>>> > -       &isdn_concap_dl_data_req,
>>> > -       &isdn_concap_dl_connect_req,
>>> > -       &isdn_concap_dl_disconn_req
>>> > +       .data_req = &isdn_concap_dl_data_req,
>>> > +       .connect_req = &isdn_concap_dl_connect_req,
>>> > +       .disconn_req = &isdn_concap_dl_disconn_req
>>> >  };
>>> >
>>> >  /* The following should better go into a dedicated source file such that
>>> > diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
>>> > index e2d4e58..40cd045 100644
>>> > --- a/drivers/isdn/i4l/isdn_x25iface.c
>>> > +++ b/drivers/isdn/i4l/isdn_x25iface.c
>>> > @@ -53,14 +53,14 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *);
>>> >
>>> >
>>> >  static struct concap_proto_ops ix25_pops = {
>>> > -       &isdn_x25iface_proto_new,
>>> > -       &isdn_x25iface_proto_del,
>>> > -       &isdn_x25iface_proto_restart,
>>> > -       &isdn_x25iface_proto_close,
>>> > -       &isdn_x25iface_xmit,
>>> > -       &isdn_x25iface_receive,
>>> > -       &isdn_x25iface_connect_ind,
>>> > -       &isdn_x25iface_disconn_ind
>>> > +       .proto_new = &isdn_x25iface_proto_new,
>>> > +       .proto_del = &isdn_x25iface_proto_del,
>>> > +       .restart = &isdn_x25iface_proto_restart,
>>> > +       .close = &isdn_x25iface_proto_close,
>>> > +       .encap_and_xmit = &isdn_x25iface_xmit,
>>> > +       .data_ind = &isdn_x25iface_receive,
>>> > +       .connect_ind = &isdn_x25iface_connect_ind,
>>> > +       .disconn_ind = &isdn_x25iface_disconn_ind
>>> >  };
>>> >
>>> >  /* error message helper function */
>>> > diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
>>> > index 4a37a1c..7e82dfd 100644
>>> > --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
>>> > +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
>>> > @@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
>>> >
>>> >  int solo_g723_init(struct solo_dev *solo_dev)
>>> >  {
>>> > -       static struct snd_device_ops ops = { NULL };
>>> > +       static struct snd_device_ops ops = { };
>>> >         struct snd_card *card;
>>> >         struct snd_kcontrol_new kctl;
>>> >         char name[32];
>>> > diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c
>>> > index 4e5c387..bba8173 100644
>>> > --- a/drivers/net/ethernet/brocade/bna/bna_enet.c
>>> > +++ b/drivers/net/ethernet/brocade/bna/bna_enet.c
>>> > @@ -1676,10 +1676,10 @@ bna_cb_ioceth_reset(void *arg)
>>> >  }
>>> >
>>> >  static struct bfa_ioc_cbfn bna_ioceth_cbfn = {
>>> > -       bna_cb_ioceth_enable,
>>> > -       bna_cb_ioceth_disable,
>>> > -       bna_cb_ioceth_hbfail,
>>> > -       bna_cb_ioceth_reset
>>> > +       .enable_cbfn = bna_cb_ioceth_enable,
>>> > +       .disable_cbfn = bna_cb_ioceth_disable,
>>> > +       .hbfail_cbfn = bna_cb_ioceth_hbfail,
>>> > +       .reset_cbfn = bna_cb_ioceth_reset
>>> >  };
>>> >
>>> >  static void bna_attr_init(struct bna_ioceth *ioceth)
>>> > diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
>>> > index 5920c99..ff2e4a5 100644
>>> > --- a/drivers/net/wan/lmc/lmc_media.c
>>> > +++ b/drivers/net/wan/lmc/lmc_media.c
>>> > @@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int);
>>> >  static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
>>> >
>>> >  lmc_media_t lmc_ds3_media = {
>>> > -  lmc_ds3_init,                        /* special media init stuff */
>>> > -  lmc_ds3_default,             /* reset to default state */
>>> > -  lmc_ds3_set_status,          /* reset status to state provided */
>>> > -  lmc_dummy_set_1,             /* set clock source */
>>> > -  lmc_dummy_set2_1,            /* set line speed */
>>> > -  lmc_ds3_set_100ft,           /* set cable length */
>>> > -  lmc_ds3_set_scram,           /* set scrambler */
>>> > -  lmc_ds3_get_link_status,     /* get link status */
>>> > -  lmc_dummy_set_1,             /* set link status */
>>> > -  lmc_ds3_set_crc_length,      /* set CRC length */
>>> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
>>> > -  lmc_ds3_watchdog
>>> > +  .init = lmc_ds3_init,                                /* special media init stuff */
>>> > +  .defaults = lmc_ds3_default,                 /* reset to default state */
>>> > +  .set_status = lmc_ds3_set_status,            /* reset status to state provided */
>>> > +  .set_clock_source = lmc_dummy_set_1,         /* set clock source */
>>> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
>>> > +  .set_cable_length = lmc_ds3_set_100ft,       /* set cable length */
>>> > +  .set_scrambler = lmc_ds3_set_scram,          /* set scrambler */
>>> > +  .get_link_status = lmc_ds3_get_link_status,  /* get link status */
>>> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
>>> > +  .set_crc_length = lmc_ds3_set_crc_length,    /* set CRC length */
>>> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
>>> > +  .watchdog = lmc_ds3_watchdog
>>> >  };
>>> >
>>> >  lmc_media_t lmc_hssi_media = {
>>> > -  lmc_hssi_init,               /* special media init stuff */
>>> > -  lmc_hssi_default,            /* reset to default state */
>>> > -  lmc_hssi_set_status,         /* reset status to state provided */
>>> > -  lmc_hssi_set_clock,          /* set clock source */
>>> > -  lmc_dummy_set2_1,            /* set line speed */
>>> > -  lmc_dummy_set_1,             /* set cable length */
>>> > -  lmc_dummy_set_1,             /* set scrambler */
>>> > -  lmc_hssi_get_link_status,    /* get link status */
>>> > -  lmc_hssi_set_link_status,    /* set link status */
>>> > -  lmc_hssi_set_crc_length,     /* set CRC length */
>>> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
>>> > -  lmc_hssi_watchdog
>>> > +  .init = lmc_hssi_init,                       /* special media init stuff */
>>> > +  .defaults = lmc_hssi_default,                        /* reset to default state */
>>> > +  .set_status = lmc_hssi_set_status,           /* reset status to state provided */
>>> > +  .set_clock_source = lmc_hssi_set_clock,      /* set clock source */
>>> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
>>> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
>>> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
>>> > +  .get_link_status = lmc_hssi_get_link_status, /* get link status */
>>> > +  .set_link_status = lmc_hssi_set_link_status, /* set link status */
>>> > +  .set_crc_length = lmc_hssi_set_crc_length,   /* set CRC length */
>>> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
>>> > +  .watchdog = lmc_hssi_watchdog
>>> >  };
>>> >
>>> > -lmc_media_t lmc_ssi_media = { lmc_ssi_init,    /* special media init stuff */
>>> > -  lmc_ssi_default,             /* reset to default state */
>>> > -  lmc_ssi_set_status,          /* reset status to state provided */
>>> > -  lmc_ssi_set_clock,           /* set clock source */
>>> > -  lmc_ssi_set_speed,           /* set line speed */
>>> > -  lmc_dummy_set_1,             /* set cable length */
>>> > -  lmc_dummy_set_1,             /* set scrambler */
>>> > -  lmc_ssi_get_link_status,     /* get link status */
>>> > -  lmc_ssi_set_link_status,     /* set link status */
>>> > -  lmc_ssi_set_crc_length,      /* set CRC length */
>>> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
>>> > -  lmc_ssi_watchdog
>>> > +lmc_media_t lmc_ssi_media = {
>>> > +  .init = lmc_ssi_init,                                /* special media init stuff */
>>> > +  .defaults = lmc_ssi_default,                 /* reset to default state */
>>> > +  .set_status = lmc_ssi_set_status,            /* reset status to state provided */
>>> > +  .set_clock_source = lmc_ssi_set_clock,       /* set clock source */
>>> > +  .set_speed = lmc_ssi_set_speed,              /* set line speed */
>>> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
>>> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
>>> > +  .get_link_status = lmc_ssi_get_link_status,  /* get link status */
>>> > +  .set_link_status = lmc_ssi_set_link_status,  /* set link status */
>>> > +  .set_crc_length = lmc_ssi_set_crc_length,    /* set CRC length */
>>> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
>>> > +  .watchdog = lmc_ssi_watchdog
>>> >  };
>>> >
>>> >  lmc_media_t lmc_t1_media = {
>>> > -  lmc_t1_init,                 /* special media init stuff */
>>> > -  lmc_t1_default,              /* reset to default state */
>>> > -  lmc_t1_set_status,           /* reset status to state provided */
>>> > -  lmc_t1_set_clock,            /* set clock source */
>>> > -  lmc_dummy_set2_1,            /* set line speed */
>>> > -  lmc_dummy_set_1,             /* set cable length */
>>> > -  lmc_dummy_set_1,             /* set scrambler */
>>> > -  lmc_t1_get_link_status,      /* get link status */
>>> > -  lmc_dummy_set_1,             /* set link status */
>>> > -  lmc_t1_set_crc_length,       /* set CRC length */
>>> > -  lmc_t1_set_circuit_type,     /* set T1 or E1 circuit type */
>>> > -  lmc_t1_watchdog
>>> > +  .init = lmc_t1_init,                         /* special media init stuff */
>>> > +  .defaults = lmc_t1_default,                  /* reset to default state */
>>> > +  .set_status = lmc_t1_set_status,             /* reset status to state provided */
>>> > +  .set_clock_source = lmc_t1_set_clock,                /* set clock source */
>>> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
>>> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
>>> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
>>> > +  .get_link_status = lmc_t1_get_link_status,   /* get link status */
>>> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
>>> > +  .set_crc_length = lmc_t1_set_crc_length,     /* set CRC length */
>>> > +  .set_circuit_type = lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
>>> > +  .watchdog = lmc_t1_watchdog
>>> >  };
>>> >
>>> >  static void
>>> > diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
>>> > index 1e7e139..c2031dd 100644
>>> > --- a/drivers/scsi/bfa/bfa_fcs.c
>>> > +++ b/drivers/scsi/bfa/bfa_fcs.c
>>> > @@ -39,10 +39,21 @@ struct bfa_fcs_mod_s {
>>> >  #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
>>> >
>>> >  static struct bfa_fcs_mod_s fcs_modules[] = {
>>> > -       { bfa_fcs_port_attach, NULL, NULL },
>>> > -       { bfa_fcs_uf_attach, NULL, NULL },
>>> > -       { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
>>> > -         bfa_fcs_fabric_modexit },
>>> > +       {
>>> > +               .attach = bfa_fcs_port_attach,
>>> > +               .modinit = NULL,
>>> > +               .modexit = NULL
>>> > +       },
>>> > +       {
>>> > +               .attach = bfa_fcs_uf_attach,
>>> > +               .modinit = NULL,
>>> > +               .modexit = NULL
>>> > +       },
>>> > +       {
>>> > +               .attach = bfa_fcs_fabric_attach,
>>> > +               .modinit = bfa_fcs_fabric_modinit,
>>> > +               .modexit = bfa_fcs_fabric_modexit
>>> > +       },
>>> >  };
>>> >
>>> >  /*
>>> > diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
>>> > index 7733ad5..e5edbce 100644
>>> > --- a/drivers/scsi/bfa/bfa_fcs_lport.c
>>> > +++ b/drivers/scsi/bfa/bfa_fcs_lport.c
>>> > @@ -90,15 +90,26 @@ static struct {
>>> >         void            (*offline) (struct bfa_fcs_lport_s *port);
>>> >  } __port_action[] = {
>>> >         {
>>> > -       bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
>>> > -                       bfa_fcs_lport_unknown_offline}, {
>>> > -       bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
>>> > -                       bfa_fcs_lport_fab_offline}, {
>>> > -       bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
>>> > -                       bfa_fcs_lport_n2n_offline}, {
>>> > -       bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
>>> > -                       bfa_fcs_lport_loop_offline},
>>> > -       };
>>> > +               .init = bfa_fcs_lport_unknown_init,
>>> > +               .online = bfa_fcs_lport_unknown_online,
>>> > +               .offline = bfa_fcs_lport_unknown_offline
>>> > +       },
>>> > +       {
>>> > +               .init = bfa_fcs_lport_fab_init,
>>> > +               .online = bfa_fcs_lport_fab_online,
>>> > +               .offline = bfa_fcs_lport_fab_offline
>>> > +       },
>>> > +       {
>>> > +               .init = bfa_fcs_lport_n2n_init,
>>> > +               .online = bfa_fcs_lport_n2n_online,
>>> > +               .offline = bfa_fcs_lport_n2n_offline
>>> > +       },
>>> > +       {
>>> > +               .init = bfa_fcs_lport_loop_init,
>>> > +               .online = bfa_fcs_lport_loop_online,
>>> > +               .offline = bfa_fcs_lport_loop_offline
>>> > +       },
>>> > +};
>>> >
>>> >  /*
>>> >   *  fcs_port_sm FCS logical port state machine
>>> > diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
>>> > index 53135f2..640621b 100644
>>> > --- a/drivers/scsi/bfa/bfa_modules.h
>>> > +++ b/drivers/scsi/bfa/bfa_modules.h
>>> > @@ -79,12 +79,12 @@ enum {
>>> >                                                                         \
>>> >         extern struct bfa_module_s hal_mod_ ## __mod;                   \
>>> >         struct bfa_module_s hal_mod_ ## __mod = {                       \
>>> > -               bfa_ ## __mod ## _meminfo,                              \
>>> > -               bfa_ ## __mod ## _attach,                               \
>>> > -               bfa_ ## __mod ## _detach,                               \
>>> > -               bfa_ ## __mod ## _start,                                \
>>> > -               bfa_ ## __mod ## _stop,                                 \
>>> > -               bfa_ ## __mod ## _iocdisable,                           \
>>> > +               .meminfo = bfa_ ## __mod ## _meminfo,                   \
>>> > +               .attach = bfa_ ## __mod ## _attach,                     \
>>> > +               .detach = bfa_ ## __mod ## _detach,                     \
>>> > +               .start = bfa_ ## __mod ## _start,                       \
>>> > +               .stop = bfa_ ## __mod ## _stop,                         \
>>> > +               .iocdisable = bfa_ ## __mod ## _iocdisable,             \
>>> >         }
>>> >
>>> >  #define BFA_CACHELINE_SZ       (256)
>>> > diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
>>> > index fdd39fc..b734478 100644
>>> > --- a/drivers/scsi/hpsa.h
>>> > +++ b/drivers/scsi/hpsa.h
>>> > @@ -577,38 +577,38 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
>>> >  }
>>> >
>>> >  static struct access_method SA5_access = {
>>> > -       SA5_submit_command,
>>> > -       SA5_intr_mask,
>>> > -       SA5_intr_pending,
>>> > -       SA5_completed,
>>> > +       .submit_command = SA5_submit_command,
>>> > +       .set_intr_mask = SA5_intr_mask,
>>> > +       .intr_pending = SA5_intr_pending,
>>> > +       .command_completed = SA5_completed,
>>> >  };
>>> >
>>> >  static struct access_method SA5_ioaccel_mode1_access = {
>>> > -       SA5_submit_command,
>>> > -       SA5_performant_intr_mask,
>>> > -       SA5_ioaccel_mode1_intr_pending,
>>> > -       SA5_ioaccel_mode1_completed,
>>> > +       .submit_command = SA5_submit_command,
>>> > +       .set_intr_mask = SA5_performant_intr_mask,
>>> > +       .intr_pending = SA5_ioaccel_mode1_intr_pending,
>>> > +       .command_completed = SA5_ioaccel_mode1_completed,
>>> >  };
>>> >
>>> >  static struct access_method SA5_ioaccel_mode2_access = {
>>> > -       SA5_submit_command_ioaccel2,
>>> > -       SA5_performant_intr_mask,
>>> > -       SA5_performant_intr_pending,
>>> > -       SA5_performant_completed,
>>> > +       .submit_command = SA5_submit_command_ioaccel2,
>>> > +       .set_intr_mask = SA5_performant_intr_mask,
>>> > +       .intr_pending = SA5_performant_intr_pending,
>>> > +       .command_completed = SA5_performant_completed,
>>> >  };
>>> >
>>> >  static struct access_method SA5_performant_access = {
>>> > -       SA5_submit_command,
>>> > -       SA5_performant_intr_mask,
>>> > -       SA5_performant_intr_pending,
>>> > -       SA5_performant_completed,
>>> > +       .submit_command = SA5_submit_command,
>>> > +       .set_intr_mask = SA5_performant_intr_mask,
>>> > +       .intr_pending = SA5_performant_intr_pending,
>>> > +       .command_completed = SA5_performant_completed,
>>> >  };
>>> >
>>> >  static struct access_method SA5_performant_access_no_read = {
>>> > -       SA5_submit_command_no_read,
>>> > -       SA5_performant_intr_mask,
>>> > -       SA5_performant_intr_pending,
>>> > -       SA5_performant_completed,
>>> > +       .submit_command = SA5_submit_command_no_read,
>>> > +       .set_intr_mask = SA5_performant_intr_mask,
>>> > +       .intr_pending = SA5_performant_intr_pending,
>>> > +       .command_completed = SA5_performant_completed,
>>> >  };
>>> >
>>> >  struct board_type {
>>> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
>>> > index 4310154..605d035 100644
>>> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
>>> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
>>> > @@ -147,7 +147,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
>>> >         int added = (mode == LCK_NL);
>>> >         int overlaps = 0;
>>> >         int splitted = 0;
>>> > -       const struct ldlm_callback_suite null_cbs = { NULL };
>>> > +       const struct ldlm_callback_suite null_cbs = { };
>>> >
>>> >         CDEBUG(D_DLMTRACE,
>>> >                "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
>>> > diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
>>> > index 329d78c..9756f9e 100644
>>> > --- a/drivers/staging/lustre/lustre/libcfs/module.c
>>> > +++ b/drivers/staging/lustre/lustre/libcfs/module.c
>>> > @@ -322,11 +322,11 @@ out:
>>> >  }
>>> >
>>> >  struct cfs_psdev_ops libcfs_psdev_ops = {
>>> > -       libcfs_psdev_open,
>>> > -       libcfs_psdev_release,
>>> > -       NULL,
>>> > -       NULL,
>>> > -       libcfs_ioctl
>>> > +       .p_open = libcfs_psdev_open,
>>> > +       .p_close = libcfs_psdev_release,
>>> > +       .p_read = NULL,
>>> > +       .p_write = NULL,
>>> > +       .p_ioctl = libcfs_ioctl
>>> >  };
>>> >
>>> >  static int proc_call_handler(void *data, int write, loff_t *ppos,
>>> > diff --git a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
>>> > index a01147f..5d896f8 100644
>>> > --- a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
>>> > +++ b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
>>> > @@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo)
>>> >
>>> >  #ifdef CONFIG_FB_MATROX_MYSTIQUE
>>> >  struct matrox_switch matrox_mystique = {
>>> > -       MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore,
>>> > +       .preinit = MGA1064_preinit,
>>> > +       .reset = MGA1064_reset,
>>> > +       .init = MGA1064_init,
>>> > +       .restore = MGA1064_restore,
>>> >  };
>>> >  EXPORT_SYMBOL(matrox_mystique);
>>> >  #endif
>>> >
>>> >  #ifdef CONFIG_FB_MATROX_G
>>> >  struct matrox_switch matrox_G100 = {
>>> > -       MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore,
>>> > +       .preinit = MGAG100_preinit,
>>> > +       .reset = MGAG100_reset,
>>> > +       .init = MGAG100_init,
>>> > +       .restore = MGAG100_restore,
>>> >  };
>>> >  EXPORT_SYMBOL(matrox_G100);
>>> >  #endif
>>> > diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
>>> > index 195ad7c..09743fc 100644
>>> > --- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
>>> > +++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
>>> > @@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo)
>>> >  }
>>> >
>>> >  struct matrox_switch matrox_millennium = {
>>> > -       Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore
>>> > +       .preinit = Ti3026_preinit,
>>> > +       .reset = Ti3026_reset,
>>> > +       .init = Ti3026_init,
>>> > +       .restore = Ti3026_restore
>>> >  };
>>> >  EXPORT_SYMBOL(matrox_millennium);
>>> >  #endif
>>> > diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
>>> > index aca73dd..e3c558d 100644
>>> > --- a/fs/reiserfs/item_ops.c
>>> > +++ b/fs/reiserfs/item_ops.c
>>> > @@ -724,18 +724,18 @@ static void errcatch_print_vi(struct virtual_item *vi)
>>> >  }
>>> >
>>> >  static struct item_operations errcatch_ops = {
>>> > -       errcatch_bytes_number,
>>> > -       errcatch_decrement_key,
>>> > -       errcatch_is_left_mergeable,
>>> > -       errcatch_print_item,
>>> > -       errcatch_check_item,
>>> > -
>>> > -       errcatch_create_vi,
>>> > -       errcatch_check_left,
>>> > -       errcatch_check_right,
>>> > -       errcatch_part_size,
>>> > -       errcatch_unit_num,
>>> > -       errcatch_print_vi
>>> > +       .bytes_number = errcatch_bytes_number,
>>> > +       .decrement_key = errcatch_decrement_key,
>>> > +       .is_left_mergeable = errcatch_is_left_mergeable,
>>> > +       .print_item = errcatch_print_item,
>>> > +       .check_item = errcatch_check_item,
>>> > +
>>> > +       .create_vi = errcatch_create_vi,
>>> > +       .check_left = errcatch_check_left,
>>> > +       .check_right = errcatch_check_right,
>>> > +       .part_size = errcatch_part_size,
>>> > +       .unit_num = errcatch_unit_num,
>>> > +       .print_vi = errcatch_print_vi
>>> >  };
>>> >
>>> >  #if ! (TYPE_STAT_DATA == 0 && TYPE_INDIRECT == 1 && TYPE_DIRECT == 2 && TYPE_DIRENTRY == 3)
>>> > diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
>>> > index 14d7b83..a1edf56 100644
>>> > --- a/include/linux/rbtree_augmented.h
>>> > +++ b/include/linux/rbtree_augmented.h
>>> > @@ -90,7 +90,9 @@ rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new)     \
>>> >         old->rbaugmented = rbcompute(old);                              \
>>> >  }                                                                      \
>>> >  rbstatic const struct rb_augment_callbacks rbname = {                  \
>>> > -       rbname ## _propagate, rbname ## _copy, rbname ## _rotate        \
>>> > +       .propagate = rbname ## _propagate,                              \
>>> > +       .copy = rbname ## _copy,                                        \
>>> > +       .rotate = rbname ## _rotate                                     \
>>> >  };
>>> >
>>> >
>>> > diff --git a/lib/rbtree.c b/lib/rbtree.c
>>> > index 1356454..70ce6c6 100644
>>> > --- a/lib/rbtree.c
>>> > +++ b/lib/rbtree.c
>>> > @@ -412,7 +412,9 @@ static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {}
>>> >  static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {}
>>> >
>>> >  static const struct rb_augment_callbacks dummy_callbacks = {
>>> > -       dummy_propagate, dummy_copy, dummy_rotate
>>> > +       .propagate = dummy_propagate,
>>> > +       .copy = dummy_copy,
>>> > +       .rotate = dummy_rotate
>>> >  };
>>> >
>>> >  void rb_insert_color(struct rb_node *node, struct rb_root *root)
>>> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>>> > index 838ca8bb..7432a90 100644
>>> > --- a/mm/page_alloc.c
>>> > +++ b/mm/page_alloc.c
>>> > @@ -561,7 +561,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page,
>>> >                 __mod_zone_freepage_state(zone, (1 << order), migratetype);
>>> >  }
>>> >  #else
>>> > -struct page_ext_operations debug_guardpage_ops = { NULL, };
>>> > +struct page_ext_operations debug_guardpage_ops = { .need = NULL, .init = NULL };
>>> >  static inline void set_page_guard(struct zone *zone, struct page *page,
>>> >                                 unsigned int order, int migratetype) {}
>>> >  static inline void clear_page_guard(struct zone *zone, struct page *page,
>>> > diff --git a/net/atm/lec.c b/net/atm/lec.c
>>> > index cd3b379..977a3c9 100644
>>> > --- a/net/atm/lec.c
>>> > +++ b/net/atm/lec.c
>>> > @@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
>>> >  }
>>> >
>>> >  static struct lane2_ops lane2_ops = {
>>> > -       lane2_resolve,          /* resolve,             spec 3.1.3 */
>>> > -       lane2_associate_req,    /* associate_req,       spec 3.1.4 */
>>> > -       NULL                    /* associate indicator, spec 3.1.5 */
>>> > +       .resolve = lane2_resolve,
>>> > +       .associate_req = lane2_associate_req,
>>> > +       .associate_indicator = NULL
>>> >  };
>>> >
>>> >  static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
>>> > diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
>>> > index 9e60e74..637c96e 100644
>>> > --- a/net/atm/mpoa_caches.c
>>> > +++ b/net/atm/mpoa_caches.c
>>> > @@ -535,30 +535,29 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
>>> >
>>> >
>>> >  static const struct in_cache_ops ingress_ops = {
>>> > -       in_cache_add_entry,               /* add_entry       */
>>> > -       in_cache_get,                     /* get             */
>>> > -       in_cache_get_with_mask,           /* get_with_mask   */
>>> > -       in_cache_get_by_vcc,              /* get_by_vcc      */
>>> > -       in_cache_put,                     /* put             */
>>> > -       in_cache_remove_entry,            /* remove_entry    */
>>> > -       cache_hit,                        /* cache_hit       */
>>> > -       clear_count_and_expired,          /* clear_count     */
>>> > -       check_resolving_entries,          /* check_resolving */
>>> > -       refresh_entries,                  /* refresh         */
>>> > -       in_destroy_cache                  /* destroy_cache   */
>>> > +       .add_entry = in_cache_add_entry,
>>> > +       .get = in_cache_get,
>>> > +       .get_with_mask = in_cache_get_with_mask,
>>> > +       .get_by_vcc = in_cache_get_by_vcc,
>>> > +       .put = in_cache_put,
>>> > +       .remove_entry = in_cache_remove_entry,
>>> > +       .cache_hit = cache_hit,
>>> > +       .clear_count = clear_count_and_expired,
>>> > +       .check_resolving = check_resolving_entries,
>>> > +       .refresh = refresh_entries,
>>> >  };
>>> >
>>> >  static const struct eg_cache_ops egress_ops = {
>>> > -       eg_cache_add_entry,               /* add_entry        */
>>> > -       eg_cache_get_by_cache_id,         /* get_by_cache_id  */
>>> > -       eg_cache_get_by_tag,              /* get_by_tag       */
>>> > -       eg_cache_get_by_vcc,              /* get_by_vcc       */
>>> > -       eg_cache_get_by_src_ip,           /* get_by_src_ip    */
>>> > -       eg_cache_put,                     /* put              */
>>> > -       eg_cache_remove_entry,            /* remove_entry     */
>>> > -       update_eg_cache_entry,            /* update           */
>>> > -       clear_expired,                    /* clear_expired    */
>>> > -       eg_destroy_cache                  /* destroy_cache    */
>>> > +       .add_entry = eg_cache_add_entry,
>>> > +       .get_by_cache_id = eg_cache_get_by_cache_id,
>>> > +       .get_by_tag = eg_cache_get_by_tag,
>>> > +       .get_by_vcc = eg_cache_get_by_vcc,
>>> > +       .get_by_src_ip = eg_cache_get_by_src_ip,
>>> > +       .put = eg_cache_put,
>>> > +       .remove_entry = eg_cache_remove_entry,
>>> > +       .update = update_eg_cache_entry,
>>> > +       .clear_expired = clear_expired,
>>> > +       .destroy_cache = eg_destroy_cache
>>> >  };
>>> >
>>> >
>>> > diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
>>> > index fd8cf02..1406db4 100644
>>> > --- a/net/vmw_vsock/vmci_transport_notify.c
>>> > +++ b/net/vmw_vsock/vmci_transport_notify.c
>>> > @@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
>>> >
>>> >  /* Socket control packet based operations. */
>>> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
>>> > -       vmci_transport_notify_pkt_socket_init,
>>> > -       vmci_transport_notify_pkt_socket_destruct,
>>> > -       vmci_transport_notify_pkt_poll_in,
>>> > -       vmci_transport_notify_pkt_poll_out,
>>> > -       vmci_transport_notify_pkt_handle_pkt,
>>> > -       vmci_transport_notify_pkt_recv_init,
>>> > -       vmci_transport_notify_pkt_recv_pre_block,
>>> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
>>> > -       vmci_transport_notify_pkt_recv_post_dequeue,
>>> > -       vmci_transport_notify_pkt_send_init,
>>> > -       vmci_transport_notify_pkt_send_pre_block,
>>> > -       vmci_transport_notify_pkt_send_pre_enqueue,
>>> > -       vmci_transport_notify_pkt_send_post_enqueue,
>>> > -       vmci_transport_notify_pkt_process_request,
>>> > -       vmci_transport_notify_pkt_process_negotiate,
>>> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
>>> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
>>> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
>>> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
>>> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
>>> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
>>> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
>>> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
>>> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
>>> > +       .send_init = vmci_transport_notify_pkt_send_init,
>>> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
>>> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
>>> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
>>> > +       .process_request = vmci_transport_notify_pkt_process_request,
>>> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
>>> >  };
>>> > diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
>>> > index 21e591d..f3a0afc 100644
>>> > --- a/net/vmw_vsock/vmci_transport_notify_qstate.c
>>> > +++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
>>> > @@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue(
>>> >
>>> >  /* Socket always on control packet based operations. */
>>> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
>>> > -       vmci_transport_notify_pkt_socket_init,
>>> > -       vmci_transport_notify_pkt_socket_destruct,
>>> > -       vmci_transport_notify_pkt_poll_in,
>>> > -       vmci_transport_notify_pkt_poll_out,
>>> > -       vmci_transport_notify_pkt_handle_pkt,
>>> > -       vmci_transport_notify_pkt_recv_init,
>>> > -       vmci_transport_notify_pkt_recv_pre_block,
>>> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
>>> > -       vmci_transport_notify_pkt_recv_post_dequeue,
>>> > -       vmci_transport_notify_pkt_send_init,
>>> > -       vmci_transport_notify_pkt_send_pre_block,
>>> > -       vmci_transport_notify_pkt_send_pre_enqueue,
>>> > -       vmci_transport_notify_pkt_send_post_enqueue,
>>> > -       vmci_transport_notify_pkt_process_request,
>>> > -       vmci_transport_notify_pkt_process_negotiate,
>>> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
>>> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
>>> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
>>> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
>>> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
>>> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
>>> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
>>> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
>>> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
>>> > +       .send_init = vmci_transport_notify_pkt_send_init,
>>> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
>>> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
>>> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
>>> > +       .process_request = vmci_transport_notify_pkt_process_request,
>>> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
>>> >  };
>>> > diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
>>> > index a020920..55579f6 100644
>>> > --- a/sound/synth/emux/emux_seq.c
>>> > +++ b/sound/synth/emux/emux_seq.c
>>> > @@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
>>> >   * MIDI emulation operators
>>> >   */
>>> >  static struct snd_midi_op emux_ops = {
>>> > -       snd_emux_note_on,
>>> > -       snd_emux_note_off,
>>> > -       snd_emux_key_press,
>>> > -       snd_emux_terminate_note,
>>> > -       snd_emux_control,
>>> > -       snd_emux_nrpn,
>>> > -       snd_emux_sysex,
>>> > +       .note_on = snd_emux_note_on,
>>> > +       .note_off = snd_emux_note_off,
>>> > +       .key_press = snd_emux_key_press,
>>> > +       .note_terminate = snd_emux_terminate_note,
>>> > +       .control = snd_emux_control,
>>> > +       .nrpn = snd_emux_nrpn,
>>> > +       .sysex = snd_emux_sysex,
>>> >  };
>>> >
>>> >
>>> > --
>>> > 1.9.1
>>> >
>>>
>>>
>>>
>>> --
>>> Kees Cook
>>> Chrome OS & Brillo Security
>>>
>
>
>
> --
> Kees Cook
> Chrome OS & Brillo Security



-- 
Michael Leibowitz

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

* [kernel-hardening] Re: [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs
  2016-06-13 20:26           ` Kees Cook
@ 2016-06-13 20:30             ` Julia Lawall
  2016-06-13 20:34               ` Kees Cook
  0 siblings, 1 reply; 21+ messages in thread
From: Julia Lawall @ 2016-06-13 20:30 UTC (permalink / raw)
  To: Kees Cook
  Cc: Michael Leibowitz, Brad Spengler, kernel-hardening, Emese Revfy,
	PaX Team



On Mon, 13 Jun 2016, Kees Cook wrote:

> On Mon, Jun 13, 2016 at 12:57 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> > On Mon, 13 Jun 2016, Kees Cook wrote:
> >
> >> On Mon, Jun 13, 2016 at 7:32 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >> > On Thu, 5 May 2016, Kees Cook wrote:
> >> >
> >> >> On Thu, May 5, 2016 at 10:21 AM, Michael Leibowitz
> >> >> <michael.leibowitz@intel.com> wrote:
> >> >> > Due to randomization of structs, the in order struct intialization
> >> >> > style is replaced with explicit field style.
> >> >> >
> >> >> > struct foo_t my_foo = {
> >> >> >        one,
> >> >> >        two,
> >> >> >        three
> >> >> > };
> >> >> >
> >> >> > becomes
> >> >> >
> >> >> > struct foo_t my_foo = {
> >> >> >        .one = one,
> >> >> >        .two = two,
> >> >> >        .three = three
> >> >> > };
> >> >>
> >> >> Can a coccinelle script be written to do this also? It might be useful
> >> >> to keep that around.
> >> >
> >> > Is this needed for all kinds of structure initializations, ie for both
> >> > local and global variables, or only for global variables?
> >>
> >> It's needed for any structure that has been globally defined. As in,
> >> any use of a struct must be using C99 since that structure may be
> >> randomized (in any context: global, local).
> >
> > I'm not sure to understand what it means for a structure to be globally
> > defined.  If the code is:
> >
> > int f(...) {
> >   struct foo x = { 3, 4, 5, };
> >   ...
> > }
> >
> > is it correct that it does not need to use C99?
> 
> As I understand it, your example will need to use C99 initialization.

So it's as long as the type definition is global?

julia

> 
> -Kees
> 
> >
> > thanks,
> > julia
> >
> >> Michael, what's the state of this series? What're your next steps?
> >>
> >> -Kees
> >>
> >> >
> >> > thanks,
> >> > julia
> >> >
> >> >>
> >> >> >
> >> >> > Additionally, tag paravirt related structures to explicitly not be
> >> >> > randomized, as the structure layout is important.
> >> >>
> >> >> This might need to be split out? It's logically separate. Also, I
> >> >> think this needs to come before the plugin, since the plugin isn't
> >> >> usable until this patch is in place.
> >> >>
> >> >> -Kees
> >> >>
> >> >> >
> >> >> > This feature is ported over from grsecurity.  This is largely
> >> >> > unchanged from the Original code written by the PaX Team and Spender.
> >> >> >
> >> >> > Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
> >> >> > ---
> >> >> >  arch/x86/include/asm/floppy.h                   | 20 ++---
> >> >> >  arch/x86/include/asm/paravirt_types.h           | 18 +++--
> >> >> >  drivers/acpi/acpica/hwxfsleep.c                 | 11 +--
> >> >> >  drivers/block/cciss.h                           | 30 ++++----
> >> >> >  drivers/gpu/drm/nouveau/nouveau_ttm.c           | 28 +++----
> >> >> >  drivers/gpu/drm/ttm/ttm_bo_manager.c            | 10 +--
> >> >> >  drivers/gpu/drm/virtio/virtgpu_ttm.c            | 10 +--
> >> >> >  drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   | 10 +--
> >> >> >  drivers/infiniband/hw/nes/nes_cm.c              | 22 +++---
> >> >> >  drivers/isdn/gigaset/bas-gigaset.c              | 32 ++++----
> >> >> >  drivers/isdn/gigaset/ser-gigaset.c              | 32 ++++----
> >> >> >  drivers/isdn/gigaset/usb-gigaset.c              | 32 ++++----
> >> >> >  drivers/isdn/i4l/isdn_concap.c                  |  6 +-
> >> >> >  drivers/isdn/i4l/isdn_x25iface.c                | 16 ++--
> >> >> >  drivers/media/pci/solo6x10/solo6x10-g723.c      |  2 +-
> >> >> >  drivers/net/ethernet/brocade/bna/bna_enet.c     |  8 +-
> >> >> >  drivers/net/wan/lmc/lmc_media.c                 | 97 +++++++++++++------------
> >> >> >  drivers/scsi/bfa/bfa_fcs.c                      | 19 ++++-
> >> >> >  drivers/scsi/bfa/bfa_fcs_lport.c                | 29 +++++---
> >> >> >  drivers/scsi/bfa/bfa_modules.h                  | 12 +--
> >> >> >  drivers/scsi/hpsa.h                             | 40 +++++-----
> >> >> >  drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |  2 +-
> >> >> >  drivers/staging/lustre/lustre/libcfs/module.c   | 10 +--
> >> >> >  drivers/video/fbdev/matrox/matroxfb_DAC1064.c   | 10 ++-
> >> >> >  drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |  5 +-
> >> >> >  fs/reiserfs/item_ops.c                          | 24 +++---
> >> >> >  include/linux/rbtree_augmented.h                |  4 +-
> >> >> >  lib/rbtree.c                                    |  4 +-
> >> >> >  mm/page_alloc.c                                 |  2 +-
> >> >> >  net/atm/lec.c                                   |  6 +-
> >> >> >  net/atm/mpoa_caches.c                           | 41 +++++------
> >> >> >  net/vmw_vsock/vmci_transport_notify.c           | 30 ++++----
> >> >> >  net/vmw_vsock/vmci_transport_notify_qstate.c    | 30 ++++----
> >> >> >  sound/synth/emux/emux_seq.c                     | 14 ++--
> >> >> >  34 files changed, 352 insertions(+), 314 deletions(-)
> >> >> >
> >> >> > diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
> >> >> > index 1c7eefe..d0e4702 100644
> >> >> > --- a/arch/x86/include/asm/floppy.h
> >> >> > +++ b/arch/x86/include/asm/floppy.h
> >> >> > @@ -229,18 +229,18 @@ static struct fd_routine_l {
> >> >> >         int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
> >> >> >  } fd_routine[] = {
> >> >> >         {
> >> >> > -               request_dma,
> >> >> > -               free_dma,
> >> >> > -               get_dma_residue,
> >> >> > -               dma_mem_alloc,
> >> >> > -               hard_dma_setup
> >> >> > +               ._request_dma = request_dma,
> >> >> > +               ._free_dma = free_dma,
> >> >> > +               ._get_dma_residue = get_dma_residue,
> >> >> > +               ._dma_mem_alloc = dma_mem_alloc,
> >> >> > +               ._dma_setup = hard_dma_setup
> >> >> >         },
> >> >> >         {
> >> >> > -               vdma_request_dma,
> >> >> > -               vdma_nop,
> >> >> > -               vdma_get_dma_residue,
> >> >> > -               vdma_mem_alloc,
> >> >> > -               vdma_dma_setup
> >> >> > +               ._request_dma = vdma_request_dma,
> >> >> > +               ._free_dma = vdma_nop,
> >> >> > +               ._get_dma_residue = vdma_get_dma_residue,
> >> >> > +               ._dma_mem_alloc = vdma_mem_alloc,
> >> >> > +               ._dma_setup = vdma_dma_setup
> >> >> >         }
> >> >> >  };
> >> >> >
> >> >> > diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
> >> >> > index 77db561..927c396 100644
> >> >> > --- a/arch/x86/include/asm/paravirt_types.h
> >> >> > +++ b/arch/x86/include/asm/paravirt_types.h
> >> >> > @@ -89,7 +89,7 @@ struct pv_init_ops {
> >> >> >          */
> >> >> >         unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
> >> >> >                           unsigned long addr, unsigned len);
> >> >> > -};
> >> >> > +} __no_randomize_layout;
> >> >> >
> >> >> >
> >> >> >  struct pv_lazy_ops {
> >> >> > @@ -97,12 +97,12 @@ struct pv_lazy_ops {
> >> >> >         void (*enter)(void);
> >> >> >         void (*leave)(void);
> >> >> >         void (*flush)(void);
> >> >> > -};
> >> >> > +} __no_randomize_layout;
> >> >> >
> >> >> >  struct pv_time_ops {
> >> >> >         unsigned long long (*sched_clock)(void);
> >> >> >         unsigned long long (*steal_clock)(int cpu);
> >> >> > -};
> >> >> > +} __no_randomize_layout;
> >> >> >
> >> >> >  struct pv_cpu_ops {
> >> >> >         /* hooks for various privileged instructions */
> >> >> > @@ -178,7 +178,7 @@ struct pv_cpu_ops {
> >> >> >
> >> >> >         void (*start_context_switch)(struct task_struct *prev);
> >> >> >         void (*end_context_switch)(struct task_struct *next);
> >> >> > -};
> >> >> > +} __no_randomize_layout;
> >> >> >
> >> >> >  struct pv_irq_ops {
> >> >> >         /*
> >> >> > @@ -201,7 +201,7 @@ struct pv_irq_ops {
> >> >> >  #ifdef CONFIG_X86_64
> >> >> >         void (*adjust_exception_frame)(void);
> >> >> >  #endif
> >> >> > -};
> >> >> > +} __no_randomize_layout;
> >> >> >
> >> >> >  struct pv_mmu_ops {
> >> >> >         unsigned long (*read_cr2)(void);
> >> >> > @@ -296,7 +296,7 @@ struct pv_mmu_ops {
> >> >> >            an mfn.  We can tell which is which from the index. */
> >> >> >         void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
> >> >> >                            phys_addr_t phys, pgprot_t flags);
> >> >> > -};
> >> >> > +} __no_randomize_layout;
> >> >> >
> >> >> >  struct arch_spinlock;
> >> >> >  #ifdef CONFIG_SMP
> >> >> > @@ -322,7 +322,9 @@ struct pv_lock_ops {
> >> >> >
> >> >> >  /* This contains all the paravirt structures: we get a convenient
> >> >> >   * number for each function using the offset which we use to indicate
> >> >> > - * what to patch. */
> >> >> > + * what to patch.
> >> >> > + * shouldn't be randomized due to the "NEAT TRICK" in paravirt.c
> >> >> > + */
> >> >> >  struct paravirt_patch_template {
> >> >> >         struct pv_init_ops pv_init_ops;
> >> >> >         struct pv_time_ops pv_time_ops;
> >> >> > @@ -330,7 +332,7 @@ struct paravirt_patch_template {
> >> >> >         struct pv_irq_ops pv_irq_ops;
> >> >> >         struct pv_mmu_ops pv_mmu_ops;
> >> >> >         struct pv_lock_ops pv_lock_ops;
> >> >> > -};
> >> >> > +} __no_randomize_layout;
> >> >> >
> >> >> >  extern struct pv_info pv_info;
> >> >> >  extern struct pv_init_ops pv_init_ops;
> >> >> > diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
> >> >> > index f76e0ea..4b83315 100644
> >> >> > --- a/drivers/acpi/acpica/hwxfsleep.c
> >> >> > +++ b/drivers/acpi/acpica/hwxfsleep.c
> >> >> > @@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
> >> >> >  /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
> >> >> >
> >> >> >  static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
> >> >> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
> >> >> > -        acpi_hw_extended_sleep},
> >> >> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
> >> >> > -        acpi_hw_extended_wake_prep},
> >> >> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake}
> >> >> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
> >> >> > +        .extended_function = acpi_hw_extended_sleep},
> >> >> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
> >> >> > +        .extended_function = acpi_hw_extended_wake_prep},
> >> >> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake),
> >> >> > +        .extended_function = acpi_hw_extended_wake}
> >> >> >  };
> >> >> >
> >> >> >  /*
> >> >> > diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
> >> >> > index 7fda30e..428766d 100644
> >> >> > --- a/drivers/block/cciss.h
> >> >> > +++ b/drivers/block/cciss.h
> >> >> > @@ -402,27 +402,27 @@ static bool SA5_performant_intr_pending(ctlr_info_t *h)
> >> >> >  }
> >> >> >
> >> >> >  static struct access_method SA5_access = {
> >> >> > -       SA5_submit_command,
> >> >> > -       SA5_intr_mask,
> >> >> > -       SA5_fifo_full,
> >> >> > -       SA5_intr_pending,
> >> >> > -       SA5_completed,
> >> >> > +       .submit_command = SA5_submit_command,
> >> >> > +       .set_intr_mask = SA5_intr_mask,
> >> >> > +       .fifo_full = SA5_fifo_full,
> >> >> > +       .intr_pending = SA5_intr_pending,
> >> >> > +       .command_completed = SA5_completed,
> >> >> >  };
> >> >> >
> >> >> >  static struct access_method SA5B_access = {
> >> >> > -        SA5_submit_command,
> >> >> > -        SA5B_intr_mask,
> >> >> > -        SA5_fifo_full,
> >> >> > -        SA5B_intr_pending,
> >> >> > -        SA5_completed,
> >> >> > +       .submit_command = SA5_submit_command,
> >> >> > +       .set_intr_mask = SA5B_intr_mask,
> >> >> > +       .fifo_full = SA5_fifo_full,
> >> >> > +       .intr_pending = SA5B_intr_pending,
> >> >> > +       .command_completed = SA5_completed,
> >> >> >  };
> >> >> >
> >> >> >  static struct access_method SA5_performant_access = {
> >> >> > -       SA5_submit_command,
> >> >> > -       SA5_performant_intr_mask,
> >> >> > -       SA5_fifo_full,
> >> >> > -       SA5_performant_intr_pending,
> >> >> > -       SA5_performant_completed,
> >> >> > +       .submit_command = SA5_submit_command,
> >> >> > +       .set_intr_mask = SA5_performant_intr_mask,
> >> >> > +       .fifo_full = SA5_fifo_full,
> >> >> > +       .intr_pending = SA5_performant_intr_pending,
> >> >> > +       .command_completed = SA5_performant_completed,
> >> >> >  };
> >> >> >
> >> >> >  struct board_type {
> >> >> > diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> >> >> > index d2e7d20..7bbe51f 100644
> >> >> > --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> >> >> > +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> >> >> > @@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
> >> >> >  }
> >> >> >
> >> >> >  const struct ttm_mem_type_manager_func nouveau_vram_manager = {
> >> >> > -       nouveau_vram_manager_init,
> >> >> > -       nouveau_vram_manager_fini,
> >> >> > -       nouveau_vram_manager_new,
> >> >> > -       nouveau_vram_manager_del,
> >> >> > +       .init = nouveau_vram_manager_init,
> >> >> > +       .takedown = nouveau_vram_manager_fini,
> >> >> > +       .get_node = nouveau_vram_manager_new,
> >> >> > +       .put_node = nouveau_vram_manager_del,
> >> >> >  };
> >> >> >
> >> >> >  static int
> >> >> > @@ -183,11 +183,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
> >> >> >  }
> >> >> >
> >> >> >  const struct ttm_mem_type_manager_func nouveau_gart_manager = {
> >> >> > -       nouveau_gart_manager_init,
> >> >> > -       nouveau_gart_manager_fini,
> >> >> > -       nouveau_gart_manager_new,
> >> >> > -       nouveau_gart_manager_del,
> >> >> > -       nouveau_gart_manager_debug
> >> >> > +       .init = nouveau_gart_manager_init,
> >> >> > +       .takedown = nouveau_gart_manager_fini,
> >> >> > +       .get_node = nouveau_gart_manager_new,
> >> >> > +       .put_node = nouveau_gart_manager_del,
> >> >> > +       .debug = nouveau_gart_manager_debug
> >> >> >  };
> >> >> >
> >> >> >  /*XXX*/
> >> >> > @@ -256,11 +256,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
> >> >> >  }
> >> >> >
> >> >> >  const struct ttm_mem_type_manager_func nv04_gart_manager = {
> >> >> > -       nv04_gart_manager_init,
> >> >> > -       nv04_gart_manager_fini,
> >> >> > -       nv04_gart_manager_new,
> >> >> > -       nv04_gart_manager_del,
> >> >> > -       nv04_gart_manager_debug
> >> >> > +       .init = nv04_gart_manager_init,
> >> >> > +       .takedown = nv04_gart_manager_fini,
> >> >> > +       .get_node = nv04_gart_manager_new,
> >> >> > +       .put_node = nv04_gart_manager_del,
> >> >> > +       .debug = nv04_gart_manager_debug
> >> >> >  };
> >> >> >
> >> >> >  int
> >> >> > diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
> >> >> > index aa0bd05..aea6a01 100644
> >> >> > --- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
> >> >> > +++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
> >> >> > @@ -148,10 +148,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
> >> >> >  }
> >> >> >
> >> >> >  const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
> >> >> > -       ttm_bo_man_init,
> >> >> > -       ttm_bo_man_takedown,
> >> >> > -       ttm_bo_man_get_node,
> >> >> > -       ttm_bo_man_put_node,
> >> >> > -       ttm_bo_man_debug
> >> >> > +       .init = ttm_bo_man_init,
> >> >> > +       .takedown = ttm_bo_man_takedown,
> >> >> > +       .get_node = ttm_bo_man_get_node,
> >> >> > +       .put_node = ttm_bo_man_put_node,
> >> >> > +       .debug = ttm_bo_man_debug
> >> >> >  };
> >> >> >  EXPORT_SYMBOL(ttm_bo_manager_func);
> >> >> > diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
> >> >> > index 9fd924c..e5ec4ef 100644
> >> >> > --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
> >> >> > +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
> >> >> > @@ -198,11 +198,11 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
> >> >> >  }
> >> >> >
> >> >> >  static const struct ttm_mem_type_manager_func virtio_gpu_bo_manager_func = {
> >> >> > -       ttm_bo_man_init,
> >> >> > -       ttm_bo_man_takedown,
> >> >> > -       ttm_bo_man_get_node,
> >> >> > -       ttm_bo_man_put_node,
> >> >> > -       ttm_bo_man_debug
> >> >> > +       .init = ttm_bo_man_init,
> >> >> > +       .takedown = ttm_bo_man_takedown,
> >> >> > +       .get_node = ttm_bo_man_get_node,
> >> >> > +       .put_node = ttm_bo_man_put_node,
> >> >> > +       .debug = ttm_bo_man_debug
> >> >> >  };
> >> >> >
> >> >> >  static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
> >> >> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> >> >> > index 170b61b..fec7348 100644
> >> >> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> >> >> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> >> >> > @@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
> >> >> >  }
> >> >> >
> >> >> >  const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
> >> >> > -       vmw_gmrid_man_init,
> >> >> > -       vmw_gmrid_man_takedown,
> >> >> > -       vmw_gmrid_man_get_node,
> >> >> > -       vmw_gmrid_man_put_node,
> >> >> > -       vmw_gmrid_man_debug
> >> >> > +       .init = vmw_gmrid_man_init,
> >> >> > +       .takedown = vmw_gmrid_man_takedown,
> >> >> > +       .get_node = vmw_gmrid_man_get_node,
> >> >> > +       .put_node = vmw_gmrid_man_put_node,
> >> >> > +       .debug = vmw_gmrid_man_debug
> >> >> >  };
> >> >> > diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
> >> >> > index cb9f0f2..8b1f654 100644
> >> >> > --- a/drivers/infiniband/hw/nes/nes_cm.c
> >> >> > +++ b/drivers/infiniband/hw/nes/nes_cm.c
> >> >> > @@ -135,17 +135,17 @@ static void record_ird_ord(struct nes_cm_node *, u16, u16);
> >> >> >  /* instance of function pointers for client API */
> >> >> >  /* set address of this instance to cm_core->cm_ops at cm_core alloc */
> >> >> >  static const struct nes_cm_ops nes_cm_api = {
> >> >> > -       mini_cm_accelerated,
> >> >> > -       mini_cm_listen,
> >> >> > -       mini_cm_del_listen,
> >> >> > -       mini_cm_connect,
> >> >> > -       mini_cm_close,
> >> >> > -       mini_cm_accept,
> >> >> > -       mini_cm_reject,
> >> >> > -       mini_cm_recv_pkt,
> >> >> > -       mini_cm_dealloc_core,
> >> >> > -       mini_cm_get,
> >> >> > -       mini_cm_set
> >> >> > +       .accelerated = mini_cm_accelerated,
> >> >> > +       .listen = mini_cm_listen,
> >> >> > +       .stop_listener = mini_cm_del_listen,
> >> >> > +       .connect = mini_cm_connect,
> >> >> > +       .close = mini_cm_close,
> >> >> > +       .accept = mini_cm_accept,
> >> >> > +       .reject = mini_cm_reject,
> >> >> > +       .recv_pkt = mini_cm_recv_pkt,
> >> >> > +       .destroy_cm_core = mini_cm_dealloc_core,
> >> >> > +       .get = mini_cm_get,
> >> >> > +       .set = mini_cm_set
> >> >> >  };
> >> >> >
> >> >> >  static struct nes_cm_core *g_cm_core;
> >> >> > diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
> >> >> > index aecec6d..11e13c5 100644
> >> >> > --- a/drivers/isdn/gigaset/bas-gigaset.c
> >> >> > +++ b/drivers/isdn/gigaset/bas-gigaset.c
> >> >> > @@ -2565,22 +2565,22 @@ static int gigaset_post_reset(struct usb_interface *intf)
> >> >> >
> >> >> >
> >> >> >  static const struct gigaset_ops gigops = {
> >> >> > -       gigaset_write_cmd,
> >> >> > -       gigaset_write_room,
> >> >> > -       gigaset_chars_in_buffer,
> >> >> > -       gigaset_brkchars,
> >> >> > -       gigaset_init_bchannel,
> >> >> > -       gigaset_close_bchannel,
> >> >> > -       gigaset_initbcshw,
> >> >> > -       gigaset_freebcshw,
> >> >> > -       gigaset_reinitbcshw,
> >> >> > -       gigaset_initcshw,
> >> >> > -       gigaset_freecshw,
> >> >> > -       gigaset_set_modem_ctrl,
> >> >> > -       gigaset_baud_rate,
> >> >> > -       gigaset_set_line_ctrl,
> >> >> > -       gigaset_isoc_send_skb,
> >> >> > -       gigaset_isoc_input,
> >> >> > +       .write_cmd = gigaset_write_cmd,
> >> >> > +       .write_room = gigaset_write_room,
> >> >> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> >> >> > +       .brkchars = gigaset_brkchars,
> >> >> > +       .init_bchannel = gigaset_init_bchannel,
> >> >> > +       .close_bchannel = gigaset_close_bchannel,
> >> >> > +       .initbcshw = gigaset_initbcshw,
> >> >> > +       .freebcshw = gigaset_freebcshw,
> >> >> > +       .reinitbcshw = gigaset_reinitbcshw,
> >> >> > +       .initcshw = gigaset_initcshw,
> >> >> > +       .freecshw = gigaset_freecshw,
> >> >> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> >> >> > +       .baud_rate = gigaset_baud_rate,
> >> >> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> >> >> > +       .send_skb = gigaset_isoc_send_skb,
> >> >> > +       .handle_input = gigaset_isoc_input,
> >> >> >  };
> >> >> >
> >> >> >  /* bas_gigaset_init
> >> >> > diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
> >> >> > index d1f8ab9..c0412f2 100644
> >> >> > --- a/drivers/isdn/gigaset/ser-gigaset.c
> >> >> > +++ b/drivers/isdn/gigaset/ser-gigaset.c
> >> >> > @@ -445,22 +445,22 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
> >> >> >  }
> >> >> >
> >> >> >  static const struct gigaset_ops ops = {
> >> >> > -       gigaset_write_cmd,
> >> >> > -       gigaset_write_room,
> >> >> > -       gigaset_chars_in_buffer,
> >> >> > -       gigaset_brkchars,
> >> >> > -       gigaset_init_bchannel,
> >> >> > -       gigaset_close_bchannel,
> >> >> > -       gigaset_initbcshw,
> >> >> > -       gigaset_freebcshw,
> >> >> > -       gigaset_reinitbcshw,
> >> >> > -       gigaset_initcshw,
> >> >> > -       gigaset_freecshw,
> >> >> > -       gigaset_set_modem_ctrl,
> >> >> > -       gigaset_baud_rate,
> >> >> > -       gigaset_set_line_ctrl,
> >> >> > -       gigaset_m10x_send_skb,  /* asyncdata.c */
> >> >> > -       gigaset_m10x_input,     /* asyncdata.c */
> >> >> > +       .write_cmd = gigaset_write_cmd,
> >> >> > +       .write_room = gigaset_write_room,
> >> >> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> >> >> > +       .brkchars = gigaset_brkchars,
> >> >> > +       .init_bchannel = gigaset_init_bchannel,
> >> >> > +       .close_bchannel = gigaset_close_bchannel,
> >> >> > +       .initbcshw = gigaset_initbcshw,
> >> >> > +       .freebcshw = gigaset_freebcshw,
> >> >> > +       .reinitbcshw = gigaset_reinitbcshw,
> >> >> > +       .initcshw = gigaset_initcshw,
> >> >> > +       .freecshw = gigaset_freecshw,
> >> >> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> >> >> > +       .baud_rate = gigaset_baud_rate,
> >> >> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> >> >> > +       .send_skb = gigaset_m10x_send_skb,      /* asyncdata.c */
> >> >> > +       .handle_input = gigaset_m10x_input,     /* asyncdata.c */
> >> >> >  };
> >> >> >
> >> >> >
> >> >> > diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
> >> >> > index 5f306e2..eade36d 100644
> >> >> > --- a/drivers/isdn/gigaset/usb-gigaset.c
> >> >> > +++ b/drivers/isdn/gigaset/usb-gigaset.c
> >> >> > @@ -862,22 +862,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
> >> >> >  }
> >> >> >
> >> >> >  static const struct gigaset_ops ops = {
> >> >> > -       gigaset_write_cmd,
> >> >> > -       gigaset_write_room,
> >> >> > -       gigaset_chars_in_buffer,
> >> >> > -       gigaset_brkchars,
> >> >> > -       gigaset_init_bchannel,
> >> >> > -       gigaset_close_bchannel,
> >> >> > -       gigaset_initbcshw,
> >> >> > -       gigaset_freebcshw,
> >> >> > -       gigaset_reinitbcshw,
> >> >> > -       gigaset_initcshw,
> >> >> > -       gigaset_freecshw,
> >> >> > -       gigaset_set_modem_ctrl,
> >> >> > -       gigaset_baud_rate,
> >> >> > -       gigaset_set_line_ctrl,
> >> >> > -       gigaset_m10x_send_skb,
> >> >> > -       gigaset_m10x_input,
> >> >> > +       .write_cmd = gigaset_write_cmd,
> >> >> > +       .write_room = gigaset_write_room,
> >> >> > +       .chars_in_buffer = gigaset_chars_in_buffer,
> >> >> > +       .brkchars = gigaset_brkchars,
> >> >> > +       .init_bchannel = gigaset_init_bchannel,
> >> >> > +       .close_bchannel = gigaset_close_bchannel,
> >> >> > +       .initbcshw = gigaset_initbcshw,
> >> >> > +       .freebcshw = gigaset_freebcshw,
> >> >> > +       .reinitbcshw = gigaset_reinitbcshw,
> >> >> > +       .initcshw = gigaset_initcshw,
> >> >> > +       .freecshw = gigaset_freecshw,
> >> >> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
> >> >> > +       .baud_rate = gigaset_baud_rate,
> >> >> > +       .set_line_ctrl = gigaset_set_line_ctrl,
> >> >> > +       .send_skb = gigaset_m10x_send_skb,
> >> >> > +       .handle_input = gigaset_m10x_input,
> >> >> >  };
> >> >> >
> >> >> >  /*
> >> >> > diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
> >> >> > index 91d5730..336523e 100644
> >> >> > --- a/drivers/isdn/i4l/isdn_concap.c
> >> >> > +++ b/drivers/isdn/i4l/isdn_concap.c
> >> >> > @@ -80,9 +80,9 @@ static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
> >> >> >  }
> >> >> >
> >> >> >  struct concap_device_ops isdn_concap_reliable_dl_dops = {
> >> >> > -       &isdn_concap_dl_data_req,
> >> >> > -       &isdn_concap_dl_connect_req,
> >> >> > -       &isdn_concap_dl_disconn_req
> >> >> > +       .data_req = &isdn_concap_dl_data_req,
> >> >> > +       .connect_req = &isdn_concap_dl_connect_req,
> >> >> > +       .disconn_req = &isdn_concap_dl_disconn_req
> >> >> >  };
> >> >> >
> >> >> >  /* The following should better go into a dedicated source file such that
> >> >> > diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
> >> >> > index e2d4e58..40cd045 100644
> >> >> > --- a/drivers/isdn/i4l/isdn_x25iface.c
> >> >> > +++ b/drivers/isdn/i4l/isdn_x25iface.c
> >> >> > @@ -53,14 +53,14 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *);
> >> >> >
> >> >> >
> >> >> >  static struct concap_proto_ops ix25_pops = {
> >> >> > -       &isdn_x25iface_proto_new,
> >> >> > -       &isdn_x25iface_proto_del,
> >> >> > -       &isdn_x25iface_proto_restart,
> >> >> > -       &isdn_x25iface_proto_close,
> >> >> > -       &isdn_x25iface_xmit,
> >> >> > -       &isdn_x25iface_receive,
> >> >> > -       &isdn_x25iface_connect_ind,
> >> >> > -       &isdn_x25iface_disconn_ind
> >> >> > +       .proto_new = &isdn_x25iface_proto_new,
> >> >> > +       .proto_del = &isdn_x25iface_proto_del,
> >> >> > +       .restart = &isdn_x25iface_proto_restart,
> >> >> > +       .close = &isdn_x25iface_proto_close,
> >> >> > +       .encap_and_xmit = &isdn_x25iface_xmit,
> >> >> > +       .data_ind = &isdn_x25iface_receive,
> >> >> > +       .connect_ind = &isdn_x25iface_connect_ind,
> >> >> > +       .disconn_ind = &isdn_x25iface_disconn_ind
> >> >> >  };
> >> >> >
> >> >> >  /* error message helper function */
> >> >> > diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
> >> >> > index 4a37a1c..7e82dfd 100644
> >> >> > --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
> >> >> > +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
> >> >> > @@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
> >> >> >
> >> >> >  int solo_g723_init(struct solo_dev *solo_dev)
> >> >> >  {
> >> >> > -       static struct snd_device_ops ops = { NULL };
> >> >> > +       static struct snd_device_ops ops = { };
> >> >> >         struct snd_card *card;
> >> >> >         struct snd_kcontrol_new kctl;
> >> >> >         char name[32];
> >> >> > diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c
> >> >> > index 4e5c387..bba8173 100644
> >> >> > --- a/drivers/net/ethernet/brocade/bna/bna_enet.c
> >> >> > +++ b/drivers/net/ethernet/brocade/bna/bna_enet.c
> >> >> > @@ -1676,10 +1676,10 @@ bna_cb_ioceth_reset(void *arg)
> >> >> >  }
> >> >> >
> >> >> >  static struct bfa_ioc_cbfn bna_ioceth_cbfn = {
> >> >> > -       bna_cb_ioceth_enable,
> >> >> > -       bna_cb_ioceth_disable,
> >> >> > -       bna_cb_ioceth_hbfail,
> >> >> > -       bna_cb_ioceth_reset
> >> >> > +       .enable_cbfn = bna_cb_ioceth_enable,
> >> >> > +       .disable_cbfn = bna_cb_ioceth_disable,
> >> >> > +       .hbfail_cbfn = bna_cb_ioceth_hbfail,
> >> >> > +       .reset_cbfn = bna_cb_ioceth_reset
> >> >> >  };
> >> >> >
> >> >> >  static void bna_attr_init(struct bna_ioceth *ioceth)
> >> >> > diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
> >> >> > index 5920c99..ff2e4a5 100644
> >> >> > --- a/drivers/net/wan/lmc/lmc_media.c
> >> >> > +++ b/drivers/net/wan/lmc/lmc_media.c
> >> >> > @@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int);
> >> >> >  static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
> >> >> >
> >> >> >  lmc_media_t lmc_ds3_media = {
> >> >> > -  lmc_ds3_init,                        /* special media init stuff */
> >> >> > -  lmc_ds3_default,             /* reset to default state */
> >> >> > -  lmc_ds3_set_status,          /* reset status to state provided */
> >> >> > -  lmc_dummy_set_1,             /* set clock source */
> >> >> > -  lmc_dummy_set2_1,            /* set line speed */
> >> >> > -  lmc_ds3_set_100ft,           /* set cable length */
> >> >> > -  lmc_ds3_set_scram,           /* set scrambler */
> >> >> > -  lmc_ds3_get_link_status,     /* get link status */
> >> >> > -  lmc_dummy_set_1,             /* set link status */
> >> >> > -  lmc_ds3_set_crc_length,      /* set CRC length */
> >> >> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> >> >> > -  lmc_ds3_watchdog
> >> >> > +  .init = lmc_ds3_init,                                /* special media init stuff */
> >> >> > +  .defaults = lmc_ds3_default,                 /* reset to default state */
> >> >> > +  .set_status = lmc_ds3_set_status,            /* reset status to state provided */
> >> >> > +  .set_clock_source = lmc_dummy_set_1,         /* set clock source */
> >> >> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> >> >> > +  .set_cable_length = lmc_ds3_set_100ft,       /* set cable length */
> >> >> > +  .set_scrambler = lmc_ds3_set_scram,          /* set scrambler */
> >> >> > +  .get_link_status = lmc_ds3_get_link_status,  /* get link status */
> >> >> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
> >> >> > +  .set_crc_length = lmc_ds3_set_crc_length,    /* set CRC length */
> >> >> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> >> >> > +  .watchdog = lmc_ds3_watchdog
> >> >> >  };
> >> >> >
> >> >> >  lmc_media_t lmc_hssi_media = {
> >> >> > -  lmc_hssi_init,               /* special media init stuff */
> >> >> > -  lmc_hssi_default,            /* reset to default state */
> >> >> > -  lmc_hssi_set_status,         /* reset status to state provided */
> >> >> > -  lmc_hssi_set_clock,          /* set clock source */
> >> >> > -  lmc_dummy_set2_1,            /* set line speed */
> >> >> > -  lmc_dummy_set_1,             /* set cable length */
> >> >> > -  lmc_dummy_set_1,             /* set scrambler */
> >> >> > -  lmc_hssi_get_link_status,    /* get link status */
> >> >> > -  lmc_hssi_set_link_status,    /* set link status */
> >> >> > -  lmc_hssi_set_crc_length,     /* set CRC length */
> >> >> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> >> >> > -  lmc_hssi_watchdog
> >> >> > +  .init = lmc_hssi_init,                       /* special media init stuff */
> >> >> > +  .defaults = lmc_hssi_default,                        /* reset to default state */
> >> >> > +  .set_status = lmc_hssi_set_status,           /* reset status to state provided */
> >> >> > +  .set_clock_source = lmc_hssi_set_clock,      /* set clock source */
> >> >> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> >> >> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> >> >> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> >> >> > +  .get_link_status = lmc_hssi_get_link_status, /* get link status */
> >> >> > +  .set_link_status = lmc_hssi_set_link_status, /* set link status */
> >> >> > +  .set_crc_length = lmc_hssi_set_crc_length,   /* set CRC length */
> >> >> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> >> >> > +  .watchdog = lmc_hssi_watchdog
> >> >> >  };
> >> >> >
> >> >> > -lmc_media_t lmc_ssi_media = { lmc_ssi_init,    /* special media init stuff */
> >> >> > -  lmc_ssi_default,             /* reset to default state */
> >> >> > -  lmc_ssi_set_status,          /* reset status to state provided */
> >> >> > -  lmc_ssi_set_clock,           /* set clock source */
> >> >> > -  lmc_ssi_set_speed,           /* set line speed */
> >> >> > -  lmc_dummy_set_1,             /* set cable length */
> >> >> > -  lmc_dummy_set_1,             /* set scrambler */
> >> >> > -  lmc_ssi_get_link_status,     /* get link status */
> >> >> > -  lmc_ssi_set_link_status,     /* set link status */
> >> >> > -  lmc_ssi_set_crc_length,      /* set CRC length */
> >> >> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
> >> >> > -  lmc_ssi_watchdog
> >> >> > +lmc_media_t lmc_ssi_media = {
> >> >> > +  .init = lmc_ssi_init,                                /* special media init stuff */
> >> >> > +  .defaults = lmc_ssi_default,                 /* reset to default state */
> >> >> > +  .set_status = lmc_ssi_set_status,            /* reset status to state provided */
> >> >> > +  .set_clock_source = lmc_ssi_set_clock,       /* set clock source */
> >> >> > +  .set_speed = lmc_ssi_set_speed,              /* set line speed */
> >> >> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> >> >> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> >> >> > +  .get_link_status = lmc_ssi_get_link_status,  /* get link status */
> >> >> > +  .set_link_status = lmc_ssi_set_link_status,  /* set link status */
> >> >> > +  .set_crc_length = lmc_ssi_set_crc_length,    /* set CRC length */
> >> >> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
> >> >> > +  .watchdog = lmc_ssi_watchdog
> >> >> >  };
> >> >> >
> >> >> >  lmc_media_t lmc_t1_media = {
> >> >> > -  lmc_t1_init,                 /* special media init stuff */
> >> >> > -  lmc_t1_default,              /* reset to default state */
> >> >> > -  lmc_t1_set_status,           /* reset status to state provided */
> >> >> > -  lmc_t1_set_clock,            /* set clock source */
> >> >> > -  lmc_dummy_set2_1,            /* set line speed */
> >> >> > -  lmc_dummy_set_1,             /* set cable length */
> >> >> > -  lmc_dummy_set_1,             /* set scrambler */
> >> >> > -  lmc_t1_get_link_status,      /* get link status */
> >> >> > -  lmc_dummy_set_1,             /* set link status */
> >> >> > -  lmc_t1_set_crc_length,       /* set CRC length */
> >> >> > -  lmc_t1_set_circuit_type,     /* set T1 or E1 circuit type */
> >> >> > -  lmc_t1_watchdog
> >> >> > +  .init = lmc_t1_init,                         /* special media init stuff */
> >> >> > +  .defaults = lmc_t1_default,                  /* reset to default state */
> >> >> > +  .set_status = lmc_t1_set_status,             /* reset status to state provided */
> >> >> > +  .set_clock_source = lmc_t1_set_clock,                /* set clock source */
> >> >> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
> >> >> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
> >> >> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
> >> >> > +  .get_link_status = lmc_t1_get_link_status,   /* get link status */
> >> >> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
> >> >> > +  .set_crc_length = lmc_t1_set_crc_length,     /* set CRC length */
> >> >> > +  .set_circuit_type = lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
> >> >> > +  .watchdog = lmc_t1_watchdog
> >> >> >  };
> >> >> >
> >> >> >  static void
> >> >> > diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
> >> >> > index 1e7e139..c2031dd 100644
> >> >> > --- a/drivers/scsi/bfa/bfa_fcs.c
> >> >> > +++ b/drivers/scsi/bfa/bfa_fcs.c
> >> >> > @@ -39,10 +39,21 @@ struct bfa_fcs_mod_s {
> >> >> >  #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
> >> >> >
> >> >> >  static struct bfa_fcs_mod_s fcs_modules[] = {
> >> >> > -       { bfa_fcs_port_attach, NULL, NULL },
> >> >> > -       { bfa_fcs_uf_attach, NULL, NULL },
> >> >> > -       { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
> >> >> > -         bfa_fcs_fabric_modexit },
> >> >> > +       {
> >> >> > +               .attach = bfa_fcs_port_attach,
> >> >> > +               .modinit = NULL,
> >> >> > +               .modexit = NULL
> >> >> > +       },
> >> >> > +       {
> >> >> > +               .attach = bfa_fcs_uf_attach,
> >> >> > +               .modinit = NULL,
> >> >> > +               .modexit = NULL
> >> >> > +       },
> >> >> > +       {
> >> >> > +               .attach = bfa_fcs_fabric_attach,
> >> >> > +               .modinit = bfa_fcs_fabric_modinit,
> >> >> > +               .modexit = bfa_fcs_fabric_modexit
> >> >> > +       },
> >> >> >  };
> >> >> >
> >> >> >  /*
> >> >> > diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
> >> >> > index 7733ad5..e5edbce 100644
> >> >> > --- a/drivers/scsi/bfa/bfa_fcs_lport.c
> >> >> > +++ b/drivers/scsi/bfa/bfa_fcs_lport.c
> >> >> > @@ -90,15 +90,26 @@ static struct {
> >> >> >         void            (*offline) (struct bfa_fcs_lport_s *port);
> >> >> >  } __port_action[] = {
> >> >> >         {
> >> >> > -       bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
> >> >> > -                       bfa_fcs_lport_unknown_offline}, {
> >> >> > -       bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
> >> >> > -                       bfa_fcs_lport_fab_offline}, {
> >> >> > -       bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
> >> >> > -                       bfa_fcs_lport_n2n_offline}, {
> >> >> > -       bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
> >> >> > -                       bfa_fcs_lport_loop_offline},
> >> >> > -       };
> >> >> > +               .init = bfa_fcs_lport_unknown_init,
> >> >> > +               .online = bfa_fcs_lport_unknown_online,
> >> >> > +               .offline = bfa_fcs_lport_unknown_offline
> >> >> > +       },
> >> >> > +       {
> >> >> > +               .init = bfa_fcs_lport_fab_init,
> >> >> > +               .online = bfa_fcs_lport_fab_online,
> >> >> > +               .offline = bfa_fcs_lport_fab_offline
> >> >> > +       },
> >> >> > +       {
> >> >> > +               .init = bfa_fcs_lport_n2n_init,
> >> >> > +               .online = bfa_fcs_lport_n2n_online,
> >> >> > +               .offline = bfa_fcs_lport_n2n_offline
> >> >> > +       },
> >> >> > +       {
> >> >> > +               .init = bfa_fcs_lport_loop_init,
> >> >> > +               .online = bfa_fcs_lport_loop_online,
> >> >> > +               .offline = bfa_fcs_lport_loop_offline
> >> >> > +       },
> >> >> > +};
> >> >> >
> >> >> >  /*
> >> >> >   *  fcs_port_sm FCS logical port state machine
> >> >> > diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
> >> >> > index 53135f2..640621b 100644
> >> >> > --- a/drivers/scsi/bfa/bfa_modules.h
> >> >> > +++ b/drivers/scsi/bfa/bfa_modules.h
> >> >> > @@ -79,12 +79,12 @@ enum {
> >> >> >                                                                         \
> >> >> >         extern struct bfa_module_s hal_mod_ ## __mod;                   \
> >> >> >         struct bfa_module_s hal_mod_ ## __mod = {                       \
> >> >> > -               bfa_ ## __mod ## _meminfo,                              \
> >> >> > -               bfa_ ## __mod ## _attach,                               \
> >> >> > -               bfa_ ## __mod ## _detach,                               \
> >> >> > -               bfa_ ## __mod ## _start,                                \
> >> >> > -               bfa_ ## __mod ## _stop,                                 \
> >> >> > -               bfa_ ## __mod ## _iocdisable,                           \
> >> >> > +               .meminfo = bfa_ ## __mod ## _meminfo,                   \
> >> >> > +               .attach = bfa_ ## __mod ## _attach,                     \
> >> >> > +               .detach = bfa_ ## __mod ## _detach,                     \
> >> >> > +               .start = bfa_ ## __mod ## _start,                       \
> >> >> > +               .stop = bfa_ ## __mod ## _stop,                         \
> >> >> > +               .iocdisable = bfa_ ## __mod ## _iocdisable,             \
> >> >> >         }
> >> >> >
> >> >> >  #define BFA_CACHELINE_SZ       (256)
> >> >> > diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
> >> >> > index fdd39fc..b734478 100644
> >> >> > --- a/drivers/scsi/hpsa.h
> >> >> > +++ b/drivers/scsi/hpsa.h
> >> >> > @@ -577,38 +577,38 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
> >> >> >  }
> >> >> >
> >> >> >  static struct access_method SA5_access = {
> >> >> > -       SA5_submit_command,
> >> >> > -       SA5_intr_mask,
> >> >> > -       SA5_intr_pending,
> >> >> > -       SA5_completed,
> >> >> > +       .submit_command = SA5_submit_command,
> >> >> > +       .set_intr_mask = SA5_intr_mask,
> >> >> > +       .intr_pending = SA5_intr_pending,
> >> >> > +       .command_completed = SA5_completed,
> >> >> >  };
> >> >> >
> >> >> >  static struct access_method SA5_ioaccel_mode1_access = {
> >> >> > -       SA5_submit_command,
> >> >> > -       SA5_performant_intr_mask,
> >> >> > -       SA5_ioaccel_mode1_intr_pending,
> >> >> > -       SA5_ioaccel_mode1_completed,
> >> >> > +       .submit_command = SA5_submit_command,
> >> >> > +       .set_intr_mask = SA5_performant_intr_mask,
> >> >> > +       .intr_pending = SA5_ioaccel_mode1_intr_pending,
> >> >> > +       .command_completed = SA5_ioaccel_mode1_completed,
> >> >> >  };
> >> >> >
> >> >> >  static struct access_method SA5_ioaccel_mode2_access = {
> >> >> > -       SA5_submit_command_ioaccel2,
> >> >> > -       SA5_performant_intr_mask,
> >> >> > -       SA5_performant_intr_pending,
> >> >> > -       SA5_performant_completed,
> >> >> > +       .submit_command = SA5_submit_command_ioaccel2,
> >> >> > +       .set_intr_mask = SA5_performant_intr_mask,
> >> >> > +       .intr_pending = SA5_performant_intr_pending,
> >> >> > +       .command_completed = SA5_performant_completed,
> >> >> >  };
> >> >> >
> >> >> >  static struct access_method SA5_performant_access = {
> >> >> > -       SA5_submit_command,
> >> >> > -       SA5_performant_intr_mask,
> >> >> > -       SA5_performant_intr_pending,
> >> >> > -       SA5_performant_completed,
> >> >> > +       .submit_command = SA5_submit_command,
> >> >> > +       .set_intr_mask = SA5_performant_intr_mask,
> >> >> > +       .intr_pending = SA5_performant_intr_pending,
> >> >> > +       .command_completed = SA5_performant_completed,
> >> >> >  };
> >> >> >
> >> >> >  static struct access_method SA5_performant_access_no_read = {
> >> >> > -       SA5_submit_command_no_read,
> >> >> > -       SA5_performant_intr_mask,
> >> >> > -       SA5_performant_intr_pending,
> >> >> > -       SA5_performant_completed,
> >> >> > +       .submit_command = SA5_submit_command_no_read,
> >> >> > +       .set_intr_mask = SA5_performant_intr_mask,
> >> >> > +       .intr_pending = SA5_performant_intr_pending,
> >> >> > +       .command_completed = SA5_performant_completed,
> >> >> >  };
> >> >> >
> >> >> >  struct board_type {
> >> >> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> >> >> > index 4310154..605d035 100644
> >> >> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> >> >> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> >> >> > @@ -147,7 +147,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
> >> >> >         int added = (mode == LCK_NL);
> >> >> >         int overlaps = 0;
> >> >> >         int splitted = 0;
> >> >> > -       const struct ldlm_callback_suite null_cbs = { NULL };
> >> >> > +       const struct ldlm_callback_suite null_cbs = { };
> >> >> >
> >> >> >         CDEBUG(D_DLMTRACE,
> >> >> >                "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
> >> >> > diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
> >> >> > index 329d78c..9756f9e 100644
> >> >> > --- a/drivers/staging/lustre/lustre/libcfs/module.c
> >> >> > +++ b/drivers/staging/lustre/lustre/libcfs/module.c
> >> >> > @@ -322,11 +322,11 @@ out:
> >> >> >  }
> >> >> >
> >> >> >  struct cfs_psdev_ops libcfs_psdev_ops = {
> >> >> > -       libcfs_psdev_open,
> >> >> > -       libcfs_psdev_release,
> >> >> > -       NULL,
> >> >> > -       NULL,
> >> >> > -       libcfs_ioctl
> >> >> > +       .p_open = libcfs_psdev_open,
> >> >> > +       .p_close = libcfs_psdev_release,
> >> >> > +       .p_read = NULL,
> >> >> > +       .p_write = NULL,
> >> >> > +       .p_ioctl = libcfs_ioctl
> >> >> >  };
> >> >> >
> >> >> >  static int proc_call_handler(void *data, int write, loff_t *ppos,
> >> >> > diff --git a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> >> >> > index a01147f..5d896f8 100644
> >> >> > --- a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> >> >> > +++ b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
> >> >> > @@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo)
> >> >> >
> >> >> >  #ifdef CONFIG_FB_MATROX_MYSTIQUE
> >> >> >  struct matrox_switch matrox_mystique = {
> >> >> > -       MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore,
> >> >> > +       .preinit = MGA1064_preinit,
> >> >> > +       .reset = MGA1064_reset,
> >> >> > +       .init = MGA1064_init,
> >> >> > +       .restore = MGA1064_restore,
> >> >> >  };
> >> >> >  EXPORT_SYMBOL(matrox_mystique);
> >> >> >  #endif
> >> >> >
> >> >> >  #ifdef CONFIG_FB_MATROX_G
> >> >> >  struct matrox_switch matrox_G100 = {
> >> >> > -       MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore,
> >> >> > +       .preinit = MGAG100_preinit,
> >> >> > +       .reset = MGAG100_reset,
> >> >> > +       .init = MGAG100_init,
> >> >> > +       .restore = MGAG100_restore,
> >> >> >  };
> >> >> >  EXPORT_SYMBOL(matrox_G100);
> >> >> >  #endif
> >> >> > diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> >> >> > index 195ad7c..09743fc 100644
> >> >> > --- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> >> >> > +++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
> >> >> > @@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo)
> >> >> >  }
> >> >> >
> >> >> >  struct matrox_switch matrox_millennium = {
> >> >> > -       Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore
> >> >> > +       .preinit = Ti3026_preinit,
> >> >> > +       .reset = Ti3026_reset,
> >> >> > +       .init = Ti3026_init,
> >> >> > +       .restore = Ti3026_restore
> >> >> >  };
> >> >> >  EXPORT_SYMBOL(matrox_millennium);
> >> >> >  #endif
> >> >> > diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
> >> >> > index aca73dd..e3c558d 100644
> >> >> > --- a/fs/reiserfs/item_ops.c
> >> >> > +++ b/fs/reiserfs/item_ops.c
> >> >> > @@ -724,18 +724,18 @@ static void errcatch_print_vi(struct virtual_item *vi)
> >> >> >  }
> >> >> >
> >> >> >  static struct item_operations errcatch_ops = {
> >> >> > -       errcatch_bytes_number,
> >> >> > -       errcatch_decrement_key,
> >> >> > -       errcatch_is_left_mergeable,
> >> >> > -       errcatch_print_item,
> >> >> > -       errcatch_check_item,
> >> >> > -
> >> >> > -       errcatch_create_vi,
> >> >> > -       errcatch_check_left,
> >> >> > -       errcatch_check_right,
> >> >> > -       errcatch_part_size,
> >> >> > -       errcatch_unit_num,
> >> >> > -       errcatch_print_vi
> >> >> > +       .bytes_number = errcatch_bytes_number,
> >> >> > +       .decrement_key = errcatch_decrement_key,
> >> >> > +       .is_left_mergeable = errcatch_is_left_mergeable,
> >> >> > +       .print_item = errcatch_print_item,
> >> >> > +       .check_item = errcatch_check_item,
> >> >> > +
> >> >> > +       .create_vi = errcatch_create_vi,
> >> >> > +       .check_left = errcatch_check_left,
> >> >> > +       .check_right = errcatch_check_right,
> >> >> > +       .part_size = errcatch_part_size,
> >> >> > +       .unit_num = errcatch_unit_num,
> >> >> > +       .print_vi = errcatch_print_vi
> >> >> >  };
> >> >> >
> >> >> >  #if ! (TYPE_STAT_DATA == 0 && TYPE_INDIRECT == 1 && TYPE_DIRECT == 2 && TYPE_DIRENTRY == 3)
> >> >> > diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
> >> >> > index 14d7b83..a1edf56 100644
> >> >> > --- a/include/linux/rbtree_augmented.h
> >> >> > +++ b/include/linux/rbtree_augmented.h
> >> >> > @@ -90,7 +90,9 @@ rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new)     \
> >> >> >         old->rbaugmented = rbcompute(old);                              \
> >> >> >  }                                                                      \
> >> >> >  rbstatic const struct rb_augment_callbacks rbname = {                  \
> >> >> > -       rbname ## _propagate, rbname ## _copy, rbname ## _rotate        \
> >> >> > +       .propagate = rbname ## _propagate,                              \
> >> >> > +       .copy = rbname ## _copy,                                        \
> >> >> > +       .rotate = rbname ## _rotate                                     \
> >> >> >  };
> >> >> >
> >> >> >
> >> >> > diff --git a/lib/rbtree.c b/lib/rbtree.c
> >> >> > index 1356454..70ce6c6 100644
> >> >> > --- a/lib/rbtree.c
> >> >> > +++ b/lib/rbtree.c
> >> >> > @@ -412,7 +412,9 @@ static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {}
> >> >> >  static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {}
> >> >> >
> >> >> >  static const struct rb_augment_callbacks dummy_callbacks = {
> >> >> > -       dummy_propagate, dummy_copy, dummy_rotate
> >> >> > +       .propagate = dummy_propagate,
> >> >> > +       .copy = dummy_copy,
> >> >> > +       .rotate = dummy_rotate
> >> >> >  };
> >> >> >
> >> >> >  void rb_insert_color(struct rb_node *node, struct rb_root *root)
> >> >> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> >> >> > index 838ca8bb..7432a90 100644
> >> >> > --- a/mm/page_alloc.c
> >> >> > +++ b/mm/page_alloc.c
> >> >> > @@ -561,7 +561,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page,
> >> >> >                 __mod_zone_freepage_state(zone, (1 << order), migratetype);
> >> >> >  }
> >> >> >  #else
> >> >> > -struct page_ext_operations debug_guardpage_ops = { NULL, };
> >> >> > +struct page_ext_operations debug_guardpage_ops = { .need = NULL, .init = NULL };
> >> >> >  static inline void set_page_guard(struct zone *zone, struct page *page,
> >> >> >                                 unsigned int order, int migratetype) {}
> >> >> >  static inline void clear_page_guard(struct zone *zone, struct page *page,
> >> >> > diff --git a/net/atm/lec.c b/net/atm/lec.c
> >> >> > index cd3b379..977a3c9 100644
> >> >> > --- a/net/atm/lec.c
> >> >> > +++ b/net/atm/lec.c
> >> >> > @@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
> >> >> >  }
> >> >> >
> >> >> >  static struct lane2_ops lane2_ops = {
> >> >> > -       lane2_resolve,          /* resolve,             spec 3.1.3 */
> >> >> > -       lane2_associate_req,    /* associate_req,       spec 3.1.4 */
> >> >> > -       NULL                    /* associate indicator, spec 3.1.5 */
> >> >> > +       .resolve = lane2_resolve,
> >> >> > +       .associate_req = lane2_associate_req,
> >> >> > +       .associate_indicator = NULL
> >> >> >  };
> >> >> >
> >> >> >  static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
> >> >> > diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
> >> >> > index 9e60e74..637c96e 100644
> >> >> > --- a/net/atm/mpoa_caches.c
> >> >> > +++ b/net/atm/mpoa_caches.c
> >> >> > @@ -535,30 +535,29 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
> >> >> >
> >> >> >
> >> >> >  static const struct in_cache_ops ingress_ops = {
> >> >> > -       in_cache_add_entry,               /* add_entry       */
> >> >> > -       in_cache_get,                     /* get             */
> >> >> > -       in_cache_get_with_mask,           /* get_with_mask   */
> >> >> > -       in_cache_get_by_vcc,              /* get_by_vcc      */
> >> >> > -       in_cache_put,                     /* put             */
> >> >> > -       in_cache_remove_entry,            /* remove_entry    */
> >> >> > -       cache_hit,                        /* cache_hit       */
> >> >> > -       clear_count_and_expired,          /* clear_count     */
> >> >> > -       check_resolving_entries,          /* check_resolving */
> >> >> > -       refresh_entries,                  /* refresh         */
> >> >> > -       in_destroy_cache                  /* destroy_cache   */
> >> >> > +       .add_entry = in_cache_add_entry,
> >> >> > +       .get = in_cache_get,
> >> >> > +       .get_with_mask = in_cache_get_with_mask,
> >> >> > +       .get_by_vcc = in_cache_get_by_vcc,
> >> >> > +       .put = in_cache_put,
> >> >> > +       .remove_entry = in_cache_remove_entry,
> >> >> > +       .cache_hit = cache_hit,
> >> >> > +       .clear_count = clear_count_and_expired,
> >> >> > +       .check_resolving = check_resolving_entries,
> >> >> > +       .refresh = refresh_entries,
> >> >> >  };
> >> >> >
> >> >> >  static const struct eg_cache_ops egress_ops = {
> >> >> > -       eg_cache_add_entry,               /* add_entry        */
> >> >> > -       eg_cache_get_by_cache_id,         /* get_by_cache_id  */
> >> >> > -       eg_cache_get_by_tag,              /* get_by_tag       */
> >> >> > -       eg_cache_get_by_vcc,              /* get_by_vcc       */
> >> >> > -       eg_cache_get_by_src_ip,           /* get_by_src_ip    */
> >> >> > -       eg_cache_put,                     /* put              */
> >> >> > -       eg_cache_remove_entry,            /* remove_entry     */
> >> >> > -       update_eg_cache_entry,            /* update           */
> >> >> > -       clear_expired,                    /* clear_expired    */
> >> >> > -       eg_destroy_cache                  /* destroy_cache    */
> >> >> > +       .add_entry = eg_cache_add_entry,
> >> >> > +       .get_by_cache_id = eg_cache_get_by_cache_id,
> >> >> > +       .get_by_tag = eg_cache_get_by_tag,
> >> >> > +       .get_by_vcc = eg_cache_get_by_vcc,
> >> >> > +       .get_by_src_ip = eg_cache_get_by_src_ip,
> >> >> > +       .put = eg_cache_put,
> >> >> > +       .remove_entry = eg_cache_remove_entry,
> >> >> > +       .update = update_eg_cache_entry,
> >> >> > +       .clear_expired = clear_expired,
> >> >> > +       .destroy_cache = eg_destroy_cache
> >> >> >  };
> >> >> >
> >> >> >
> >> >> > diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
> >> >> > index fd8cf02..1406db4 100644
> >> >> > --- a/net/vmw_vsock/vmci_transport_notify.c
> >> >> > +++ b/net/vmw_vsock/vmci_transport_notify.c
> >> >> > @@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
> >> >> >
> >> >> >  /* Socket control packet based operations. */
> >> >> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
> >> >> > -       vmci_transport_notify_pkt_socket_init,
> >> >> > -       vmci_transport_notify_pkt_socket_destruct,
> >> >> > -       vmci_transport_notify_pkt_poll_in,
> >> >> > -       vmci_transport_notify_pkt_poll_out,
> >> >> > -       vmci_transport_notify_pkt_handle_pkt,
> >> >> > -       vmci_transport_notify_pkt_recv_init,
> >> >> > -       vmci_transport_notify_pkt_recv_pre_block,
> >> >> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
> >> >> > -       vmci_transport_notify_pkt_recv_post_dequeue,
> >> >> > -       vmci_transport_notify_pkt_send_init,
> >> >> > -       vmci_transport_notify_pkt_send_pre_block,
> >> >> > -       vmci_transport_notify_pkt_send_pre_enqueue,
> >> >> > -       vmci_transport_notify_pkt_send_post_enqueue,
> >> >> > -       vmci_transport_notify_pkt_process_request,
> >> >> > -       vmci_transport_notify_pkt_process_negotiate,
> >> >> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
> >> >> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
> >> >> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
> >> >> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
> >> >> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
> >> >> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
> >> >> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
> >> >> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
> >> >> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
> >> >> > +       .send_init = vmci_transport_notify_pkt_send_init,
> >> >> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
> >> >> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
> >> >> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
> >> >> > +       .process_request = vmci_transport_notify_pkt_process_request,
> >> >> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
> >> >> >  };
> >> >> > diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
> >> >> > index 21e591d..f3a0afc 100644
> >> >> > --- a/net/vmw_vsock/vmci_transport_notify_qstate.c
> >> >> > +++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
> >> >> > @@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue(
> >> >> >
> >> >> >  /* Socket always on control packet based operations. */
> >> >> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
> >> >> > -       vmci_transport_notify_pkt_socket_init,
> >> >> > -       vmci_transport_notify_pkt_socket_destruct,
> >> >> > -       vmci_transport_notify_pkt_poll_in,
> >> >> > -       vmci_transport_notify_pkt_poll_out,
> >> >> > -       vmci_transport_notify_pkt_handle_pkt,
> >> >> > -       vmci_transport_notify_pkt_recv_init,
> >> >> > -       vmci_transport_notify_pkt_recv_pre_block,
> >> >> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
> >> >> > -       vmci_transport_notify_pkt_recv_post_dequeue,
> >> >> > -       vmci_transport_notify_pkt_send_init,
> >> >> > -       vmci_transport_notify_pkt_send_pre_block,
> >> >> > -       vmci_transport_notify_pkt_send_pre_enqueue,
> >> >> > -       vmci_transport_notify_pkt_send_post_enqueue,
> >> >> > -       vmci_transport_notify_pkt_process_request,
> >> >> > -       vmci_transport_notify_pkt_process_negotiate,
> >> >> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
> >> >> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
> >> >> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
> >> >> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
> >> >> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
> >> >> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
> >> >> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
> >> >> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
> >> >> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
> >> >> > +       .send_init = vmci_transport_notify_pkt_send_init,
> >> >> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
> >> >> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
> >> >> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
> >> >> > +       .process_request = vmci_transport_notify_pkt_process_request,
> >> >> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
> >> >> >  };
> >> >> > diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
> >> >> > index a020920..55579f6 100644
> >> >> > --- a/sound/synth/emux/emux_seq.c
> >> >> > +++ b/sound/synth/emux/emux_seq.c
> >> >> > @@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
> >> >> >   * MIDI emulation operators
> >> >> >   */
> >> >> >  static struct snd_midi_op emux_ops = {
> >> >> > -       snd_emux_note_on,
> >> >> > -       snd_emux_note_off,
> >> >> > -       snd_emux_key_press,
> >> >> > -       snd_emux_terminate_note,
> >> >> > -       snd_emux_control,
> >> >> > -       snd_emux_nrpn,
> >> >> > -       snd_emux_sysex,
> >> >> > +       .note_on = snd_emux_note_on,
> >> >> > +       .note_off = snd_emux_note_off,
> >> >> > +       .key_press = snd_emux_key_press,
> >> >> > +       .note_terminate = snd_emux_terminate_note,
> >> >> > +       .control = snd_emux_control,
> >> >> > +       .nrpn = snd_emux_nrpn,
> >> >> > +       .sysex = snd_emux_sysex,
> >> >> >  };
> >> >> >
> >> >> >
> >> >> > --
> >> >> > 1.9.1
> >> >> >
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Kees Cook
> >> >> Chrome OS & Brillo Security
> >> >>
> >>
> >>
> >>
> >> --
> >> Kees Cook
> >> Chrome OS & Brillo Security
> >>
> 
> 
> 
> -- 
> Kees Cook
> Chrome OS & Brillo Security
> 

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

* [kernel-hardening] Re: [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs
  2016-06-13 20:30             ` Julia Lawall
@ 2016-06-13 20:34               ` Kees Cook
  0 siblings, 0 replies; 21+ messages in thread
From: Kees Cook @ 2016-06-13 20:34 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Michael Leibowitz, Brad Spengler, kernel-hardening, Emese Revfy,
	PaX Team

On Mon, Jun 13, 2016 at 1:30 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Mon, 13 Jun 2016, Kees Cook wrote:
>
>> On Mon, Jun 13, 2016 at 12:57 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> > On Mon, 13 Jun 2016, Kees Cook wrote:
>> >
>> >> On Mon, Jun 13, 2016 at 7:32 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> >> > On Thu, 5 May 2016, Kees Cook wrote:
>> >> >
>> >> >> On Thu, May 5, 2016 at 10:21 AM, Michael Leibowitz
>> >> >> <michael.leibowitz@intel.com> wrote:
>> >> >> > Due to randomization of structs, the in order struct intialization
>> >> >> > style is replaced with explicit field style.
>> >> >> >
>> >> >> > struct foo_t my_foo = {
>> >> >> >        one,
>> >> >> >        two,
>> >> >> >        three
>> >> >> > };
>> >> >> >
>> >> >> > becomes
>> >> >> >
>> >> >> > struct foo_t my_foo = {
>> >> >> >        .one = one,
>> >> >> >        .two = two,
>> >> >> >        .three = three
>> >> >> > };
>> >> >>
>> >> >> Can a coccinelle script be written to do this also? It might be useful
>> >> >> to keep that around.
>> >> >
>> >> > Is this needed for all kinds of structure initializations, ie for both
>> >> > local and global variables, or only for global variables?
>> >>
>> >> It's needed for any structure that has been globally defined. As in,
>> >> any use of a struct must be using C99 since that structure may be
>> >> randomized (in any context: global, local).
>> >
>> > I'm not sure to understand what it means for a structure to be globally
>> > defined.  If the code is:
>> >
>> > int f(...) {
>> >   struct foo x = { 3, 4, 5, };
>> >   ...
>> > }
>> >
>> > is it correct that it does not need to use C99?
>>
>> As I understand it, your example will need to use C99 initialization.
>
> So it's as long as the type definition is global?

That's my understanding, but I haven't tested it under the plugin. It
should be easy enough to report the offsetof of a local type across
multiple builds under the plugin, though.

-Kees

>
> julia
>
>>
>> -Kees
>>
>> >
>> > thanks,
>> > julia
>> >
>> >> Michael, what's the state of this series? What're your next steps?
>> >>
>> >> -Kees
>> >>
>> >> >
>> >> > thanks,
>> >> > julia
>> >> >
>> >> >>
>> >> >> >
>> >> >> > Additionally, tag paravirt related structures to explicitly not be
>> >> >> > randomized, as the structure layout is important.
>> >> >>
>> >> >> This might need to be split out? It's logically separate. Also, I
>> >> >> think this needs to come before the plugin, since the plugin isn't
>> >> >> usable until this patch is in place.
>> >> >>
>> >> >> -Kees
>> >> >>
>> >> >> >
>> >> >> > This feature is ported over from grsecurity.  This is largely
>> >> >> > unchanged from the Original code written by the PaX Team and Spender.
>> >> >> >
>> >> >> > Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>
>> >> >> > ---
>> >> >> >  arch/x86/include/asm/floppy.h                   | 20 ++---
>> >> >> >  arch/x86/include/asm/paravirt_types.h           | 18 +++--
>> >> >> >  drivers/acpi/acpica/hwxfsleep.c                 | 11 +--
>> >> >> >  drivers/block/cciss.h                           | 30 ++++----
>> >> >> >  drivers/gpu/drm/nouveau/nouveau_ttm.c           | 28 +++----
>> >> >> >  drivers/gpu/drm/ttm/ttm_bo_manager.c            | 10 +--
>> >> >> >  drivers/gpu/drm/virtio/virtgpu_ttm.c            | 10 +--
>> >> >> >  drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c   | 10 +--
>> >> >> >  drivers/infiniband/hw/nes/nes_cm.c              | 22 +++---
>> >> >> >  drivers/isdn/gigaset/bas-gigaset.c              | 32 ++++----
>> >> >> >  drivers/isdn/gigaset/ser-gigaset.c              | 32 ++++----
>> >> >> >  drivers/isdn/gigaset/usb-gigaset.c              | 32 ++++----
>> >> >> >  drivers/isdn/i4l/isdn_concap.c                  |  6 +-
>> >> >> >  drivers/isdn/i4l/isdn_x25iface.c                | 16 ++--
>> >> >> >  drivers/media/pci/solo6x10/solo6x10-g723.c      |  2 +-
>> >> >> >  drivers/net/ethernet/brocade/bna/bna_enet.c     |  8 +-
>> >> >> >  drivers/net/wan/lmc/lmc_media.c                 | 97 +++++++++++++------------
>> >> >> >  drivers/scsi/bfa/bfa_fcs.c                      | 19 ++++-
>> >> >> >  drivers/scsi/bfa/bfa_fcs_lport.c                | 29 +++++---
>> >> >> >  drivers/scsi/bfa/bfa_modules.h                  | 12 +--
>> >> >> >  drivers/scsi/hpsa.h                             | 40 +++++-----
>> >> >> >  drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |  2 +-
>> >> >> >  drivers/staging/lustre/lustre/libcfs/module.c   | 10 +--
>> >> >> >  drivers/video/fbdev/matrox/matroxfb_DAC1064.c   | 10 ++-
>> >> >> >  drivers/video/fbdev/matrox/matroxfb_Ti3026.c    |  5 +-
>> >> >> >  fs/reiserfs/item_ops.c                          | 24 +++---
>> >> >> >  include/linux/rbtree_augmented.h                |  4 +-
>> >> >> >  lib/rbtree.c                                    |  4 +-
>> >> >> >  mm/page_alloc.c                                 |  2 +-
>> >> >> >  net/atm/lec.c                                   |  6 +-
>> >> >> >  net/atm/mpoa_caches.c                           | 41 +++++------
>> >> >> >  net/vmw_vsock/vmci_transport_notify.c           | 30 ++++----
>> >> >> >  net/vmw_vsock/vmci_transport_notify_qstate.c    | 30 ++++----
>> >> >> >  sound/synth/emux/emux_seq.c                     | 14 ++--
>> >> >> >  34 files changed, 352 insertions(+), 314 deletions(-)
>> >> >> >
>> >> >> > diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
>> >> >> > index 1c7eefe..d0e4702 100644
>> >> >> > --- a/arch/x86/include/asm/floppy.h
>> >> >> > +++ b/arch/x86/include/asm/floppy.h
>> >> >> > @@ -229,18 +229,18 @@ static struct fd_routine_l {
>> >> >> >         int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
>> >> >> >  } fd_routine[] = {
>> >> >> >         {
>> >> >> > -               request_dma,
>> >> >> > -               free_dma,
>> >> >> > -               get_dma_residue,
>> >> >> > -               dma_mem_alloc,
>> >> >> > -               hard_dma_setup
>> >> >> > +               ._request_dma = request_dma,
>> >> >> > +               ._free_dma = free_dma,
>> >> >> > +               ._get_dma_residue = get_dma_residue,
>> >> >> > +               ._dma_mem_alloc = dma_mem_alloc,
>> >> >> > +               ._dma_setup = hard_dma_setup
>> >> >> >         },
>> >> >> >         {
>> >> >> > -               vdma_request_dma,
>> >> >> > -               vdma_nop,
>> >> >> > -               vdma_get_dma_residue,
>> >> >> > -               vdma_mem_alloc,
>> >> >> > -               vdma_dma_setup
>> >> >> > +               ._request_dma = vdma_request_dma,
>> >> >> > +               ._free_dma = vdma_nop,
>> >> >> > +               ._get_dma_residue = vdma_get_dma_residue,
>> >> >> > +               ._dma_mem_alloc = vdma_mem_alloc,
>> >> >> > +               ._dma_setup = vdma_dma_setup
>> >> >> >         }
>> >> >> >  };
>> >> >> >
>> >> >> > diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
>> >> >> > index 77db561..927c396 100644
>> >> >> > --- a/arch/x86/include/asm/paravirt_types.h
>> >> >> > +++ b/arch/x86/include/asm/paravirt_types.h
>> >> >> > @@ -89,7 +89,7 @@ struct pv_init_ops {
>> >> >> >          */
>> >> >> >         unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
>> >> >> >                           unsigned long addr, unsigned len);
>> >> >> > -};
>> >> >> > +} __no_randomize_layout;
>> >> >> >
>> >> >> >
>> >> >> >  struct pv_lazy_ops {
>> >> >> > @@ -97,12 +97,12 @@ struct pv_lazy_ops {
>> >> >> >         void (*enter)(void);
>> >> >> >         void (*leave)(void);
>> >> >> >         void (*flush)(void);
>> >> >> > -};
>> >> >> > +} __no_randomize_layout;
>> >> >> >
>> >> >> >  struct pv_time_ops {
>> >> >> >         unsigned long long (*sched_clock)(void);
>> >> >> >         unsigned long long (*steal_clock)(int cpu);
>> >> >> > -};
>> >> >> > +} __no_randomize_layout;
>> >> >> >
>> >> >> >  struct pv_cpu_ops {
>> >> >> >         /* hooks for various privileged instructions */
>> >> >> > @@ -178,7 +178,7 @@ struct pv_cpu_ops {
>> >> >> >
>> >> >> >         void (*start_context_switch)(struct task_struct *prev);
>> >> >> >         void (*end_context_switch)(struct task_struct *next);
>> >> >> > -};
>> >> >> > +} __no_randomize_layout;
>> >> >> >
>> >> >> >  struct pv_irq_ops {
>> >> >> >         /*
>> >> >> > @@ -201,7 +201,7 @@ struct pv_irq_ops {
>> >> >> >  #ifdef CONFIG_X86_64
>> >> >> >         void (*adjust_exception_frame)(void);
>> >> >> >  #endif
>> >> >> > -};
>> >> >> > +} __no_randomize_layout;
>> >> >> >
>> >> >> >  struct pv_mmu_ops {
>> >> >> >         unsigned long (*read_cr2)(void);
>> >> >> > @@ -296,7 +296,7 @@ struct pv_mmu_ops {
>> >> >> >            an mfn.  We can tell which is which from the index. */
>> >> >> >         void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
>> >> >> >                            phys_addr_t phys, pgprot_t flags);
>> >> >> > -};
>> >> >> > +} __no_randomize_layout;
>> >> >> >
>> >> >> >  struct arch_spinlock;
>> >> >> >  #ifdef CONFIG_SMP
>> >> >> > @@ -322,7 +322,9 @@ struct pv_lock_ops {
>> >> >> >
>> >> >> >  /* This contains all the paravirt structures: we get a convenient
>> >> >> >   * number for each function using the offset which we use to indicate
>> >> >> > - * what to patch. */
>> >> >> > + * what to patch.
>> >> >> > + * shouldn't be randomized due to the "NEAT TRICK" in paravirt.c
>> >> >> > + */
>> >> >> >  struct paravirt_patch_template {
>> >> >> >         struct pv_init_ops pv_init_ops;
>> >> >> >         struct pv_time_ops pv_time_ops;
>> >> >> > @@ -330,7 +332,7 @@ struct paravirt_patch_template {
>> >> >> >         struct pv_irq_ops pv_irq_ops;
>> >> >> >         struct pv_mmu_ops pv_mmu_ops;
>> >> >> >         struct pv_lock_ops pv_lock_ops;
>> >> >> > -};
>> >> >> > +} __no_randomize_layout;
>> >> >> >
>> >> >> >  extern struct pv_info pv_info;
>> >> >> >  extern struct pv_init_ops pv_init_ops;
>> >> >> > diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
>> >> >> > index f76e0ea..4b83315 100644
>> >> >> > --- a/drivers/acpi/acpica/hwxfsleep.c
>> >> >> > +++ b/drivers/acpi/acpica/hwxfsleep.c
>> >> >> > @@ -70,11 +70,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
>> >> >> >  /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
>> >> >> >
>> >> >> >  static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
>> >> >> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
>> >> >> > -        acpi_hw_extended_sleep},
>> >> >> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
>> >> >> > -        acpi_hw_extended_wake_prep},
>> >> >> > -       {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake}
>> >> >> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep),
>> >> >> > +        .extended_function = acpi_hw_extended_sleep},
>> >> >> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep),
>> >> >> > +        .extended_function = acpi_hw_extended_wake_prep},
>> >> >> > +       {.legacy_function = ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake),
>> >> >> > +        .extended_function = acpi_hw_extended_wake}
>> >> >> >  };
>> >> >> >
>> >> >> >  /*
>> >> >> > diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
>> >> >> > index 7fda30e..428766d 100644
>> >> >> > --- a/drivers/block/cciss.h
>> >> >> > +++ b/drivers/block/cciss.h
>> >> >> > @@ -402,27 +402,27 @@ static bool SA5_performant_intr_pending(ctlr_info_t *h)
>> >> >> >  }
>> >> >> >
>> >> >> >  static struct access_method SA5_access = {
>> >> >> > -       SA5_submit_command,
>> >> >> > -       SA5_intr_mask,
>> >> >> > -       SA5_fifo_full,
>> >> >> > -       SA5_intr_pending,
>> >> >> > -       SA5_completed,
>> >> >> > +       .submit_command = SA5_submit_command,
>> >> >> > +       .set_intr_mask = SA5_intr_mask,
>> >> >> > +       .fifo_full = SA5_fifo_full,
>> >> >> > +       .intr_pending = SA5_intr_pending,
>> >> >> > +       .command_completed = SA5_completed,
>> >> >> >  };
>> >> >> >
>> >> >> >  static struct access_method SA5B_access = {
>> >> >> > -        SA5_submit_command,
>> >> >> > -        SA5B_intr_mask,
>> >> >> > -        SA5_fifo_full,
>> >> >> > -        SA5B_intr_pending,
>> >> >> > -        SA5_completed,
>> >> >> > +       .submit_command = SA5_submit_command,
>> >> >> > +       .set_intr_mask = SA5B_intr_mask,
>> >> >> > +       .fifo_full = SA5_fifo_full,
>> >> >> > +       .intr_pending = SA5B_intr_pending,
>> >> >> > +       .command_completed = SA5_completed,
>> >> >> >  };
>> >> >> >
>> >> >> >  static struct access_method SA5_performant_access = {
>> >> >> > -       SA5_submit_command,
>> >> >> > -       SA5_performant_intr_mask,
>> >> >> > -       SA5_fifo_full,
>> >> >> > -       SA5_performant_intr_pending,
>> >> >> > -       SA5_performant_completed,
>> >> >> > +       .submit_command = SA5_submit_command,
>> >> >> > +       .set_intr_mask = SA5_performant_intr_mask,
>> >> >> > +       .fifo_full = SA5_fifo_full,
>> >> >> > +       .intr_pending = SA5_performant_intr_pending,
>> >> >> > +       .command_completed = SA5_performant_completed,
>> >> >> >  };
>> >> >> >
>> >> >> >  struct board_type {
>> >> >> > diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
>> >> >> > index d2e7d20..7bbe51f 100644
>> >> >> > --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
>> >> >> > +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
>> >> >> > @@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
>> >> >> >  }
>> >> >> >
>> >> >> >  const struct ttm_mem_type_manager_func nouveau_vram_manager = {
>> >> >> > -       nouveau_vram_manager_init,
>> >> >> > -       nouveau_vram_manager_fini,
>> >> >> > -       nouveau_vram_manager_new,
>> >> >> > -       nouveau_vram_manager_del,
>> >> >> > +       .init = nouveau_vram_manager_init,
>> >> >> > +       .takedown = nouveau_vram_manager_fini,
>> >> >> > +       .get_node = nouveau_vram_manager_new,
>> >> >> > +       .put_node = nouveau_vram_manager_del,
>> >> >> >  };
>> >> >> >
>> >> >> >  static int
>> >> >> > @@ -183,11 +183,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
>> >> >> >  }
>> >> >> >
>> >> >> >  const struct ttm_mem_type_manager_func nouveau_gart_manager = {
>> >> >> > -       nouveau_gart_manager_init,
>> >> >> > -       nouveau_gart_manager_fini,
>> >> >> > -       nouveau_gart_manager_new,
>> >> >> > -       nouveau_gart_manager_del,
>> >> >> > -       nouveau_gart_manager_debug
>> >> >> > +       .init = nouveau_gart_manager_init,
>> >> >> > +       .takedown = nouveau_gart_manager_fini,
>> >> >> > +       .get_node = nouveau_gart_manager_new,
>> >> >> > +       .put_node = nouveau_gart_manager_del,
>> >> >> > +       .debug = nouveau_gart_manager_debug
>> >> >> >  };
>> >> >> >
>> >> >> >  /*XXX*/
>> >> >> > @@ -256,11 +256,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
>> >> >> >  }
>> >> >> >
>> >> >> >  const struct ttm_mem_type_manager_func nv04_gart_manager = {
>> >> >> > -       nv04_gart_manager_init,
>> >> >> > -       nv04_gart_manager_fini,
>> >> >> > -       nv04_gart_manager_new,
>> >> >> > -       nv04_gart_manager_del,
>> >> >> > -       nv04_gart_manager_debug
>> >> >> > +       .init = nv04_gart_manager_init,
>> >> >> > +       .takedown = nv04_gart_manager_fini,
>> >> >> > +       .get_node = nv04_gart_manager_new,
>> >> >> > +       .put_node = nv04_gart_manager_del,
>> >> >> > +       .debug = nv04_gart_manager_debug
>> >> >> >  };
>> >> >> >
>> >> >> >  int
>> >> >> > diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
>> >> >> > index aa0bd05..aea6a01 100644
>> >> >> > --- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
>> >> >> > +++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
>> >> >> > @@ -148,10 +148,10 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
>> >> >> >  }
>> >> >> >
>> >> >> >  const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
>> >> >> > -       ttm_bo_man_init,
>> >> >> > -       ttm_bo_man_takedown,
>> >> >> > -       ttm_bo_man_get_node,
>> >> >> > -       ttm_bo_man_put_node,
>> >> >> > -       ttm_bo_man_debug
>> >> >> > +       .init = ttm_bo_man_init,
>> >> >> > +       .takedown = ttm_bo_man_takedown,
>> >> >> > +       .get_node = ttm_bo_man_get_node,
>> >> >> > +       .put_node = ttm_bo_man_put_node,
>> >> >> > +       .debug = ttm_bo_man_debug
>> >> >> >  };
>> >> >> >  EXPORT_SYMBOL(ttm_bo_manager_func);
>> >> >> > diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
>> >> >> > index 9fd924c..e5ec4ef 100644
>> >> >> > --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
>> >> >> > +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
>> >> >> > @@ -198,11 +198,11 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man,
>> >> >> >  }
>> >> >> >
>> >> >> >  static const struct ttm_mem_type_manager_func virtio_gpu_bo_manager_func = {
>> >> >> > -       ttm_bo_man_init,
>> >> >> > -       ttm_bo_man_takedown,
>> >> >> > -       ttm_bo_man_get_node,
>> >> >> > -       ttm_bo_man_put_node,
>> >> >> > -       ttm_bo_man_debug
>> >> >> > +       .init = ttm_bo_man_init,
>> >> >> > +       .takedown = ttm_bo_man_takedown,
>> >> >> > +       .get_node = ttm_bo_man_get_node,
>> >> >> > +       .put_node = ttm_bo_man_put_node,
>> >> >> > +       .debug = ttm_bo_man_debug
>> >> >> >  };
>> >> >> >
>> >> >> >  static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
>> >> >> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
>> >> >> > index 170b61b..fec7348 100644
>> >> >> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
>> >> >> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
>> >> >> > @@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
>> >> >> >  }
>> >> >> >
>> >> >> >  const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
>> >> >> > -       vmw_gmrid_man_init,
>> >> >> > -       vmw_gmrid_man_takedown,
>> >> >> > -       vmw_gmrid_man_get_node,
>> >> >> > -       vmw_gmrid_man_put_node,
>> >> >> > -       vmw_gmrid_man_debug
>> >> >> > +       .init = vmw_gmrid_man_init,
>> >> >> > +       .takedown = vmw_gmrid_man_takedown,
>> >> >> > +       .get_node = vmw_gmrid_man_get_node,
>> >> >> > +       .put_node = vmw_gmrid_man_put_node,
>> >> >> > +       .debug = vmw_gmrid_man_debug
>> >> >> >  };
>> >> >> > diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
>> >> >> > index cb9f0f2..8b1f654 100644
>> >> >> > --- a/drivers/infiniband/hw/nes/nes_cm.c
>> >> >> > +++ b/drivers/infiniband/hw/nes/nes_cm.c
>> >> >> > @@ -135,17 +135,17 @@ static void record_ird_ord(struct nes_cm_node *, u16, u16);
>> >> >> >  /* instance of function pointers for client API */
>> >> >> >  /* set address of this instance to cm_core->cm_ops at cm_core alloc */
>> >> >> >  static const struct nes_cm_ops nes_cm_api = {
>> >> >> > -       mini_cm_accelerated,
>> >> >> > -       mini_cm_listen,
>> >> >> > -       mini_cm_del_listen,
>> >> >> > -       mini_cm_connect,
>> >> >> > -       mini_cm_close,
>> >> >> > -       mini_cm_accept,
>> >> >> > -       mini_cm_reject,
>> >> >> > -       mini_cm_recv_pkt,
>> >> >> > -       mini_cm_dealloc_core,
>> >> >> > -       mini_cm_get,
>> >> >> > -       mini_cm_set
>> >> >> > +       .accelerated = mini_cm_accelerated,
>> >> >> > +       .listen = mini_cm_listen,
>> >> >> > +       .stop_listener = mini_cm_del_listen,
>> >> >> > +       .connect = mini_cm_connect,
>> >> >> > +       .close = mini_cm_close,
>> >> >> > +       .accept = mini_cm_accept,
>> >> >> > +       .reject = mini_cm_reject,
>> >> >> > +       .recv_pkt = mini_cm_recv_pkt,
>> >> >> > +       .destroy_cm_core = mini_cm_dealloc_core,
>> >> >> > +       .get = mini_cm_get,
>> >> >> > +       .set = mini_cm_set
>> >> >> >  };
>> >> >> >
>> >> >> >  static struct nes_cm_core *g_cm_core;
>> >> >> > diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
>> >> >> > index aecec6d..11e13c5 100644
>> >> >> > --- a/drivers/isdn/gigaset/bas-gigaset.c
>> >> >> > +++ b/drivers/isdn/gigaset/bas-gigaset.c
>> >> >> > @@ -2565,22 +2565,22 @@ static int gigaset_post_reset(struct usb_interface *intf)
>> >> >> >
>> >> >> >
>> >> >> >  static const struct gigaset_ops gigops = {
>> >> >> > -       gigaset_write_cmd,
>> >> >> > -       gigaset_write_room,
>> >> >> > -       gigaset_chars_in_buffer,
>> >> >> > -       gigaset_brkchars,
>> >> >> > -       gigaset_init_bchannel,
>> >> >> > -       gigaset_close_bchannel,
>> >> >> > -       gigaset_initbcshw,
>> >> >> > -       gigaset_freebcshw,
>> >> >> > -       gigaset_reinitbcshw,
>> >> >> > -       gigaset_initcshw,
>> >> >> > -       gigaset_freecshw,
>> >> >> > -       gigaset_set_modem_ctrl,
>> >> >> > -       gigaset_baud_rate,
>> >> >> > -       gigaset_set_line_ctrl,
>> >> >> > -       gigaset_isoc_send_skb,
>> >> >> > -       gigaset_isoc_input,
>> >> >> > +       .write_cmd = gigaset_write_cmd,
>> >> >> > +       .write_room = gigaset_write_room,
>> >> >> > +       .chars_in_buffer = gigaset_chars_in_buffer,
>> >> >> > +       .brkchars = gigaset_brkchars,
>> >> >> > +       .init_bchannel = gigaset_init_bchannel,
>> >> >> > +       .close_bchannel = gigaset_close_bchannel,
>> >> >> > +       .initbcshw = gigaset_initbcshw,
>> >> >> > +       .freebcshw = gigaset_freebcshw,
>> >> >> > +       .reinitbcshw = gigaset_reinitbcshw,
>> >> >> > +       .initcshw = gigaset_initcshw,
>> >> >> > +       .freecshw = gigaset_freecshw,
>> >> >> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
>> >> >> > +       .baud_rate = gigaset_baud_rate,
>> >> >> > +       .set_line_ctrl = gigaset_set_line_ctrl,
>> >> >> > +       .send_skb = gigaset_isoc_send_skb,
>> >> >> > +       .handle_input = gigaset_isoc_input,
>> >> >> >  };
>> >> >> >
>> >> >> >  /* bas_gigaset_init
>> >> >> > diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
>> >> >> > index d1f8ab9..c0412f2 100644
>> >> >> > --- a/drivers/isdn/gigaset/ser-gigaset.c
>> >> >> > +++ b/drivers/isdn/gigaset/ser-gigaset.c
>> >> >> > @@ -445,22 +445,22 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag)
>> >> >> >  }
>> >> >> >
>> >> >> >  static const struct gigaset_ops ops = {
>> >> >> > -       gigaset_write_cmd,
>> >> >> > -       gigaset_write_room,
>> >> >> > -       gigaset_chars_in_buffer,
>> >> >> > -       gigaset_brkchars,
>> >> >> > -       gigaset_init_bchannel,
>> >> >> > -       gigaset_close_bchannel,
>> >> >> > -       gigaset_initbcshw,
>> >> >> > -       gigaset_freebcshw,
>> >> >> > -       gigaset_reinitbcshw,
>> >> >> > -       gigaset_initcshw,
>> >> >> > -       gigaset_freecshw,
>> >> >> > -       gigaset_set_modem_ctrl,
>> >> >> > -       gigaset_baud_rate,
>> >> >> > -       gigaset_set_line_ctrl,
>> >> >> > -       gigaset_m10x_send_skb,  /* asyncdata.c */
>> >> >> > -       gigaset_m10x_input,     /* asyncdata.c */
>> >> >> > +       .write_cmd = gigaset_write_cmd,
>> >> >> > +       .write_room = gigaset_write_room,
>> >> >> > +       .chars_in_buffer = gigaset_chars_in_buffer,
>> >> >> > +       .brkchars = gigaset_brkchars,
>> >> >> > +       .init_bchannel = gigaset_init_bchannel,
>> >> >> > +       .close_bchannel = gigaset_close_bchannel,
>> >> >> > +       .initbcshw = gigaset_initbcshw,
>> >> >> > +       .freebcshw = gigaset_freebcshw,
>> >> >> > +       .reinitbcshw = gigaset_reinitbcshw,
>> >> >> > +       .initcshw = gigaset_initcshw,
>> >> >> > +       .freecshw = gigaset_freecshw,
>> >> >> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
>> >> >> > +       .baud_rate = gigaset_baud_rate,
>> >> >> > +       .set_line_ctrl = gigaset_set_line_ctrl,
>> >> >> > +       .send_skb = gigaset_m10x_send_skb,      /* asyncdata.c */
>> >> >> > +       .handle_input = gigaset_m10x_input,     /* asyncdata.c */
>> >> >> >  };
>> >> >> >
>> >> >> >
>> >> >> > diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
>> >> >> > index 5f306e2..eade36d 100644
>> >> >> > --- a/drivers/isdn/gigaset/usb-gigaset.c
>> >> >> > +++ b/drivers/isdn/gigaset/usb-gigaset.c
>> >> >> > @@ -862,22 +862,22 @@ static int gigaset_pre_reset(struct usb_interface *intf)
>> >> >> >  }
>> >> >> >
>> >> >> >  static const struct gigaset_ops ops = {
>> >> >> > -       gigaset_write_cmd,
>> >> >> > -       gigaset_write_room,
>> >> >> > -       gigaset_chars_in_buffer,
>> >> >> > -       gigaset_brkchars,
>> >> >> > -       gigaset_init_bchannel,
>> >> >> > -       gigaset_close_bchannel,
>> >> >> > -       gigaset_initbcshw,
>> >> >> > -       gigaset_freebcshw,
>> >> >> > -       gigaset_reinitbcshw,
>> >> >> > -       gigaset_initcshw,
>> >> >> > -       gigaset_freecshw,
>> >> >> > -       gigaset_set_modem_ctrl,
>> >> >> > -       gigaset_baud_rate,
>> >> >> > -       gigaset_set_line_ctrl,
>> >> >> > -       gigaset_m10x_send_skb,
>> >> >> > -       gigaset_m10x_input,
>> >> >> > +       .write_cmd = gigaset_write_cmd,
>> >> >> > +       .write_room = gigaset_write_room,
>> >> >> > +       .chars_in_buffer = gigaset_chars_in_buffer,
>> >> >> > +       .brkchars = gigaset_brkchars,
>> >> >> > +       .init_bchannel = gigaset_init_bchannel,
>> >> >> > +       .close_bchannel = gigaset_close_bchannel,
>> >> >> > +       .initbcshw = gigaset_initbcshw,
>> >> >> > +       .freebcshw = gigaset_freebcshw,
>> >> >> > +       .reinitbcshw = gigaset_reinitbcshw,
>> >> >> > +       .initcshw = gigaset_initcshw,
>> >> >> > +       .freecshw = gigaset_freecshw,
>> >> >> > +       .set_modem_ctrl = gigaset_set_modem_ctrl,
>> >> >> > +       .baud_rate = gigaset_baud_rate,
>> >> >> > +       .set_line_ctrl = gigaset_set_line_ctrl,
>> >> >> > +       .send_skb = gigaset_m10x_send_skb,
>> >> >> > +       .handle_input = gigaset_m10x_input,
>> >> >> >  };
>> >> >> >
>> >> >> >  /*
>> >> >> > diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
>> >> >> > index 91d5730..336523e 100644
>> >> >> > --- a/drivers/isdn/i4l/isdn_concap.c
>> >> >> > +++ b/drivers/isdn/i4l/isdn_concap.c
>> >> >> > @@ -80,9 +80,9 @@ static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
>> >> >> >  }
>> >> >> >
>> >> >> >  struct concap_device_ops isdn_concap_reliable_dl_dops = {
>> >> >> > -       &isdn_concap_dl_data_req,
>> >> >> > -       &isdn_concap_dl_connect_req,
>> >> >> > -       &isdn_concap_dl_disconn_req
>> >> >> > +       .data_req = &isdn_concap_dl_data_req,
>> >> >> > +       .connect_req = &isdn_concap_dl_connect_req,
>> >> >> > +       .disconn_req = &isdn_concap_dl_disconn_req
>> >> >> >  };
>> >> >> >
>> >> >> >  /* The following should better go into a dedicated source file such that
>> >> >> > diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
>> >> >> > index e2d4e58..40cd045 100644
>> >> >> > --- a/drivers/isdn/i4l/isdn_x25iface.c
>> >> >> > +++ b/drivers/isdn/i4l/isdn_x25iface.c
>> >> >> > @@ -53,14 +53,14 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *);
>> >> >> >
>> >> >> >
>> >> >> >  static struct concap_proto_ops ix25_pops = {
>> >> >> > -       &isdn_x25iface_proto_new,
>> >> >> > -       &isdn_x25iface_proto_del,
>> >> >> > -       &isdn_x25iface_proto_restart,
>> >> >> > -       &isdn_x25iface_proto_close,
>> >> >> > -       &isdn_x25iface_xmit,
>> >> >> > -       &isdn_x25iface_receive,
>> >> >> > -       &isdn_x25iface_connect_ind,
>> >> >> > -       &isdn_x25iface_disconn_ind
>> >> >> > +       .proto_new = &isdn_x25iface_proto_new,
>> >> >> > +       .proto_del = &isdn_x25iface_proto_del,
>> >> >> > +       .restart = &isdn_x25iface_proto_restart,
>> >> >> > +       .close = &isdn_x25iface_proto_close,
>> >> >> > +       .encap_and_xmit = &isdn_x25iface_xmit,
>> >> >> > +       .data_ind = &isdn_x25iface_receive,
>> >> >> > +       .connect_ind = &isdn_x25iface_connect_ind,
>> >> >> > +       .disconn_ind = &isdn_x25iface_disconn_ind
>> >> >> >  };
>> >> >> >
>> >> >> >  /* error message helper function */
>> >> >> > diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c
>> >> >> > index 4a37a1c..7e82dfd 100644
>> >> >> > --- a/drivers/media/pci/solo6x10/solo6x10-g723.c
>> >> >> > +++ b/drivers/media/pci/solo6x10/solo6x10-g723.c
>> >> >> > @@ -350,7 +350,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
>> >> >> >
>> >> >> >  int solo_g723_init(struct solo_dev *solo_dev)
>> >> >> >  {
>> >> >> > -       static struct snd_device_ops ops = { NULL };
>> >> >> > +       static struct snd_device_ops ops = { };
>> >> >> >         struct snd_card *card;
>> >> >> >         struct snd_kcontrol_new kctl;
>> >> >> >         char name[32];
>> >> >> > diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c
>> >> >> > index 4e5c387..bba8173 100644
>> >> >> > --- a/drivers/net/ethernet/brocade/bna/bna_enet.c
>> >> >> > +++ b/drivers/net/ethernet/brocade/bna/bna_enet.c
>> >> >> > @@ -1676,10 +1676,10 @@ bna_cb_ioceth_reset(void *arg)
>> >> >> >  }
>> >> >> >
>> >> >> >  static struct bfa_ioc_cbfn bna_ioceth_cbfn = {
>> >> >> > -       bna_cb_ioceth_enable,
>> >> >> > -       bna_cb_ioceth_disable,
>> >> >> > -       bna_cb_ioceth_hbfail,
>> >> >> > -       bna_cb_ioceth_reset
>> >> >> > +       .enable_cbfn = bna_cb_ioceth_enable,
>> >> >> > +       .disable_cbfn = bna_cb_ioceth_disable,
>> >> >> > +       .hbfail_cbfn = bna_cb_ioceth_hbfail,
>> >> >> > +       .reset_cbfn = bna_cb_ioceth_reset
>> >> >> >  };
>> >> >> >
>> >> >> >  static void bna_attr_init(struct bna_ioceth *ioceth)
>> >> >> > diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
>> >> >> > index 5920c99..ff2e4a5 100644
>> >> >> > --- a/drivers/net/wan/lmc/lmc_media.c
>> >> >> > +++ b/drivers/net/wan/lmc/lmc_media.c
>> >> >> > @@ -95,62 +95,63 @@ static inline void write_av9110_bit (lmc_softc_t *, int);
>> >> >> >  static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32);
>> >> >> >
>> >> >> >  lmc_media_t lmc_ds3_media = {
>> >> >> > -  lmc_ds3_init,                        /* special media init stuff */
>> >> >> > -  lmc_ds3_default,             /* reset to default state */
>> >> >> > -  lmc_ds3_set_status,          /* reset status to state provided */
>> >> >> > -  lmc_dummy_set_1,             /* set clock source */
>> >> >> > -  lmc_dummy_set2_1,            /* set line speed */
>> >> >> > -  lmc_ds3_set_100ft,           /* set cable length */
>> >> >> > -  lmc_ds3_set_scram,           /* set scrambler */
>> >> >> > -  lmc_ds3_get_link_status,     /* get link status */
>> >> >> > -  lmc_dummy_set_1,             /* set link status */
>> >> >> > -  lmc_ds3_set_crc_length,      /* set CRC length */
>> >> >> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
>> >> >> > -  lmc_ds3_watchdog
>> >> >> > +  .init = lmc_ds3_init,                                /* special media init stuff */
>> >> >> > +  .defaults = lmc_ds3_default,                 /* reset to default state */
>> >> >> > +  .set_status = lmc_ds3_set_status,            /* reset status to state provided */
>> >> >> > +  .set_clock_source = lmc_dummy_set_1,         /* set clock source */
>> >> >> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
>> >> >> > +  .set_cable_length = lmc_ds3_set_100ft,       /* set cable length */
>> >> >> > +  .set_scrambler = lmc_ds3_set_scram,          /* set scrambler */
>> >> >> > +  .get_link_status = lmc_ds3_get_link_status,  /* get link status */
>> >> >> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
>> >> >> > +  .set_crc_length = lmc_ds3_set_crc_length,    /* set CRC length */
>> >> >> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
>> >> >> > +  .watchdog = lmc_ds3_watchdog
>> >> >> >  };
>> >> >> >
>> >> >> >  lmc_media_t lmc_hssi_media = {
>> >> >> > -  lmc_hssi_init,               /* special media init stuff */
>> >> >> > -  lmc_hssi_default,            /* reset to default state */
>> >> >> > -  lmc_hssi_set_status,         /* reset status to state provided */
>> >> >> > -  lmc_hssi_set_clock,          /* set clock source */
>> >> >> > -  lmc_dummy_set2_1,            /* set line speed */
>> >> >> > -  lmc_dummy_set_1,             /* set cable length */
>> >> >> > -  lmc_dummy_set_1,             /* set scrambler */
>> >> >> > -  lmc_hssi_get_link_status,    /* get link status */
>> >> >> > -  lmc_hssi_set_link_status,    /* set link status */
>> >> >> > -  lmc_hssi_set_crc_length,     /* set CRC length */
>> >> >> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
>> >> >> > -  lmc_hssi_watchdog
>> >> >> > +  .init = lmc_hssi_init,                       /* special media init stuff */
>> >> >> > +  .defaults = lmc_hssi_default,                        /* reset to default state */
>> >> >> > +  .set_status = lmc_hssi_set_status,           /* reset status to state provided */
>> >> >> > +  .set_clock_source = lmc_hssi_set_clock,      /* set clock source */
>> >> >> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
>> >> >> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
>> >> >> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
>> >> >> > +  .get_link_status = lmc_hssi_get_link_status, /* get link status */
>> >> >> > +  .set_link_status = lmc_hssi_set_link_status, /* set link status */
>> >> >> > +  .set_crc_length = lmc_hssi_set_crc_length,   /* set CRC length */
>> >> >> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
>> >> >> > +  .watchdog = lmc_hssi_watchdog
>> >> >> >  };
>> >> >> >
>> >> >> > -lmc_media_t lmc_ssi_media = { lmc_ssi_init,    /* special media init stuff */
>> >> >> > -  lmc_ssi_default,             /* reset to default state */
>> >> >> > -  lmc_ssi_set_status,          /* reset status to state provided */
>> >> >> > -  lmc_ssi_set_clock,           /* set clock source */
>> >> >> > -  lmc_ssi_set_speed,           /* set line speed */
>> >> >> > -  lmc_dummy_set_1,             /* set cable length */
>> >> >> > -  lmc_dummy_set_1,             /* set scrambler */
>> >> >> > -  lmc_ssi_get_link_status,     /* get link status */
>> >> >> > -  lmc_ssi_set_link_status,     /* set link status */
>> >> >> > -  lmc_ssi_set_crc_length,      /* set CRC length */
>> >> >> > -  lmc_dummy_set_1,             /* set T1 or E1 circuit type */
>> >> >> > -  lmc_ssi_watchdog
>> >> >> > +lmc_media_t lmc_ssi_media = {
>> >> >> > +  .init = lmc_ssi_init,                                /* special media init stuff */
>> >> >> > +  .defaults = lmc_ssi_default,                 /* reset to default state */
>> >> >> > +  .set_status = lmc_ssi_set_status,            /* reset status to state provided */
>> >> >> > +  .set_clock_source = lmc_ssi_set_clock,       /* set clock source */
>> >> >> > +  .set_speed = lmc_ssi_set_speed,              /* set line speed */
>> >> >> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
>> >> >> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
>> >> >> > +  .get_link_status = lmc_ssi_get_link_status,  /* get link status */
>> >> >> > +  .set_link_status = lmc_ssi_set_link_status,  /* set link status */
>> >> >> > +  .set_crc_length = lmc_ssi_set_crc_length,    /* set CRC length */
>> >> >> > +  .set_circuit_type = lmc_dummy_set_1,         /* set T1 or E1 circuit type */
>> >> >> > +  .watchdog = lmc_ssi_watchdog
>> >> >> >  };
>> >> >> >
>> >> >> >  lmc_media_t lmc_t1_media = {
>> >> >> > -  lmc_t1_init,                 /* special media init stuff */
>> >> >> > -  lmc_t1_default,              /* reset to default state */
>> >> >> > -  lmc_t1_set_status,           /* reset status to state provided */
>> >> >> > -  lmc_t1_set_clock,            /* set clock source */
>> >> >> > -  lmc_dummy_set2_1,            /* set line speed */
>> >> >> > -  lmc_dummy_set_1,             /* set cable length */
>> >> >> > -  lmc_dummy_set_1,             /* set scrambler */
>> >> >> > -  lmc_t1_get_link_status,      /* get link status */
>> >> >> > -  lmc_dummy_set_1,             /* set link status */
>> >> >> > -  lmc_t1_set_crc_length,       /* set CRC length */
>> >> >> > -  lmc_t1_set_circuit_type,     /* set T1 or E1 circuit type */
>> >> >> > -  lmc_t1_watchdog
>> >> >> > +  .init = lmc_t1_init,                         /* special media init stuff */
>> >> >> > +  .defaults = lmc_t1_default,                  /* reset to default state */
>> >> >> > +  .set_status = lmc_t1_set_status,             /* reset status to state provided */
>> >> >> > +  .set_clock_source = lmc_t1_set_clock,                /* set clock source */
>> >> >> > +  .set_speed = lmc_dummy_set2_1,               /* set line speed */
>> >> >> > +  .set_cable_length = lmc_dummy_set_1,         /* set cable length */
>> >> >> > +  .set_scrambler = lmc_dummy_set_1,            /* set scrambler */
>> >> >> > +  .get_link_status = lmc_t1_get_link_status,   /* get link status */
>> >> >> > +  .set_link_status = lmc_dummy_set_1,          /* set link status */
>> >> >> > +  .set_crc_length = lmc_t1_set_crc_length,     /* set CRC length */
>> >> >> > +  .set_circuit_type = lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
>> >> >> > +  .watchdog = lmc_t1_watchdog
>> >> >> >  };
>> >> >> >
>> >> >> >  static void
>> >> >> > diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
>> >> >> > index 1e7e139..c2031dd 100644
>> >> >> > --- a/drivers/scsi/bfa/bfa_fcs.c
>> >> >> > +++ b/drivers/scsi/bfa/bfa_fcs.c
>> >> >> > @@ -39,10 +39,21 @@ struct bfa_fcs_mod_s {
>> >> >> >  #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
>> >> >> >
>> >> >> >  static struct bfa_fcs_mod_s fcs_modules[] = {
>> >> >> > -       { bfa_fcs_port_attach, NULL, NULL },
>> >> >> > -       { bfa_fcs_uf_attach, NULL, NULL },
>> >> >> > -       { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
>> >> >> > -         bfa_fcs_fabric_modexit },
>> >> >> > +       {
>> >> >> > +               .attach = bfa_fcs_port_attach,
>> >> >> > +               .modinit = NULL,
>> >> >> > +               .modexit = NULL
>> >> >> > +       },
>> >> >> > +       {
>> >> >> > +               .attach = bfa_fcs_uf_attach,
>> >> >> > +               .modinit = NULL,
>> >> >> > +               .modexit = NULL
>> >> >> > +       },
>> >> >> > +       {
>> >> >> > +               .attach = bfa_fcs_fabric_attach,
>> >> >> > +               .modinit = bfa_fcs_fabric_modinit,
>> >> >> > +               .modexit = bfa_fcs_fabric_modexit
>> >> >> > +       },
>> >> >> >  };
>> >> >> >
>> >> >> >  /*
>> >> >> > diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
>> >> >> > index 7733ad5..e5edbce 100644
>> >> >> > --- a/drivers/scsi/bfa/bfa_fcs_lport.c
>> >> >> > +++ b/drivers/scsi/bfa/bfa_fcs_lport.c
>> >> >> > @@ -90,15 +90,26 @@ static struct {
>> >> >> >         void            (*offline) (struct bfa_fcs_lport_s *port);
>> >> >> >  } __port_action[] = {
>> >> >> >         {
>> >> >> > -       bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
>> >> >> > -                       bfa_fcs_lport_unknown_offline}, {
>> >> >> > -       bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
>> >> >> > -                       bfa_fcs_lport_fab_offline}, {
>> >> >> > -       bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
>> >> >> > -                       bfa_fcs_lport_n2n_offline}, {
>> >> >> > -       bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
>> >> >> > -                       bfa_fcs_lport_loop_offline},
>> >> >> > -       };
>> >> >> > +               .init = bfa_fcs_lport_unknown_init,
>> >> >> > +               .online = bfa_fcs_lport_unknown_online,
>> >> >> > +               .offline = bfa_fcs_lport_unknown_offline
>> >> >> > +       },
>> >> >> > +       {
>> >> >> > +               .init = bfa_fcs_lport_fab_init,
>> >> >> > +               .online = bfa_fcs_lport_fab_online,
>> >> >> > +               .offline = bfa_fcs_lport_fab_offline
>> >> >> > +       },
>> >> >> > +       {
>> >> >> > +               .init = bfa_fcs_lport_n2n_init,
>> >> >> > +               .online = bfa_fcs_lport_n2n_online,
>> >> >> > +               .offline = bfa_fcs_lport_n2n_offline
>> >> >> > +       },
>> >> >> > +       {
>> >> >> > +               .init = bfa_fcs_lport_loop_init,
>> >> >> > +               .online = bfa_fcs_lport_loop_online,
>> >> >> > +               .offline = bfa_fcs_lport_loop_offline
>> >> >> > +       },
>> >> >> > +};
>> >> >> >
>> >> >> >  /*
>> >> >> >   *  fcs_port_sm FCS logical port state machine
>> >> >> > diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
>> >> >> > index 53135f2..640621b 100644
>> >> >> > --- a/drivers/scsi/bfa/bfa_modules.h
>> >> >> > +++ b/drivers/scsi/bfa/bfa_modules.h
>> >> >> > @@ -79,12 +79,12 @@ enum {
>> >> >> >                                                                         \
>> >> >> >         extern struct bfa_module_s hal_mod_ ## __mod;                   \
>> >> >> >         struct bfa_module_s hal_mod_ ## __mod = {                       \
>> >> >> > -               bfa_ ## __mod ## _meminfo,                              \
>> >> >> > -               bfa_ ## __mod ## _attach,                               \
>> >> >> > -               bfa_ ## __mod ## _detach,                               \
>> >> >> > -               bfa_ ## __mod ## _start,                                \
>> >> >> > -               bfa_ ## __mod ## _stop,                                 \
>> >> >> > -               bfa_ ## __mod ## _iocdisable,                           \
>> >> >> > +               .meminfo = bfa_ ## __mod ## _meminfo,                   \
>> >> >> > +               .attach = bfa_ ## __mod ## _attach,                     \
>> >> >> > +               .detach = bfa_ ## __mod ## _detach,                     \
>> >> >> > +               .start = bfa_ ## __mod ## _start,                       \
>> >> >> > +               .stop = bfa_ ## __mod ## _stop,                         \
>> >> >> > +               .iocdisable = bfa_ ## __mod ## _iocdisable,             \
>> >> >> >         }
>> >> >> >
>> >> >> >  #define BFA_CACHELINE_SZ       (256)
>> >> >> > diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
>> >> >> > index fdd39fc..b734478 100644
>> >> >> > --- a/drivers/scsi/hpsa.h
>> >> >> > +++ b/drivers/scsi/hpsa.h
>> >> >> > @@ -577,38 +577,38 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q)
>> >> >> >  }
>> >> >> >
>> >> >> >  static struct access_method SA5_access = {
>> >> >> > -       SA5_submit_command,
>> >> >> > -       SA5_intr_mask,
>> >> >> > -       SA5_intr_pending,
>> >> >> > -       SA5_completed,
>> >> >> > +       .submit_command = SA5_submit_command,
>> >> >> > +       .set_intr_mask = SA5_intr_mask,
>> >> >> > +       .intr_pending = SA5_intr_pending,
>> >> >> > +       .command_completed = SA5_completed,
>> >> >> >  };
>> >> >> >
>> >> >> >  static struct access_method SA5_ioaccel_mode1_access = {
>> >> >> > -       SA5_submit_command,
>> >> >> > -       SA5_performant_intr_mask,
>> >> >> > -       SA5_ioaccel_mode1_intr_pending,
>> >> >> > -       SA5_ioaccel_mode1_completed,
>> >> >> > +       .submit_command = SA5_submit_command,
>> >> >> > +       .set_intr_mask = SA5_performant_intr_mask,
>> >> >> > +       .intr_pending = SA5_ioaccel_mode1_intr_pending,
>> >> >> > +       .command_completed = SA5_ioaccel_mode1_completed,
>> >> >> >  };
>> >> >> >
>> >> >> >  static struct access_method SA5_ioaccel_mode2_access = {
>> >> >> > -       SA5_submit_command_ioaccel2,
>> >> >> > -       SA5_performant_intr_mask,
>> >> >> > -       SA5_performant_intr_pending,
>> >> >> > -       SA5_performant_completed,
>> >> >> > +       .submit_command = SA5_submit_command_ioaccel2,
>> >> >> > +       .set_intr_mask = SA5_performant_intr_mask,
>> >> >> > +       .intr_pending = SA5_performant_intr_pending,
>> >> >> > +       .command_completed = SA5_performant_completed,
>> >> >> >  };
>> >> >> >
>> >> >> >  static struct access_method SA5_performant_access = {
>> >> >> > -       SA5_submit_command,
>> >> >> > -       SA5_performant_intr_mask,
>> >> >> > -       SA5_performant_intr_pending,
>> >> >> > -       SA5_performant_completed,
>> >> >> > +       .submit_command = SA5_submit_command,
>> >> >> > +       .set_intr_mask = SA5_performant_intr_mask,
>> >> >> > +       .intr_pending = SA5_performant_intr_pending,
>> >> >> > +       .command_completed = SA5_performant_completed,
>> >> >> >  };
>> >> >> >
>> >> >> >  static struct access_method SA5_performant_access_no_read = {
>> >> >> > -       SA5_submit_command_no_read,
>> >> >> > -       SA5_performant_intr_mask,
>> >> >> > -       SA5_performant_intr_pending,
>> >> >> > -       SA5_performant_completed,
>> >> >> > +       .submit_command = SA5_submit_command_no_read,
>> >> >> > +       .set_intr_mask = SA5_performant_intr_mask,
>> >> >> > +       .intr_pending = SA5_performant_intr_pending,
>> >> >> > +       .command_completed = SA5_performant_completed,
>> >> >> >  };
>> >> >> >
>> >> >> >  struct board_type {
>> >> >> > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
>> >> >> > index 4310154..605d035 100644
>> >> >> > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
>> >> >> > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
>> >> >> > @@ -147,7 +147,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
>> >> >> >         int added = (mode == LCK_NL);
>> >> >> >         int overlaps = 0;
>> >> >> >         int splitted = 0;
>> >> >> > -       const struct ldlm_callback_suite null_cbs = { NULL };
>> >> >> > +       const struct ldlm_callback_suite null_cbs = { };
>> >> >> >
>> >> >> >         CDEBUG(D_DLMTRACE,
>> >> >> >                "flags %#llx owner %llu pid %u mode %u start %llu end %llu\n",
>> >> >> > diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
>> >> >> > index 329d78c..9756f9e 100644
>> >> >> > --- a/drivers/staging/lustre/lustre/libcfs/module.c
>> >> >> > +++ b/drivers/staging/lustre/lustre/libcfs/module.c
>> >> >> > @@ -322,11 +322,11 @@ out:
>> >> >> >  }
>> >> >> >
>> >> >> >  struct cfs_psdev_ops libcfs_psdev_ops = {
>> >> >> > -       libcfs_psdev_open,
>> >> >> > -       libcfs_psdev_release,
>> >> >> > -       NULL,
>> >> >> > -       NULL,
>> >> >> > -       libcfs_ioctl
>> >> >> > +       .p_open = libcfs_psdev_open,
>> >> >> > +       .p_close = libcfs_psdev_release,
>> >> >> > +       .p_read = NULL,
>> >> >> > +       .p_write = NULL,
>> >> >> > +       .p_ioctl = libcfs_ioctl
>> >> >> >  };
>> >> >> >
>> >> >> >  static int proc_call_handler(void *data, int write, loff_t *ppos,
>> >> >> > diff --git a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
>> >> >> > index a01147f..5d896f8 100644
>> >> >> > --- a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
>> >> >> > +++ b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c
>> >> >> > @@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo)
>> >> >> >
>> >> >> >  #ifdef CONFIG_FB_MATROX_MYSTIQUE
>> >> >> >  struct matrox_switch matrox_mystique = {
>> >> >> > -       MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore,
>> >> >> > +       .preinit = MGA1064_preinit,
>> >> >> > +       .reset = MGA1064_reset,
>> >> >> > +       .init = MGA1064_init,
>> >> >> > +       .restore = MGA1064_restore,
>> >> >> >  };
>> >> >> >  EXPORT_SYMBOL(matrox_mystique);
>> >> >> >  #endif
>> >> >> >
>> >> >> >  #ifdef CONFIG_FB_MATROX_G
>> >> >> >  struct matrox_switch matrox_G100 = {
>> >> >> > -       MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore,
>> >> >> > +       .preinit = MGAG100_preinit,
>> >> >> > +       .reset = MGAG100_reset,
>> >> >> > +       .init = MGAG100_init,
>> >> >> > +       .restore = MGAG100_restore,
>> >> >> >  };
>> >> >> >  EXPORT_SYMBOL(matrox_G100);
>> >> >> >  #endif
>> >> >> > diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
>> >> >> > index 195ad7c..09743fc 100644
>> >> >> > --- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
>> >> >> > +++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
>> >> >> > @@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo)
>> >> >> >  }
>> >> >> >
>> >> >> >  struct matrox_switch matrox_millennium = {
>> >> >> > -       Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore
>> >> >> > +       .preinit = Ti3026_preinit,
>> >> >> > +       .reset = Ti3026_reset,
>> >> >> > +       .init = Ti3026_init,
>> >> >> > +       .restore = Ti3026_restore
>> >> >> >  };
>> >> >> >  EXPORT_SYMBOL(matrox_millennium);
>> >> >> >  #endif
>> >> >> > diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
>> >> >> > index aca73dd..e3c558d 100644
>> >> >> > --- a/fs/reiserfs/item_ops.c
>> >> >> > +++ b/fs/reiserfs/item_ops.c
>> >> >> > @@ -724,18 +724,18 @@ static void errcatch_print_vi(struct virtual_item *vi)
>> >> >> >  }
>> >> >> >
>> >> >> >  static struct item_operations errcatch_ops = {
>> >> >> > -       errcatch_bytes_number,
>> >> >> > -       errcatch_decrement_key,
>> >> >> > -       errcatch_is_left_mergeable,
>> >> >> > -       errcatch_print_item,
>> >> >> > -       errcatch_check_item,
>> >> >> > -
>> >> >> > -       errcatch_create_vi,
>> >> >> > -       errcatch_check_left,
>> >> >> > -       errcatch_check_right,
>> >> >> > -       errcatch_part_size,
>> >> >> > -       errcatch_unit_num,
>> >> >> > -       errcatch_print_vi
>> >> >> > +       .bytes_number = errcatch_bytes_number,
>> >> >> > +       .decrement_key = errcatch_decrement_key,
>> >> >> > +       .is_left_mergeable = errcatch_is_left_mergeable,
>> >> >> > +       .print_item = errcatch_print_item,
>> >> >> > +       .check_item = errcatch_check_item,
>> >> >> > +
>> >> >> > +       .create_vi = errcatch_create_vi,
>> >> >> > +       .check_left = errcatch_check_left,
>> >> >> > +       .check_right = errcatch_check_right,
>> >> >> > +       .part_size = errcatch_part_size,
>> >> >> > +       .unit_num = errcatch_unit_num,
>> >> >> > +       .print_vi = errcatch_print_vi
>> >> >> >  };
>> >> >> >
>> >> >> >  #if ! (TYPE_STAT_DATA == 0 && TYPE_INDIRECT == 1 && TYPE_DIRECT == 2 && TYPE_DIRENTRY == 3)
>> >> >> > diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
>> >> >> > index 14d7b83..a1edf56 100644
>> >> >> > --- a/include/linux/rbtree_augmented.h
>> >> >> > +++ b/include/linux/rbtree_augmented.h
>> >> >> > @@ -90,7 +90,9 @@ rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new)     \
>> >> >> >         old->rbaugmented = rbcompute(old);                              \
>> >> >> >  }                                                                      \
>> >> >> >  rbstatic const struct rb_augment_callbacks rbname = {                  \
>> >> >> > -       rbname ## _propagate, rbname ## _copy, rbname ## _rotate        \
>> >> >> > +       .propagate = rbname ## _propagate,                              \
>> >> >> > +       .copy = rbname ## _copy,                                        \
>> >> >> > +       .rotate = rbname ## _rotate                                     \
>> >> >> >  };
>> >> >> >
>> >> >> >
>> >> >> > diff --git a/lib/rbtree.c b/lib/rbtree.c
>> >> >> > index 1356454..70ce6c6 100644
>> >> >> > --- a/lib/rbtree.c
>> >> >> > +++ b/lib/rbtree.c
>> >> >> > @@ -412,7 +412,9 @@ static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {}
>> >> >> >  static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {}
>> >> >> >
>> >> >> >  static const struct rb_augment_callbacks dummy_callbacks = {
>> >> >> > -       dummy_propagate, dummy_copy, dummy_rotate
>> >> >> > +       .propagate = dummy_propagate,
>> >> >> > +       .copy = dummy_copy,
>> >> >> > +       .rotate = dummy_rotate
>> >> >> >  };
>> >> >> >
>> >> >> >  void rb_insert_color(struct rb_node *node, struct rb_root *root)
>> >> >> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> >> >> > index 838ca8bb..7432a90 100644
>> >> >> > --- a/mm/page_alloc.c
>> >> >> > +++ b/mm/page_alloc.c
>> >> >> > @@ -561,7 +561,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page,
>> >> >> >                 __mod_zone_freepage_state(zone, (1 << order), migratetype);
>> >> >> >  }
>> >> >> >  #else
>> >> >> > -struct page_ext_operations debug_guardpage_ops = { NULL, };
>> >> >> > +struct page_ext_operations debug_guardpage_ops = { .need = NULL, .init = NULL };
>> >> >> >  static inline void set_page_guard(struct zone *zone, struct page *page,
>> >> >> >                                 unsigned int order, int migratetype) {}
>> >> >> >  static inline void clear_page_guard(struct zone *zone, struct page *page,
>> >> >> > diff --git a/net/atm/lec.c b/net/atm/lec.c
>> >> >> > index cd3b379..977a3c9 100644
>> >> >> > --- a/net/atm/lec.c
>> >> >> > +++ b/net/atm/lec.c
>> >> >> > @@ -111,9 +111,9 @@ static inline void lec_arp_put(struct lec_arp_table *entry)
>> >> >> >  }
>> >> >> >
>> >> >> >  static struct lane2_ops lane2_ops = {
>> >> >> > -       lane2_resolve,          /* resolve,             spec 3.1.3 */
>> >> >> > -       lane2_associate_req,    /* associate_req,       spec 3.1.4 */
>> >> >> > -       NULL                    /* associate indicator, spec 3.1.5 */
>> >> >> > +       .resolve = lane2_resolve,
>> >> >> > +       .associate_req = lane2_associate_req,
>> >> >> > +       .associate_indicator = NULL
>> >> >> >  };
>> >> >> >
>> >> >> >  static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
>> >> >> > diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
>> >> >> > index 9e60e74..637c96e 100644
>> >> >> > --- a/net/atm/mpoa_caches.c
>> >> >> > +++ b/net/atm/mpoa_caches.c
>> >> >> > @@ -535,30 +535,29 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
>> >> >> >
>> >> >> >
>> >> >> >  static const struct in_cache_ops ingress_ops = {
>> >> >> > -       in_cache_add_entry,               /* add_entry       */
>> >> >> > -       in_cache_get,                     /* get             */
>> >> >> > -       in_cache_get_with_mask,           /* get_with_mask   */
>> >> >> > -       in_cache_get_by_vcc,              /* get_by_vcc      */
>> >> >> > -       in_cache_put,                     /* put             */
>> >> >> > -       in_cache_remove_entry,            /* remove_entry    */
>> >> >> > -       cache_hit,                        /* cache_hit       */
>> >> >> > -       clear_count_and_expired,          /* clear_count     */
>> >> >> > -       check_resolving_entries,          /* check_resolving */
>> >> >> > -       refresh_entries,                  /* refresh         */
>> >> >> > -       in_destroy_cache                  /* destroy_cache   */
>> >> >> > +       .add_entry = in_cache_add_entry,
>> >> >> > +       .get = in_cache_get,
>> >> >> > +       .get_with_mask = in_cache_get_with_mask,
>> >> >> > +       .get_by_vcc = in_cache_get_by_vcc,
>> >> >> > +       .put = in_cache_put,
>> >> >> > +       .remove_entry = in_cache_remove_entry,
>> >> >> > +       .cache_hit = cache_hit,
>> >> >> > +       .clear_count = clear_count_and_expired,
>> >> >> > +       .check_resolving = check_resolving_entries,
>> >> >> > +       .refresh = refresh_entries,
>> >> >> >  };
>> >> >> >
>> >> >> >  static const struct eg_cache_ops egress_ops = {
>> >> >> > -       eg_cache_add_entry,               /* add_entry        */
>> >> >> > -       eg_cache_get_by_cache_id,         /* get_by_cache_id  */
>> >> >> > -       eg_cache_get_by_tag,              /* get_by_tag       */
>> >> >> > -       eg_cache_get_by_vcc,              /* get_by_vcc       */
>> >> >> > -       eg_cache_get_by_src_ip,           /* get_by_src_ip    */
>> >> >> > -       eg_cache_put,                     /* put              */
>> >> >> > -       eg_cache_remove_entry,            /* remove_entry     */
>> >> >> > -       update_eg_cache_entry,            /* update           */
>> >> >> > -       clear_expired,                    /* clear_expired    */
>> >> >> > -       eg_destroy_cache                  /* destroy_cache    */
>> >> >> > +       .add_entry = eg_cache_add_entry,
>> >> >> > +       .get_by_cache_id = eg_cache_get_by_cache_id,
>> >> >> > +       .get_by_tag = eg_cache_get_by_tag,
>> >> >> > +       .get_by_vcc = eg_cache_get_by_vcc,
>> >> >> > +       .get_by_src_ip = eg_cache_get_by_src_ip,
>> >> >> > +       .put = eg_cache_put,
>> >> >> > +       .remove_entry = eg_cache_remove_entry,
>> >> >> > +       .update = update_eg_cache_entry,
>> >> >> > +       .clear_expired = clear_expired,
>> >> >> > +       .destroy_cache = eg_destroy_cache
>> >> >> >  };
>> >> >> >
>> >> >> >
>> >> >> > diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
>> >> >> > index fd8cf02..1406db4 100644
>> >> >> > --- a/net/vmw_vsock/vmci_transport_notify.c
>> >> >> > +++ b/net/vmw_vsock/vmci_transport_notify.c
>> >> >> > @@ -662,19 +662,19 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
>> >> >> >
>> >> >> >  /* Socket control packet based operations. */
>> >> >> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
>> >> >> > -       vmci_transport_notify_pkt_socket_init,
>> >> >> > -       vmci_transport_notify_pkt_socket_destruct,
>> >> >> > -       vmci_transport_notify_pkt_poll_in,
>> >> >> > -       vmci_transport_notify_pkt_poll_out,
>> >> >> > -       vmci_transport_notify_pkt_handle_pkt,
>> >> >> > -       vmci_transport_notify_pkt_recv_init,
>> >> >> > -       vmci_transport_notify_pkt_recv_pre_block,
>> >> >> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
>> >> >> > -       vmci_transport_notify_pkt_recv_post_dequeue,
>> >> >> > -       vmci_transport_notify_pkt_send_init,
>> >> >> > -       vmci_transport_notify_pkt_send_pre_block,
>> >> >> > -       vmci_transport_notify_pkt_send_pre_enqueue,
>> >> >> > -       vmci_transport_notify_pkt_send_post_enqueue,
>> >> >> > -       vmci_transport_notify_pkt_process_request,
>> >> >> > -       vmci_transport_notify_pkt_process_negotiate,
>> >> >> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
>> >> >> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
>> >> >> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
>> >> >> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
>> >> >> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
>> >> >> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
>> >> >> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
>> >> >> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
>> >> >> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
>> >> >> > +       .send_init = vmci_transport_notify_pkt_send_init,
>> >> >> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
>> >> >> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
>> >> >> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
>> >> >> > +       .process_request = vmci_transport_notify_pkt_process_request,
>> >> >> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
>> >> >> >  };
>> >> >> > diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
>> >> >> > index 21e591d..f3a0afc 100644
>> >> >> > --- a/net/vmw_vsock/vmci_transport_notify_qstate.c
>> >> >> > +++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
>> >> >> > @@ -420,19 +420,19 @@ vmci_transport_notify_pkt_send_pre_enqueue(
>> >> >> >
>> >> >> >  /* Socket always on control packet based operations. */
>> >> >> >  const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
>> >> >> > -       vmci_transport_notify_pkt_socket_init,
>> >> >> > -       vmci_transport_notify_pkt_socket_destruct,
>> >> >> > -       vmci_transport_notify_pkt_poll_in,
>> >> >> > -       vmci_transport_notify_pkt_poll_out,
>> >> >> > -       vmci_transport_notify_pkt_handle_pkt,
>> >> >> > -       vmci_transport_notify_pkt_recv_init,
>> >> >> > -       vmci_transport_notify_pkt_recv_pre_block,
>> >> >> > -       vmci_transport_notify_pkt_recv_pre_dequeue,
>> >> >> > -       vmci_transport_notify_pkt_recv_post_dequeue,
>> >> >> > -       vmci_transport_notify_pkt_send_init,
>> >> >> > -       vmci_transport_notify_pkt_send_pre_block,
>> >> >> > -       vmci_transport_notify_pkt_send_pre_enqueue,
>> >> >> > -       vmci_transport_notify_pkt_send_post_enqueue,
>> >> >> > -       vmci_transport_notify_pkt_process_request,
>> >> >> > -       vmci_transport_notify_pkt_process_negotiate,
>> >> >> > +       .socket_init = vmci_transport_notify_pkt_socket_init,
>> >> >> > +       .socket_destruct = vmci_transport_notify_pkt_socket_destruct,
>> >> >> > +       .poll_in = vmci_transport_notify_pkt_poll_in,
>> >> >> > +       .poll_out = vmci_transport_notify_pkt_poll_out,
>> >> >> > +       .handle_notify_pkt = vmci_transport_notify_pkt_handle_pkt,
>> >> >> > +       .recv_init = vmci_transport_notify_pkt_recv_init,
>> >> >> > +       .recv_pre_block = vmci_transport_notify_pkt_recv_pre_block,
>> >> >> > +       .recv_pre_dequeue = vmci_transport_notify_pkt_recv_pre_dequeue,
>> >> >> > +       .recv_post_dequeue = vmci_transport_notify_pkt_recv_post_dequeue,
>> >> >> > +       .send_init = vmci_transport_notify_pkt_send_init,
>> >> >> > +       .send_pre_block = vmci_transport_notify_pkt_send_pre_block,
>> >> >> > +       .send_pre_enqueue = vmci_transport_notify_pkt_send_pre_enqueue,
>> >> >> > +       .send_post_enqueue = vmci_transport_notify_pkt_send_post_enqueue,
>> >> >> > +       .process_request = vmci_transport_notify_pkt_process_request,
>> >> >> > +       .process_negotiate = vmci_transport_notify_pkt_process_negotiate,
>> >> >> >  };
>> >> >> > diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
>> >> >> > index a020920..55579f6 100644
>> >> >> > --- a/sound/synth/emux/emux_seq.c
>> >> >> > +++ b/sound/synth/emux/emux_seq.c
>> >> >> > @@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf
>> >> >> >   * MIDI emulation operators
>> >> >> >   */
>> >> >> >  static struct snd_midi_op emux_ops = {
>> >> >> > -       snd_emux_note_on,
>> >> >> > -       snd_emux_note_off,
>> >> >> > -       snd_emux_key_press,
>> >> >> > -       snd_emux_terminate_note,
>> >> >> > -       snd_emux_control,
>> >> >> > -       snd_emux_nrpn,
>> >> >> > -       snd_emux_sysex,
>> >> >> > +       .note_on = snd_emux_note_on,
>> >> >> > +       .note_off = snd_emux_note_off,
>> >> >> > +       .key_press = snd_emux_key_press,
>> >> >> > +       .note_terminate = snd_emux_terminate_note,
>> >> >> > +       .control = snd_emux_control,
>> >> >> > +       .nrpn = snd_emux_nrpn,
>> >> >> > +       .sysex = snd_emux_sysex,
>> >> >> >  };
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > 1.9.1
>> >> >> >
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Kees Cook
>> >> >> Chrome OS & Brillo Security
>> >> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Kees Cook
>> >> Chrome OS & Brillo Security
>> >>
>>
>>
>>
>> --
>> Kees Cook
>> Chrome OS & Brillo Security
>>



-- 
Kees Cook
Chrome OS & Brillo Security

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

* Re: [kernel-hardening] [RFC 0/3] Add struct randomization plugin
  2016-05-05 17:21 [kernel-hardening] [RFC 0/3] Add struct randomization plugin Michael Leibowitz
                   ` (3 preceding siblings ...)
  2016-05-05 18:26 ` [kernel-hardening] Re: [RFC 0/3] Add struct randomization plugin Kees Cook
@ 2016-10-07 15:40 ` David Sterba
  2016-10-07 16:39   ` Leibowitz, Michael
  4 siblings, 1 reply; 21+ messages in thread
From: David Sterba @ 2016-10-07 15:40 UTC (permalink / raw)
  To: kernel-hardening; +Cc: spender, keescook, re.emese, pageexec, michael.leibowitz

Hi,

On Thu, May 05, 2016 at 10:21:06AM -0700, Michael Leibowitz wrote:
> This patch set ports over grsecurity's structure randomization
> feature.  The plugin is largely unchanged from grsecurity, with some
> porting to go over Emese Revfy's v7 patch set for gcc plugin
> infrastructure.  This is an RFC.
> 
> Although this set of changes does not directly make exploitation
> harder, when a number of structures are randomized, it will make it
> difficult to splat many relevant structures without knowing the exact
> build of the kernel the target is using.  While for one structure,
> there are limited number of guesses required, in aggregate, this can
> be a large obstacle for exploitation.
> 
> Patch 3 is a grab bag that probably needs to be broken up, although
> I'm not sure of the best way to do so.  Breaking by subsystem would
> seem to make an unwieldy patch set.
> 
> Known TODO that is not addressed as part of this patch set:
>   * tag security relevant structures for randomization
>   * add checkpatch checking for non-C99 initialization
>   * automated testing of randomization
>   * better description and examples of exploits effectively mitigated
>     by this feature
> 
> Tagging of structures to be randomized will come in subsequent series
> of patches.

may I ask what's the status of this patchset? As 4.8 now contains the
plugin infrastructure, which I really like to see happening, we could
add the remaining plugins. I'm specifically interested in the struct
layout randomization.

In your initial RFC, the patch 3/3 touches a lot of subsystems, which
means potentially dealing with many maintainers. As the patch is a
prerequsite for unmodified randstrcut plugin, I think this would stall
the inclusion for a long time.

The plugin detects "structs with function pointers only" and
automatically adds the randomization. I suggest to start without this
particular feature, and avoid dependency on patch 3/3.

Only the explicit randomize_layout attributes would actually do
something. That way the patches could be submitted separately, with it's
own reasoning. See the grsecruity patch for examples.

This is not perfect compared to the full featured plugin but I think the
proposed way is better than waiting until all issues from patch 3/3 are
fixed.

I'm willing to help and push things forward, but as you've submitted the
patches I'm asking first.

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

* Re: [kernel-hardening] [RFC 0/3] Add struct randomization plugin
  2016-10-07 15:40 ` [kernel-hardening] " David Sterba
@ 2016-10-07 16:39   ` Leibowitz, Michael
  2016-10-07 17:07     ` Kees Cook
  0 siblings, 1 reply; 21+ messages in thread
From: Leibowitz, Michael @ 2016-10-07 16:39 UTC (permalink / raw)
  To: kernel-hardening; +Cc: Brad Spengler, Kees Cook, Emese Revfy, PaX Team

On Fri, Oct 7, 2016 at 8:40 AM, David Sterba <dave@jikos.cz> wrote:
> Hi,
>
> On Thu, May 05, 2016 at 10:21:06AM -0700, Michael Leibowitz wrote:
>> This patch set ports over grsecurity's structure randomization
>> feature.  The plugin is largely unchanged from grsecurity, with some
>> porting to go over Emese Revfy's v7 patch set for gcc plugin
>> infrastructure.  This is an RFC.
>>
>> Although this set of changes does not directly make exploitation
>> harder, when a number of structures are randomized, it will make it
>> difficult to splat many relevant structures without knowing the exact
>> build of the kernel the target is using.  While for one structure,
>> there are limited number of guesses required, in aggregate, this can
>> be a large obstacle for exploitation.
>>
>> Patch 3 is a grab bag that probably needs to be broken up, although
>> I'm not sure of the best way to do so.  Breaking by subsystem would
>> seem to make an unwieldy patch set.
>>
>> Known TODO that is not addressed as part of this patch set:
>>   * tag security relevant structures for randomization
>>   * add checkpatch checking for non-C99 initialization
>>   * automated testing of randomization
>>   * better description and examples of exploits effectively mitigated
>>     by this feature
>>
>> Tagging of structures to be randomized will come in subsequent series
>> of patches.
>
> may I ask what's the status of this patchset? As 4.8 now contains the
> plugin infrastructure, which I really like to see happening, we could
> add the remaining plugins. I'm specifically interested in the struct
> layout randomization.

I'm afraid to say that it got stalled as life moved on.  I saw the 4.8
merge and I have renewed ambition.

> In your initial RFC, the patch 3/3 touches a lot of subsystems, which
> means potentially dealing with many maintainers. As the patch is a
> prerequsite for unmodified randstrcut plugin, I think this would stall
> the inclusion for a long time.
>
> The plugin detects "structs with function pointers only" and
> automatically adds the randomization. I suggest to start without this
> particular feature, and avoid dependency on patch 3/3.
>
> Only the explicit randomize_layout attributes would actually do
> something. That way the patches could be submitted separately, with it's
> own reasoning. See the grsecruity patch for examples.

This is an excellent idea.  I'm trying that out right now.

> This is not perfect compared to the full featured plugin but I think the
> proposed way is better than waiting until all issues from patch 3/3 are
> fixed.
>
> I'm willing to help and push things forward, but as you've submitted the
> patches I'm asking first.

Thanks for the push.  I'll give it another try and see if I can a
patch set out.  If I get diverted, though, I'll give you a holler.

Cheers



-- 
Michael Leibowitz

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

* Re: [kernel-hardening] [RFC 0/3] Add struct randomization plugin
  2016-10-07 16:39   ` Leibowitz, Michael
@ 2016-10-07 17:07     ` Kees Cook
  0 siblings, 0 replies; 21+ messages in thread
From: Kees Cook @ 2016-10-07 17:07 UTC (permalink / raw)
  To: Leibowitz, Michael; +Cc: kernel-hardening, Brad Spengler, Emese Revfy, PaX Team

On Fri, Oct 7, 2016 at 9:39 AM, Leibowitz, Michael
<michael.leibowitz@intel.com> wrote:
> On Fri, Oct 7, 2016 at 8:40 AM, David Sterba <dave@jikos.cz> wrote:
>> Hi,
>>
>> On Thu, May 05, 2016 at 10:21:06AM -0700, Michael Leibowitz wrote:
>>> This patch set ports over grsecurity's structure randomization
>>> feature.  The plugin is largely unchanged from grsecurity, with some
>>> porting to go over Emese Revfy's v7 patch set for gcc plugin
>>> infrastructure.  This is an RFC.
>>>
>>> Although this set of changes does not directly make exploitation
>>> harder, when a number of structures are randomized, it will make it
>>> difficult to splat many relevant structures without knowing the exact
>>> build of the kernel the target is using.  While for one structure,
>>> there are limited number of guesses required, in aggregate, this can
>>> be a large obstacle for exploitation.
>>>
>>> Patch 3 is a grab bag that probably needs to be broken up, although
>>> I'm not sure of the best way to do so.  Breaking by subsystem would
>>> seem to make an unwieldy patch set.
>>>
>>> Known TODO that is not addressed as part of this patch set:
>>>   * tag security relevant structures for randomization
>>>   * add checkpatch checking for non-C99 initialization
>>>   * automated testing of randomization
>>>   * better description and examples of exploits effectively mitigated
>>>     by this feature
>>>
>>> Tagging of structures to be randomized will come in subsequent series
>>> of patches.
>>
>> may I ask what's the status of this patchset? As 4.8 now contains the
>> plugin infrastructure, which I really like to see happening, we could
>> add the remaining plugins. I'm specifically interested in the struct
>> layout randomization.
>
> I'm afraid to say that it got stalled as life moved on.  I saw the 4.8
> merge and I have renewed ambition.
>
>> In your initial RFC, the patch 3/3 touches a lot of subsystems, which
>> means potentially dealing with many maintainers. As the patch is a
>> prerequsite for unmodified randstrcut plugin, I think this would stall
>> the inclusion for a long time.
>>
>> The plugin detects "structs with function pointers only" and
>> automatically adds the randomization. I suggest to start without this
>> particular feature, and avoid dependency on patch 3/3.
>>
>> Only the explicit randomize_layout attributes would actually do
>> something. That way the patches could be submitted separately, with it's
>> own reasoning. See the grsecruity patch for examples.
>
> This is an excellent idea.  I'm trying that out right now.

Another approach would be to retain the feature, but make it a
separate patch from the main plugin patch. In other words, have the
series as:

- plugin itself (minus all-function-pointers)
- opt-in markings
- C99 changes
- out-out markings
- all-function-pointers plugin logic

>
>> This is not perfect compared to the full featured plugin but I think the
>> proposed way is better than waiting until all issues from patch 3/3 are
>> fixed.
>>
>> I'm willing to help and push things forward, but as you've submitted the
>> patches I'm asking first.
>
> Thanks for the push.  I'll give it another try and see if I can a
> patch set out.  If I get diverted, though, I'll give you a holler.

Excellent. If you get stalled out, I nominate David to continue the push. :)

Thanks!

-Kees

-- 
Kees Cook
Nexus Security

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

end of thread, other threads:[~2016-10-07 17:07 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-05 17:21 [kernel-hardening] [RFC 0/3] Add struct randomization plugin Michael Leibowitz
2016-05-05 17:21 ` [kernel-hardening] [RFC 1/3] Add struct randomizing plugin Michael Leibowitz
2016-05-05 21:00   ` [kernel-hardening] " Brad Spengler
2016-05-06 21:58     ` Leibowitz, Michael
2016-05-05 17:21 ` [kernel-hardening] [RFC 2/3] Enable the RANDSTRUCT plugin Michael Leibowitz
2016-05-05 18:15   ` [kernel-hardening] " Kees Cook
2016-05-05 17:21 ` [kernel-hardening] [RFC 3/3] Change initialization C99 style; tag no_ramdomize_layout structs Michael Leibowitz
2016-05-05 18:17   ` [kernel-hardening] " Kees Cook
2016-05-05 19:46     ` Julia Lawall
2016-05-06 12:37     ` Julia Lawall
2016-06-13 14:32     ` Julia Lawall
2016-06-13 18:15       ` Kees Cook
2016-06-13 19:57         ` Julia Lawall
2016-06-13 20:26           ` Kees Cook
2016-06-13 20:30             ` Julia Lawall
2016-06-13 20:34               ` Kees Cook
2016-06-13 20:28         ` Leibowitz, Michael
2016-05-05 18:26 ` [kernel-hardening] Re: [RFC 0/3] Add struct randomization plugin Kees Cook
2016-10-07 15:40 ` [kernel-hardening] " David Sterba
2016-10-07 16:39   ` Leibowitz, Michael
2016-10-07 17:07     ` Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.