From: vinolin <vinolin@nodeinfotech.com>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: __get_user usage in mm/slab.c
Date: Tue, 12 Mar 2002 18:48:47 +0530 [thread overview]
Message-ID: <02031218484706.00886@Vinolin> (raw)
In-Reply-To: <Pine.LNX.4.21.0203121237070.19747-100000@serv>
In-Reply-To: <Pine.LNX.4.21.0203121237070.19747-100000@serv>
On Tuesday 12 March 2002 17:28, Roman Zippel wrote:
> Hi,
>
> The way __get_user is currently used in mm/slab.c is not portable. It
> breaks on arch which have seperate user/kernel memory space. It still
> works during boot or from kernel threads, but /proc/slabinfo shows only
> broken entries or if a module creates a slab cache, I got lots of
> warnings.
> We have to at least insert a "set_fs(get_fs())", but IMO a separate
> interface would be better. Any opinions?
>
> bye, Roman
Hi !
I guess u need to read user space from kernel sapce.
You can use the sys_call_table functions for this.
For example, u can use the following code in your file to open a user space
file from kernel space.
#define BEGIN_KMEM {mm_segment_t old_fs=get_fs();set_fs(get_ds());
#define END_KMEM set_fs(old_fs);}
int (*sample_open)(char *, int);
sample_open = sys_call_table[SYS_open];
BEGIN_KMEM
sample_open("/home/samplefile.txt",O_RDWR);
/* the same way close , read , write etc. can be written */
END_KMEM
Regards,
Vinolin.
next prev parent reply other threads:[~2002-03-12 13:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-12 11:58 __get_user usage in mm/slab.c Roman Zippel
2002-03-12 12:43 ` David S. Miller
2002-03-12 13:18 ` vinolin [this message]
2002-03-12 15:23 ` Andi Kleen
2002-03-12 15:25 ` David S. Miller
2002-03-12 16:32 ` Roman Zippel
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=02031218484706.00886@Vinolin \
--to=vinolin@nodeinfotech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zippel@linux-m68k.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