All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [patch] potential data-corruption fix in md.c
@ 2005-12-02  9:39 Jaco Kroon
  2005-12-02 17:38 ` Jesper Juhl
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jaco Kroon @ 2005-12-02  9:39 UTC (permalink / raw)
  To: kernel-janitors

Fix a check whereby a negative personality number passed to either
register_md_personality or unregister_md_personality could potentially
cause data corruption.

Signed off:  Jaco Kroon <jaco@kroon.co.za>

--- linux-2.6.14/drivers/md/md.c.orig	2005-12-02 11:31:59.000000000 +0200
+++ linux-2.6.14/drivers/md/md.c	2005-12-02 11:32:37.000000000 +0200
@@ -3425,7 +3425,7 @@

 int register_md_personality(int pnum, mdk_personality_t *p)
 {
-	if (pnum >= MAX_PERSONALITY) {
+	if (pnum < 0 || pnum >= MAX_PERSONALITY) {
 		printk(KERN_ERR
 		       "md: tried to install personality %s as nr %d, but max is %lu\n",
 		       p->name, pnum, MAX_PERSONALITY-1);
@@ -3446,7 +3446,7 @@

 int unregister_md_personality(int pnum)
 {
-	if (pnum >= MAX_PERSONALITY)
+	if (pnum < 0 || pnum >= MAX_PERSONALITY)
 		return -EINVAL;

 	printk(KERN_INFO "md: %s personality unregistered\n", pers[pnum]->name);

-- 
There are 10 kinds of people in the world, those who understand binary,
and those who don't.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-12-02 20:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-02  9:39 [KJ] [patch] potential data-corruption fix in md.c Jaco Kroon
2005-12-02 17:38 ` Jesper Juhl
2005-12-02 18:57 ` Alexey Dobriyan
2005-12-02 19:19 ` Jaco Kroon
2005-12-02 19:45 ` Håkon Løvdal
2005-12-02 20:48 ` Jaco Kroon

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.