[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52EBE62E.70102@linux.intel.com>
Date: Fri, 31 Jan 2014 10:06:38 -0800
From: "H. Peter Anvin" <hpa@...ux.intel.com>
To: Dave Jones <davej@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: x86, x32: Correct invalid use of user timespec in the kernel
On 01/31/2014 09:50 AM, Dave Jones wrote:
> On Fri, Jan 31, 2014 at 02:54:53AM +0000, Linux Kernel wrote:
>
> > Commit: 2def2ef2ae5f3990aabdbe8a755911902707d268
> >
> > ...
> >
> > - if (get_compat_timespec(&ktspec, timeout))
> > + if (compat_get_timespec(&ktspec, timeout))
> > return -EFAULT;
> >
> > datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
> > flags | MSG_CMSG_COMPAT, &ktspec);
> > - if (datagrams > 0 && put_compat_timespec(&ktspec, timeout))
> > + if (datagrams > 0 && compat_put_timespec(&ktspec, timeout))
> > datagrams = -EFAULT;
> >
>
> Can we rename one of each of those functions ?
> It's not really surprising they got mixed up given they look so alike.
>
> It looks like an accident just waiting to happen again.
>
Very much so, I made the same comment.
My feeling is that {get,put}_compat_timespec() should at the very least
have leading underscores to flag it as a low-level function, but better
suggestions would be appreciated.
-hpa
--
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