Merge branch 'for-next/gcc-plugin/structleak' into for-next/gcc-plugins
authorKees Cook <keescook@chromium.org>
Mon, 7 Aug 2017 20:29:04 +0000 (13:29 -0700)
committerKees Cook <keescook@chromium.org>
Mon, 7 Aug 2017 20:29:04 +0000 (13:29 -0700)
arch/Kconfig
drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
drivers/net/wan/z85230.c
scripts/gcc-plugins/randomize_layout_plugin.c

index 0f1621489bf00c87baecf311114f7939670ff58c..596f0e66e69f61797829da46b1e846ceffcc8642 100644 (file)
@@ -480,11 +480,13 @@ config GCC_PLUGIN_RANDSTRUCT
        depends on GCC_PLUGINS
        select MODVERSIONS if MODULES
        help
-         If you say Y here, the layouts of structures explicitly
-         marked by __randomize_layout will be randomized at
-         compile-time.  This can introduce the requirement of an
-         additional information exposure vulnerability for exploits
-         targeting these structure types.
+         If you say Y here, the layouts of structures that are entirely
+         function pointers (and have not been manually annotated with
+         __no_randomize_layout), or structures that have been explicitly
+         marked with __randomize_layout, will be randomized at compile-time.
+         This can introduce the requirement of an additional information
+         exposure vulnerability for exploits targeting these structure
+         types.
 
          Enabling this feature will introduce some performance impact,
          slightly increase memory usage, and prevent the use of forensic
index 4c7f430b36eba81ab13d76932bcabec2b5e50ff7..8e6cfd89c7e0480b592ac83f03df67356999540d 100644 (file)
@@ -308,8 +308,8 @@ static int rv_tf_set_num_active_display(struct pp_hwmgr *hwmgr, void *input,
 }
 
 static const struct phm_master_table_item rv_set_power_state_list[] = {
-       { NULL, rv_tf_set_clock_limit },
-       { NULL, rv_tf_set_num_active_display },
+       { .tableFunction = rv_tf_set_clock_limit },
+       { .tableFunction = rv_tf_set_num_active_display },
        { }
 };
 
@@ -382,7 +382,7 @@ static int rv_tf_disable_gfx_off(struct pp_hwmgr *hwmgr,
 }
 
 static const struct phm_master_table_item rv_disable_dpm_list[] = {
-       {NULL, rv_tf_disable_gfx_off},
+       { .tableFunction = rv_tf_disable_gfx_off },
        { },
 };
 
@@ -407,7 +407,7 @@ static int rv_tf_enable_gfx_off(struct pp_hwmgr *hwmgr,
 }
 
 static const struct phm_master_table_item rv_enable_dpm_list[] = {
-       {NULL, rv_tf_enable_gfx_off},
+       { .tableFunction = rv_tf_enable_gfx_off },
        { },
 };
 
index 2f0bd6955f3398d65a4a71177fa8bbd56b446825..deea41e96f0183e7d6d1b10ee029e1aa0f50c523 100644 (file)
@@ -483,11 +483,10 @@ static void z8530_status(struct z8530_channel *chan)
        write_zsctrl(chan, RES_H_IUS);
 }
 
-struct z8530_irqhandler z8530_sync =
-{
-       z8530_rx,
-       z8530_tx,
-       z8530_status
+struct z8530_irqhandler z8530_sync = {
+       .rx = z8530_rx,
+       .tx = z8530_tx,
+       .status = z8530_status,
 };
 
 EXPORT_SYMBOL(z8530_sync);
@@ -605,15 +604,15 @@ static void z8530_dma_status(struct z8530_channel *chan)
 }
 
 static struct z8530_irqhandler z8530_dma_sync = {
-       z8530_dma_rx,
-       z8530_dma_tx,
-       z8530_dma_status
+       .rx = z8530_dma_rx,
+       .tx = z8530_dma_tx,
+       .status = z8530_dma_status,
 };
 
 static struct z8530_irqhandler z8530_txdma_sync = {
-       z8530_rx,
-       z8530_dma_tx,
-       z8530_dma_status
+       .rx = z8530_rx,
+       .tx = z8530_dma_tx,
+       .status = z8530_dma_status,
 };
 
 /**
@@ -678,11 +677,10 @@ static void z8530_status_clear(struct z8530_channel *chan)
        write_zsctrl(chan, RES_H_IUS);
 }
 
-struct z8530_irqhandler z8530_nop=
-{
-       z8530_rx_clear,
-       z8530_tx_clear,
-       z8530_status_clear
+struct z8530_irqhandler z8530_nop = {
+       .rx = z8530_rx_clear,
+       .tx = z8530_tx_clear,
+       .status = z8530_status_clear,
 };
 
 
index cdaac8c66734b05971c4e4476b73f9572aa936e3..0073af326449864b4da5f7a64677c0de2d5eafa2 100644 (file)
@@ -436,9 +436,6 @@ static int is_pure_ops_struct(const_tree node)
 
        gcc_assert(TREE_CODE(node) == RECORD_TYPE || TREE_CODE(node) == UNION_TYPE);
 
-       /* XXX: Do not apply randomization to all-ftpr structs yet. */
-       return 0;
-
        for (field = TYPE_FIELDS(node); field; field = TREE_CHAIN(field)) {
                const_tree fieldtype = get_field_type(field);
                enum tree_code code = TREE_CODE(fieldtype);