lkml.org 
[lkml]   [2002]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRE: my slab cache broken on sparc64
Date
>
>It would work if the access was surrounded by:
>
> old_fs = get_fs();
> set_fs(KERNEL_DS);
> ... get_user(kernel_pointer) ...
> set_fs (old_fs);
>
>But it is not.

For what it's worth to you, the below patch fixes this issue, at least on my
box. I have patched and tested on my Ultra5. Thanks for the help!

Bruce H.

--- linus-2.5/mm/slab.c Wed May 1 08:38:46 2002
+++ sparctest/mm/slab.c Fri May 3 22:59:24 2002
@@ -846,11 +846,14 @@
/* This happens when the module gets unloaded and
doesn't
destroy its slab cache and noone else reuses the
vmalloc
area of the module. Print a warning. */
+ mm_segment_t old_fs = get_fs();
+ set_fs(KERNEL_DS);
if (__get_user(tmp,pc->name)) {
printk("SLAB: cache with size %d has lost
its name\n",
pc->objsize);
continue;
- }
+ }
+ set_fs(old_fs);
if (!strcmp(pc->name,name)) {
printk("kmem_cache_create: duplicate cache
%s\n",name);
up(&cache_chain_sem);
@@ -1963,10 +1966,13 @@

name = cachep->name;
{
- char tmp;
+ char tmp;
+ mm_segment_t old_fs = get_fs();
+ set_fs(KERNEL_DS);
if (__get_user(tmp, name))
- name = "broken";
- }
+ name = "broken";
+ set_fs(old_fs);
+ }

seq_printf(m, "%-17s %6lu %6lu %6u %4lu %4lu %4u",
name, active_objs, num_objs, cachep->objsize,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.312 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site