Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbbBWNyh (ORCPT ); Mon, 23 Feb 2015 08:54:37 -0500 Received: from mail-oi0-f51.google.com ([209.85.218.51]:63965 "EHLO mail-oi0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752655AbbBWNyf (ORCPT ); Mon, 23 Feb 2015 08:54:35 -0500 Message-ID: <54EB3110.2070108@monstr.eu> Date: Mon, 23 Feb 2015 14:54:24 +0100 From: Michal Simek Reply-To: monstr@monstr.eu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jamie Garside , linux-kernel@vger.kernel.org Subject: Re: [PATCH] /arch/microblaze/kernel/entry.S kernel 3.14 Fix crash when calling invalid syscall ID References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xugWUAUc7G1MLK3VPk7NcNMRAHsLA8S40" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2519 Lines: 75 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xugWUAUc7G1MLK3VPk7NcNMRAHsLA8S40 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > 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 retu= rns > using the wrong register (r15 instead of r14), and doesn't clean up the= > stack, causing the running user-land to hang. >=20 > 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 att= empt > to jump to an invalid syscall handler and cause a kernel oops. >=20 > 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 successf= ul > syscall) to perform cleanup, returning -ENOSYS. I believe this should b= e > safe in this condition. >=20 > This patch has been edited against the Linux 3.14 code, but a glance ov= er > 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 --=20 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 --xugWUAUc7G1MLK3VPk7NcNMRAHsLA8S40 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAlTrMREACgkQykllyylKDCGlUgCfR6lsc7fJ5dM+aJ+8hx0JC2Vl BIAAoJO0FmRroIu1y5r5oyUr8EwV+xJn =PObm -----END PGP SIGNATURE----- --xugWUAUc7G1MLK3VPk7NcNMRAHsLA8S40-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/