lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTi=ZVzfoBixM8YdXa82FLAWyKcKjz0_qbo5ThuDa@mail.gmail.com>
Date:	Fri, 15 Oct 2010 22:24:44 -0600
From:	Shane McDonald <mcdonald.shane@...il.com>
To:	Al Viro <viro@....linux.org.uk>
Cc:	ralf@...ux-mips.org, linux-kernel@...r.kernel.org,
	linux-arch@...r.kernel.org
Subject: Re: [PATCH 3/5] mips: sanitize restart logics

On Tue, Sep 28, 2010 at 11:50 AM, Al Viro <viro@....linux.org.uk> wrote:
>
> Put the original syscall number into ->regs[0] when we leave syscall
> with error.  Use it in restart logics.  Everything else will have
> it 0 since we pass through SAVE_SOME on all the ways in.  Note that
> in places like bad_stack and inllegal_syscall we leave it 0 - it's
> not restartable.
>
> Signed-off-by: Al Viro <viro@...iv.linux.org.uk>

Building 2.6.36-rc8 on a 32-bit mipsel system gives me
the following compile failure:

  LD      .tmp_vmlinux1
arch/mips/built-in.o:/home/shane/linux-mips.org/linux/arch/mips/kernel/scall32-o32.S:66:
undefined reference to `PR_R2'
arch/mips/built-in.o:/home/shane/linux-mips.org/linux/arch/mips/kernel/scall32-o32.S:66:
undefined reference to `PR_R2'
make: *** [.tmp_vmlinux1] Error 1

I tracked it down to this patch.  In particular, I believe the change
to scall32-o32.S is causing the problem.

> diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
> index 17202bb..d3edb9f 100644
> --- a/arch/mips/kernel/scall32-o32.S
> +++ b/arch/mips/kernel/scall32-o32.S
> @@ -63,9 +63,9 @@ stack_done:
>        sw      t0, PT_R7(sp)           # set error flag
>        beqz    t0, 1f
>
> +       lw      t1, PR_R2(sp)           # syscall number

Should this be PT_R2(sp), rather than PR_R2(sp)?

>        negu    v0                      # error
> -       sw      v0, PT_R0(sp)           # set flag for syscall
> -                                       # restarting
> +       sw      t1, PT_R0(sp)           # save it for syscall restarting
>  1:     sw      v0, PT_R2(sp)           # result
>
>  o32_syscall_exit:
> @@ -104,9 +104,9 @@ syscall_trace_entry:
>        sw      t0, PT_R7(sp)           # set error flag
>        beqz    t0, 1f
>
> +       lw      t1, PT_R2(sp)           # syscall number
>        negu    v0                      # error
> -       sw      v0, PT_R0(sp)           # set flag for syscall
> -                                       # restarting
> +       sw      t1, PT_R0(sp)           # save it for syscall restarting
>  1:     sw      v0, PT_R2(sp)           # result
>
>        j       syscall_exit
> @@ -170,7 +170,6 @@ stackargs:
>         */
>  bad_stack:
>        negu    v0                              # error
> -       sw      v0, PT_R0(sp)
>        sw      v0, PT_R2(sp)
>        li      t0, 1                           # set error flag
>        sw      t0, PT_R7(sp)

Changing PR_R2(sp) to PT_R2(sp) allows me to compile
and successfully boot 2.6.36-rc8.  I'll whip up a quick patch
to make this change and submit it.

Shane
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ