Skip to content

Commit

Permalink
alpha: unbreak OSF/1 (a.out) binaries
Browse files Browse the repository at this point in the history
OSF/1 brk(2) was broken by following one-liner in sys_brk()
(commit 4cc6028):

-	if (brk < mm->end_code)
+	if (brk < mm->start_brk)
		goto out;

The problem is that osf_set_program_attributes()
does update mm->end_code, but not mm->start_brk,
which still contains inappropriate value left from
binary loader, so brk() always fails.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ivan Kokshaysky authored and Linus Torvalds committed Apr 24, 2008
1 parent 72cff12 commit 2444e56
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/alpha/kernel/osf_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len,
lock_kernel();
mm = current->mm;
mm->end_code = bss_start + bss_len;
mm->start_brk = bss_start + bss_len;
mm->brk = bss_start + bss_len;
#if 0
printk("set_program_attributes(%lx %lx %lx %lx)\n",
Expand Down

0 comments on commit 2444e56

Please sign in to comment.