[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4198de61002030752u24ae20bbt2c09dc9d1c141503@mail.gmail.com>
Date: Wed, 3 Feb 2010 10:52:54 -0500
From: Matt Turner <mattst88@...il.com>
To: Roel Kluin <roel.kluin@...il.com>
Cc: Richard Henderson <rth@...ddle.net>,
Ivan Kokshaysky <ink@...assic.park.msu.ru>,
linux-alpha@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] alpha: PTR_ERR overwrites -EINVAL in syscall osf_mount
On Wed, Feb 3, 2010 at 10:49 AM, Roel Kluin <roel.kluin@...il.com> wrote:
> The initial -EINVAL value is overwritten by `retval = PTR_ERR(name)'.
> If this isn't an error pointer and typenr is not 1, 6 or 9, then
> this retval, a pointer cast to a long, is returned.
>
> Signed-off-by: Roel Kluin <roel.kluin@...il.com>
> ---
> Was this intended? Not sure whether this can occur, found by code
> analysis.
>
> diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
> index 62619f2..53c213f 100644
> --- a/arch/alpha/kernel/osf_sys.c
> +++ b/arch/alpha/kernel/osf_sys.c
> @@ -361,7 +361,7 @@ osf_procfs_mount(char *dirname, struct procfs_args __user *args, int flags)
> SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path,
> int, flag, void __user *, data)
> {
> - int retval = -EINVAL;
> + int retval;
> char *name;
>
> name = getname(path);
> @@ -379,6 +379,7 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path,
> retval = osf_procfs_mount(name, data, flag);
> break;
> default:
> + retval = -EINVAL;
> printk("osf_mount(%ld, %x)\n", typenr, flag);
> }
> putname(name);
>
Looks like a bug to me as well. Can anyone else confirm?
Matt Turner
--
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