public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: Jamie Garside <jamie.garside@york.ac.uk>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] /arch/microblaze/kernel/entry.S kernel 3.14 Fix crash when calling invalid syscall ID
Date: Mon, 23 Feb 2015 14:54:24 +0100	[thread overview]
Message-ID: <54EB3110.2070108@monstr.eu> (raw)
In-Reply-To: <CAC9v5qED72F7EjiYNXL1bd-c_QVKHvdWgJE3eJ5HwjdqfAqt8w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1659 bytes --]

Hi Jamie,

On 02/23/2015 02:43 PM, Jamie Garside wrote:
> There appears to be a couple of bugs in the initial syscall handler on
> Microblaze when passing an invalid syscall ID.
> 
> The code at line 351 should check for a syscall ID above __NR_syscalls,
> then jump to the error exit routine. In this case, _user_exception returns
> using the wrong register (r15 instead of r14), and doesn't clean up the
> stack, causing the running user-land to hang.
> 
> Additionally, it does not cause an error if the syscall ID is negative (as
> can be returned from do_syscall_trace_enter), causing the kernel to attempt
> to jump to an invalid syscall handler and cause a kernel oops.
> 
> This patch adds a check for negative syscall ID, and modifies the error
> exit to jump to ret_from_trap instead (as would happen after a successful
> syscall) to perform cleanup, returning -ENOSYS. I believe this should be
> safe in this condition.
> 
> This patch has been edited against the Linux 3.14 code, but a glance over
> the git logs shows this file has not been changed in the past two years,
> hence this patch should be safe for the most recent kernel version.

Please rebase it on the latest 4.0-rc1 kernel and send the patch via
git send-email with proper description and SoB line. Then I will look at it.

Thanks,
Michal


-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

      reply	other threads:[~2015-02-23 13:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 13:43 [PATCH] /arch/microblaze/kernel/entry.S kernel 3.14 Fix crash when calling invalid syscall ID Jamie Garside
2015-02-23 13:54 ` Michal Simek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54EB3110.2070108@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=jamie.garside@york.ac.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox