public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Junfeng Yang <yjf@stanford.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [CHECKER]  Help Needed!
Date: Mon, 21 Apr 2003 11:23:07 +0200	[thread overview]
Message-ID: <3EA3B87B.60505@colorfullife.com> (raw)

Junfeng wrote:

>It seems to us that create_dev can only be called at boot time (the
>"__init" attribute), so devfs_name must be an untainted kernel pointer.
>The warning on line 437 isn't a real error.
>
>However, this pointer is finally passed into strncpy_from_user through the
>call chain [ sys_symlink (devfs_name, name) --> getname (oldname) -->
>do_getname(filename, _) --> strncpy_from_user (_, filename, _)].  Is it
>okay to call *_from_user functions with the second arguements untainted?
>What will access_ok(VERIFY_READ, src, 1) return?
>  
>
The copy_{to,from}_user functions can access either user or kernel space.
after set_fs(KERNEL_DS), they access kernel space, after 
set_fs(USER_DS), they access user space.

The initial boot thread starts with set_fs(KERNEL_DS), and is switched 
back to set_fs(USER_DS) in search_binary_handler (fs/exec.c), called 
during exec of /sbin/init.

--
    Manfred

P.S.: On i386, you can access both kernel and user space after 
set_fs(KERNEL_DS), or if you use __get_user() and bypass access_ok(). 
Thus the __get_user() in arch/i386/kernel/traps.c, function 
show_registers is correct. This is the only instance I'm aware of where 
this is used, and noone else should be doing that. It fails on other 
archs, e.g. on sparc.


             reply	other threads:[~2003-04-21  9:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-21  9:23 Manfred Spraul [this message]
2003-04-21 19:15 ` [CHECKER] Help Needed! Junfeng Yang
     [not found] <3EA3B87B.60505@colorfullife.com.suse.lists.linux.kernel>
2003-04-21 13:47 ` Andi Kleen
2003-04-21 15:40   ` Manfred Spraul
  -- strict thread matches above, loose matches on Subject: below --
2003-03-27 17:10 [CHECKER] potential dereference of user pointer errors Chris Wright
2003-04-21  7:49 ` [CHECKER] Help Needed! Junfeng Yang
2003-04-21 21:26   ` Chris Wright

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=3EA3B87B.60505@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yjf@stanford.edu \
    /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