[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.02.1203201812260.2542@ionos>
Date: Wed, 21 Mar 2012 11:09:41 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Sasikantha babu <sasikanth.v19@...il.com>
cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] setitimer : Return -EFAULT if the user pointer
"value" is NULL
On Tue, 20 Mar 2012, Sasikantha babu wrote:
> Return -EFAULT if user pointer "value" is NULL.
In principle I agree, though this might break exisiting user space as
this behaviour has been there since Linux 1.1.52
So the right thing to do is to add a WARN_ONCE() in the else path and
schedule the removal of this "feature" for v3.6
> diff --git a/kernel/itimer.c b/kernel/itimer.c
> index 22000c3..f356bdf 100644
> --- a/kernel/itimer.c
> +++ b/kernel/itimer.c
> @@ -279,19 +279,18 @@ SYSCALL_DEFINE3(setitimer, int, which, struct itimerval __user *, value,
> struct itimerval __user *, ovalue)
> {
> struct itimerval set_buffer, get_buffer;
> - int error;
> + int error = -EFAULT;
Instead of ripping the whole thing apart, it's way simpler to just do
if (!value)
return -EFAULT;
Thanks,
tglx
--
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