lkml.org 
[lkml]   [2008]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] loop: prevent get_user pages call from kernel thread(v2)
From
Date
Dmitri Monakhov <dmonakhov@openvz.org> writes:

> Yes... everybody know that it is bad to write from kernel thread, and it is
> madness to do it with O_DIRECT. But occasionly file with O_DIRECT flag
> may be passed to loop device via LOOP_SET_FD. So if file-system has't
> address_space ops, or simply hide it like GFS, it is possible to kill kernel
> via two lines program. In fact we can't effectively guard kernel space by
> deny O_DIRECT in loop's code, because user space can set it via
> fcntl(,F_SETFL,). Let's simply add sanity check mm related logic.

Wouldn't it be better if loop simply dup()ed the file descriptor
and then checked the flag? Presumably other fd flags could
do bad things inside loop too.

-Andi



\
 
 \ /
  Last update: 2008-07-06 13:45    [W:0.032 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site