Re: [PATCH v2] drivers/media/video/v4l2-compat-ioctl32.c: Check the return value of copy_to_user

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Arnd Bergmann
Date: Wednesday, December 22, 2010 - 8:50 am

On Wednesday 22 December 2010 15:14:49 Andreas Oberritter wrote:

No, that's fine. compat_alloc_user_space() is very special -- the allocated
memory is on the user stack and automatically gets freed when the kernel
returns to user space.

We treat the resulting pointer like any other user pointer, i.e. we only
ever access it using {get,put}_user and copy_{from,to}_user, which check
that it's pointing to real user memory. A null pointer here would only
mean that the user had an invalid stack pointer before entering the kernel,
but causes no more problems than passing NULL as the ioctl argument.

	Arnd
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] drivers/media/video/v4l2-compat-ioctl32.c: Che ..., Mauro Carvalho Chehab, (Tue Dec 21, 4:55 pm)
Re: [PATCH v2] drivers/media/video/v4l2-compat-ioctl32.c: ..., Andreas Oberritter, (Wed Dec 22, 7:14 am)
Re: [PATCH v2] drivers/media/video/v4l2-compat-ioctl32.c: ..., Arnd Bergmann, (Wed Dec 22, 8:50 am)