[packages] uftp: update to 4.1.4
[openwrt/svn-archive/archive.git] / net / strongswan / patches / 001-upstream-runtime-fix.patch
1 From: Martin Willi <martin@revosec.ch>
2 Date: Fri, 3 May 2013 12:17:37 +0000 (+0200)
3 Subject: In memwipe_check(), don't put magic on stack when calling do_magic()
4 X-Git-Url: http://git.strongswan.org/?p=strongswan.git;a=commitdiff_plain;h=9312fbc7
5
6 In memwipe_check(), don't put magic on stack when calling do_magic()
7
8 Otherwise the magic might be on the stack while checking it.
9 ---
10
11 --- a/src/libstrongswan/library.c
12 +++ b/src/libstrongswan/library.c
13 @@ -154,7 +154,7 @@ static bool equals(char *a, char *b)
14 * Write magic to memory, and try to clear it with memwipe()
15 */
16 __attribute__((noinline))
17 -static void do_magic(int magic, int **stack)
18 +static void do_magic(int *magic, int **stack)
19 {
20 int buf[32], i;
21
22 @@ -162,7 +162,7 @@ static void do_magic(int magic, int **st
23 *stack = &i;
24 for (i = 0; i < countof(buf); i++)
25 {
26 - buf[i] = magic;
27 + buf[i] = *magic;
28 }
29 /* passing buf to dbg should make sure the compiler can't optimize out buf.
30 * we use directly dbg(3), as DBG3() might be stripped with DEBUG_LEVEL. */
31 @@ -177,7 +177,7 @@ static bool check_memwipe()
32 {
33 int magic = 0xCAFEBABE, *ptr, *deeper, i, stackdir = 1;
34
35 - do_magic(magic, &deeper);
36 + do_magic(&magic, &deeper);
37
38 ptr = &magic;
39 if (deeper < ptr)