LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jan Engelhardt <jengelh@linux01.gwdg.de>
To: Jesper Juhl <jesper.juhl@gmail.com>
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:43:02 +0100 (MET)	[thread overview]
Message-ID: <Pine.LNX.4.61.0701121139010.17236@yvahk01.tjqt.qr> (raw)
In-Reply-To: <9a8748490701120227h757d473ctaf5673aa318fe090@mail.gmail.com>


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


	-`J'
-- 

  reply	other threads:[~2007-01-12 10:43 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 [this message]
2007-01-12 10:54     ` Jesper Juhl
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=Pine.LNX.4.61.0701121139010.17236@yvahk01.tjqt.qr \
    --to=jengelh@linux01.gwdg.de \
    --cc=congwen@gmail.com \
    --cc=jesper.juhl@gmail.com \
    --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).