mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Dmitri Monakhov <dmonakhov@openvz.org>
Cc: linux-kernel@vger.kernel.org, jens.axboe@oracle.com
Subject: Re: [PATCH] loop: prevent get_user pages call from kernel thread(v2)
Date: Sun, 06 Jul 2008 13:40:44 +0200	[thread overview]
Message-ID: <87tzf3qlz7.fsf@basil.nowhere.org> (raw)
In-Reply-To: <1215278340-3509-1-git-send-email-dmonakhov@openvz.org> (Dmitri Monakhov's message of "Sat,  5 Jul 2008 21:19:00 +0400")

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


  reply	other threads:[~2008-07-06 11:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-05 17:19 Dmitri Monakhov
2008-07-06 11:40 ` Andi Kleen [this message]
2008-07-07  8:02   ` Dmitri Monakhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tzf3qlz7.fsf@basil.nowhere.org \
    --to=andi@firstfloor.org \
    --cc=dmonakhov@openvz.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome