All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Hudec <bulb@ucw.cz>
To: Om <okuttan@netd.com>
Cc: Rock Gordon <rockgordon@yahoo.com>,
	linux-kernel@vger.kernel.org, kernelnewbies@nl.linux.org,
	Bernd Petrovitsch <bernd@firmix.at>
Subject: Re: userspace vs. kernelspace address
Date: Sun, 30 Jan 2005 09:41:28 +0100	[thread overview]
Message-ID: <20050130084128.GA27925@vagabond> (raw)
In-Reply-To: <20050129042355.GA5527@netd.com>

[-- Attachment #1: Type: text/plain, Size: 1105 bytes --]

On Fri, Jan 28, 2005 at 20:23:55 -0800, Om wrote:
> On Fri, Jan 28, 2005 at 01:40:51PM -0800, Rock Gordon wrote:
> > Hi everbody,
> > 
> > Thanks for your replies.
> > 
> > However I think my copy_to_user and copy_from_user are
> > failing since the kernel-mode thread is copying data
> > into another process's address space, and I am not
> > sure how to do this. Do the get_fs() and set_fs()
> > combinations let you do that? If not, then how do I do
> My idea is on kernel thread is limited. But I think it is not possible to
> any userspace address from any kernel thread because they do not have access
> to it. Their proc_struct->mm field is empty.

Right. You can't access any user-space from kernel thread, because it
does not have any.

> I am not sure whether set_fs and get_fs help in this case.

Sure it can. set_fs(KERNEL_DS) sets things so, that if you pass kernel
address to copy_to/from_user, it will silently accept it and copy
to/from there.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-01-30  8:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050128075209.GA14153@vagabond>
2005-01-28 21:40 ` userspace vs. kernelspace address Rock Gordon
2005-01-29  4:23   ` Om
2005-01-30  8:41     ` Jan Hudec [this message]
2005-01-30 15:37   ` Bernd Petrovitsch

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=20050130084128.GA27925@vagabond \
    --to=bulb@ucw.cz \
    --cc=bernd@firmix.at \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=okuttan@netd.com \
    --cc=rockgordon@yahoo.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.