LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: "Jan Engelhardt" <jengelh@linux01.gwdg.de>
Cc: congwen <congwen@gmail.com>, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: How can I create or read/write a file in linux device driver?
Date: Fri, 12 Jan 2007 11:54:33 +0100	[thread overview]
Message-ID: <9a8748490701120254x6a7dd93aw9dd75994af661f5e@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0701121139010.17236@yvahk01.tjqt.qr>

On 12/01/07, Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
>
> On Jan 12 2007 11:27, Jesper Juhl wrote:
> > On 12/01/07, congwen <congwen@gmail.com> wrote:
> >> Hello everyone, I want to create and read/write a file in Linux kernel or
> >> device driver,
> >
> > Don't read/write user space files from kernel space.
> >
> > Please search the archives, this get asked a lot and it has been
> > explained a million times why it's a bad idea.
> > You can also read http://www.linuxjournal.com/article/8110
>
> The article does it the bad way. IMHO filp_open() and
> vfs_read/vfs_write() are much less problematic wrt. to userspace.
> FWIW see
> ftp://ftp-1.gwdg.de/pub/linux/misc/suser-jengelh/kernel/quad_dsp-1.5.1.tar.bz2
>

There is no good way.  You simply should NOT do it.

-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

  reply	other threads:[~2007-01-12 10:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-12  7:47 congwen
2007-01-12 10:27 ` Jesper Juhl
2007-01-12 10:43   ` Jan Engelhardt
2007-01-12 10:54     ` Jesper Juhl [this message]
2007-01-12 10:59       ` Jan Engelhardt
2007-01-12 13:24   ` Erik Mouw
2007-01-12 14:27     ` linux-os (Dick Johnson)
2007-01-12 14:42       ` Erik Mouw
2007-01-12 22:31       ` Jan Engelhardt
2007-01-19 10:35       ` Helge Hafting

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=9a8748490701120254x6a7dd93aw9dd75994af661f5e@mail.gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=congwen@gmail.com \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: How can I create or read/write a file in linux device driver?' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).