Re: [PATCH] Fix blktrace setup 32-bit ioctl on 64-bit kernels

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jens Axboe <jens.axboe@...>
Cc: <linux-kernel@...>, <abhishekrai@...>, Linus Torvalds <torvalds@...>, <davem@...>
Date: Wednesday, October 3, 2007 - 5:34 am

On Tuesday 02 October 2007, Jens Axboe wrote:

The sizes are ok now, but I still don't like the idea of adding more
stuff to fs/compat_ioctl.c. I also noticed another problem now, see below.

The preferred way to define compat_ioctl handlers is to use a ->compat_ioctl
file operation so you don't need any code in compat_ioctl.c at all.
You still need the #ifdef in blktrace.c though if you want to building extra
code on the architectures that don't need it.


You are dereferencing 'buts' here, which is a user space pointer. This is
broken and cannot work on architectures that have split kernel/user address
spaces, and a potential security hole on those that don't.
sparse would warn about this kind of bug, but of course one of the problems
with fs/compat_ioctl.c is that it isn't sparse clean in the first place.


Same here, this needs to be copy_in_user.

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

Messages in current thread:
Re: [PATCH] Fix blktrace setup 32-bit ioctl on 64-bit kernels, Arnd Bergmann, (Wed Oct 3, 5:34 am)