diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-29 21:10:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-29 21:10:36 -0500 |
commit | 6e3eed9850064e38a98851ff91534bb32438b292 (patch) | |
tree | f7311219b84f7073255c6f8255946c6fbe693e52 | |
parent | ceb5eb0cb3fe61d488aa76aba748409775a56daa (diff) | |
parent | 05dfdbbd678ea2b642db73f48b75667a23d15484 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
lguest: Fix a memory leak with the lg object during launcher close
lguest: disable the FORTIFY for lguest.
lguest: typos fix
-rw-r--r-- | Documentation/lguest/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/lguest/boot.c | 4 | ||||
-rw-r--r-- | drivers/lguest/core.c | 2 | ||||
-rw-r--r-- | drivers/lguest/lguest_user.c | 5 |
4 files changed, 6 insertions, 7 deletions
diff --git a/Documentation/lguest/Makefile b/Documentation/lguest/Makefile index 725eef81cd48..1f4f9e888bd1 100644 --- a/Documentation/lguest/Makefile +++ b/Documentation/lguest/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | # This creates the demonstration utility "lguest" which runs a Linux guest. | 1 | # This creates the demonstration utility "lguest" which runs a Linux guest. |
2 | CFLAGS:=-Wall -Wmissing-declarations -Wmissing-prototypes -O3 -I../../include -I../../arch/x86/include | 2 | CFLAGS:=-Wall -Wmissing-declarations -Wmissing-prototypes -O3 -I../../include -I../../arch/x86/include -U_FORTIFY_SOURCE |
3 | LDLIBS:=-lz | 3 | LDLIBS:=-lz |
4 | 4 | ||
5 | all: lguest | 5 | all: lguest |
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index a7ed208f81e3..92f1c6f3e19d 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -931,7 +931,7 @@ static void lguest_restart(char *reason) | |||
931 | * that we can fit comfortably. | 931 | * that we can fit comfortably. |
932 | * | 932 | * |
933 | * First we need assembly templates of each of the patchable Guest operations, | 933 | * First we need assembly templates of each of the patchable Guest operations, |
934 | * and these are in lguest_asm.S. */ | 934 | * and these are in i386_head.S. */ |
935 | 935 | ||
936 | /*G:060 We construct a table from the assembler templates: */ | 936 | /*G:060 We construct a table from the assembler templates: */ |
937 | static const struct lguest_insns | 937 | static const struct lguest_insns |
@@ -1093,7 +1093,7 @@ __init void lguest_init(void) | |||
1093 | acpi_ht = 0; | 1093 | acpi_ht = 0; |
1094 | #endif | 1094 | #endif |
1095 | 1095 | ||
1096 | /* We set the perferred console to "hvc". This is the "hypervisor | 1096 | /* We set the preferred console to "hvc". This is the "hypervisor |
1097 | * virtual console" driver written by the PowerPC people, which we also | 1097 | * virtual console" driver written by the PowerPC people, which we also |
1098 | * adapted for lguest's use. */ | 1098 | * adapted for lguest's use. */ |
1099 | add_preferred_console("hvc", 0, NULL); | 1099 | add_preferred_console("hvc", 0, NULL); |
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c index 90663e01a56e..60156dfdc608 100644 --- a/drivers/lguest/core.c +++ b/drivers/lguest/core.c | |||
@@ -224,7 +224,7 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user) | |||
224 | break; | 224 | break; |
225 | 225 | ||
226 | /* If the Guest asked to be stopped, we sleep. The Guest's | 226 | /* If the Guest asked to be stopped, we sleep. The Guest's |
227 | * clock timer or LHCALL_BREAK from the Waker will wake us. */ | 227 | * clock timer or LHREQ_BREAK from the Waker will wake us. */ |
228 | if (cpu->halted) { | 228 | if (cpu->halted) { |
229 | set_current_state(TASK_INTERRUPTIBLE); | 229 | set_current_state(TASK_INTERRUPTIBLE); |
230 | schedule(); | 230 | schedule(); |
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c index 34bc017b8b3c..b8ee103eed5f 100644 --- a/drivers/lguest/lguest_user.c +++ b/drivers/lguest/lguest_user.c | |||
@@ -307,9 +307,8 @@ static int close(struct inode *inode, struct file *file) | |||
307 | * kmalloc()ed string, either of which is ok to hand to kfree(). */ | 307 | * kmalloc()ed string, either of which is ok to hand to kfree(). */ |
308 | if (!IS_ERR(lg->dead)) | 308 | if (!IS_ERR(lg->dead)) |
309 | kfree(lg->dead); | 309 | kfree(lg->dead); |
310 | /* We clear the entire structure, which also marks it as free for the | 310 | /* Free the memory allocated to the lguest_struct */ |
311 | * next user. */ | 311 | kfree(lg); |
312 | memset(lg, 0, sizeof(*lg)); | ||
313 | /* Release lock and exit. */ | 312 | /* Release lock and exit. */ |
314 | mutex_unlock(&lguest_lock); | 313 | mutex_unlock(&lguest_lock); |
315 | 314 | ||