diff options
Diffstat (limited to '2.6.32')
-rw-r--r-- | 2.6.32/0000_README | 2 | ||||
-rw-r--r-- | 2.6.32/4420_grsecurity-2.9.1-2.6.32.59-201208151950.patch (renamed from 2.6.32/4420_grsecurity-2.9.1-2.6.32.59-201208132029.patch) | 47 |
2 files changed, 35 insertions, 14 deletions
diff --git a/2.6.32/0000_README b/2.6.32/0000_README index df11424..1250ead 100644 --- a/2.6.32/0000_README +++ b/2.6.32/0000_README @@ -30,7 +30,7 @@ Patch: 1058_linux-2.6.32.59.patch From: http://www.kernel.org Desc: Linux 2.6.32.59 -Patch: 4420_grsecurity-2.9.1-2.6.32.59-201208132029.patch +Patch: 4420_grsecurity-2.9.1-2.6.32.59-201208151950.patch From: http://www.grsecurity.net Desc: hardened-sources base patch from upstream grsecurity diff --git a/2.6.32/4420_grsecurity-2.9.1-2.6.32.59-201208132029.patch b/2.6.32/4420_grsecurity-2.9.1-2.6.32.59-201208151950.patch index 1d2b332..ad50ae4 100644 --- a/2.6.32/4420_grsecurity-2.9.1-2.6.32.59-201208132029.patch +++ b/2.6.32/4420_grsecurity-2.9.1-2.6.32.59-201208151950.patch @@ -69106,7 +69106,7 @@ index f539204..068db1f 100644 fput(tfile); diff --git a/fs/exec.c b/fs/exec.c -index 86fafc6..a9275f4 100644 +index 86fafc6..25f0d1a 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -56,12 +56,33 @@ @@ -69838,9 +69838,9 @@ index 86fafc6..a9275f4 100644 +#endif + +#ifdef CONFIG_PAX_SIZE_OVERFLOW -+void report_size_overflow(const char *file, unsigned int line, const char *func) ++void report_size_overflow(const char *file, unsigned int line, const char *func, const char *ssa_name) +{ -+ printk(KERN_ERR "PAX: size overflow detected in function %s %s:%u\n", func, file, line); ++ printk(KERN_ERR "PAX: size overflow detected in function %s %s:%u %s", func, file, line, ssa_name); + dump_stack(); + do_group_exit(SIGKILL); +} @@ -113560,10 +113560,10 @@ index 0000000..42bbc4f +_002415_hash acl_alloc_num 1-2 60778 _002415_hash NULL diff --git a/tools/gcc/size_overflow_plugin.c b/tools/gcc/size_overflow_plugin.c new file mode 100644 -index 0000000..5af42b5 +index 0000000..41e11e1 --- /dev/null +++ b/tools/gcc/size_overflow_plugin.c -@@ -0,0 +1,1558 @@ +@@ -0,0 +1,1579 @@ +/* + * Copyright 2011, 2012 by Emese Revfy <re.emese@gmail.com> + * Licensed under the GPL v2, or (at your option) v3 @@ -113632,7 +113632,7 @@ index 0000000..5af42b5 +static tree get_size_overflow_type(gimple stmt, tree node); + +static struct plugin_info size_overflow_plugin_info = { -+ .version = "20120811beta", ++ .version = "20120815beta", + .help = "no-size-overflow\tturn off size overflow checking\n", +}; + @@ -114309,6 +114309,27 @@ index 0000000..5af42b5 + return true; +} + ++static bool is_a_cast_and_const_overflow(tree no_const_rhs) ++{ ++ tree rhs1, lhs, rhs1_type, lhs_type; ++ enum machine_mode lhs_mode, rhs_mode; ++ gimple def_stmt = get_def_stmt(no_const_rhs); ++ ++ if (!gimple_assign_cast_p(def_stmt)) ++ return false; ++ ++ rhs1 = gimple_assign_rhs1(def_stmt); ++ lhs = gimple_get_lhs(def_stmt); ++ rhs1_type = TREE_TYPE(rhs1); ++ lhs_type = TREE_TYPE(lhs); ++ rhs_mode = TYPE_MODE(rhs1_type); ++ lhs_mode = TYPE_MODE(lhs_type); ++ if (TYPE_UNSIGNED(lhs_type) == TYPE_UNSIGNED(rhs1_type) || lhs_mode != rhs_mode) ++ return false; ++ ++ return true; ++} ++ +static tree handle_unary_rhs(struct pointer_set_t *visited, bool *potentionally_overflowed, gimple stmt) +{ + tree size_overflow_type, lhs = gimple_get_lhs(stmt); @@ -114350,8 +114371,10 @@ index 0000000..5af42b5 + change_rhs1(stmt, new_rhs1); + check_size_overflow(stmt, size_overflow_type, new_rhs1, rhs1, potentionally_overflowed, BEFORE_STMT); + ++ rhs1 = gimple_assign_rhs1(stmt); ++ rhs1_type = TREE_TYPE(rhs1); + if (TYPE_UNSIGNED(rhs1_type) != TYPE_UNSIGNED(lhs_type)) -+ return create_assign(visited, potentionally_overflowed, stmt, lhs, AFTER_STMT); ++ return create_assign(visited, potentionally_overflowed, stmt, rhs1, AFTER_STMT); + + if (!check_mode_type(stmt)) + return create_assign(visited, potentionally_overflowed, stmt, lhs, AFTER_STMT); @@ -114448,11 +114471,8 @@ index 0000000..5af42b5 + current_func = build_string(NAME_LEN(current_function_decl) + 1, NAME(current_function_decl)); + current_func = create_string_param(current_func); + -+ if (min) -+ snprintf(ssa_name_buf, 100, "%s_%u (min)\n", NAME(SSA_NAME_VAR(arg)), SSA_NAME_VERSION(arg)); -+ else -+ snprintf(ssa_name_buf, 100, "%s_%u (max)\n", NAME(SSA_NAME_VAR(arg)), SSA_NAME_VERSION(arg)); -+ ssa_name = build_string(100, ssa_name_buf); ++ snprintf(ssa_name_buf, sizeof(ssa_name_buf), "%s_%u (%s)\n", NAME(SSA_NAME_VAR(arg)), SSA_NAME_VERSION(arg), min ? "min" : "max"); ++ ssa_name = build_string(sizeof(ssa_name_buf), ssa_name_buf); + ssa_name = create_string_param(ssa_name); + + // void report_size_overflow(const char *file, unsigned int line, const char *func, const char *ssa_name) @@ -114589,7 +114609,8 @@ index 0000000..5af42b5 + if (gimple_assign_rhs_code(def_stmt) == MIN_EXPR) + return dup_assign(visited, potentionally_overflowed, def_stmt, size_overflow_type, new_rhs1, new_rhs2, NULL_TREE); + -+ check_size_overflow(def_stmt, size_overflow_type, var_rhs, orig_rhs, potentionally_overflowed, BEFORE_STMT); ++ if (!is_a_cast_and_const_overflow(orig_rhs)) ++ check_size_overflow(def_stmt, size_overflow_type, var_rhs, orig_rhs, potentionally_overflowed, BEFORE_STMT); + + new_rhs = change_assign_rhs(def_stmt, orig_rhs, var_rhs); + gimple_assign_set_rhs(def_stmt, new_rhs); |