public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: bruce.holzrichter@monster.com
Cc: linux-kernel@vger.kernel.org, ak@muc.de
Subject: Re: my slab cache broken on sparc64
Date: Fri, 03 May 2002 20:07:47 -0700 (PDT)	[thread overview]
Message-ID: <20020503.200747.104775821.davem@redhat.com> (raw)
In-Reply-To: <61DB42B180EAB34E9D28346C11535A781780F9@nocmail101.ma.tmpw.net>

   From: "Holzrichter, Bruce" <bruce.holzrichter@monster.com>
   Date: Fri, 3 May 2002 22:15:56 -0500 

Your patch is buggy:

   +			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 the __get_user() fails, you will leave the kernel in the
KERNEL_DS segment.

Do it like this instead.

	int fault;
	mm_segment_t old_fs;

	...

	old_fs = get_fs();
	set_fs(KERNEL_DS);
	fault = __get_user(tmp, pc->name);
	set_fs(old_fs);

	if (fault) {
	...

  reply	other threads:[~2002-05-04  3:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-04  3:15 my slab cache broken on sparc64 Holzrichter, Bruce
2002-05-04  3:07 ` David S. Miller [this message]
2002-05-04  9:46   ` Roman Zippel
  -- strict thread matches above, loose matches on Subject: below --
2002-05-05 12:44 Holzrichter, Bruce
2002-05-04  1:54 Holzrichter, Bruce
2002-05-03 19:18 Holzrichter, Bruce
2002-05-03 21:05 ` David S. Miller
2002-05-03 22:58   ` Andi Kleen

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=20020503.200747.104775821.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=ak@muc.de \
    --cc=bruce.holzrichter@monster.com \
    --cc=linux-kernel@vger.kernel.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