Skip to contentSkip to conversation

2.6.17-rc4-mm1

DISCUSSION Tilman Schmidt 1 participant 1 message May 18, 2006 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Tilman Schmidt

author Acked-by
#2 lore raw
Quoted 11 lines · Jesper Juhl

In the isdn-unsafe-interaction-between-isdn_write-and-isdn_writebuf_stub.patch patch, which is currently in -mm there's a bug.

This bit :
- copy_from_user(skb_put(skb, len), buf, len);
+ if (!copy_from_user(skb_put(skb, len), buf, len))
should really be :
- copy_from_user(skb_put(skb, len), buf, len);
+ if (copy_from_user(skb_put(skb, len), buf, len))
Somehow a stray "!" crept in there.

Ouch. I hadn't noticed that either. Sorry about that.

Strangely, I ran a system with that patch for quite some time, actually doing all kinds of ISDN connections without ever noticing any ill effects. I can only conclude that the affected codebranch was never exercised, which makes me suspect it is dead, or at least pining for the fjords. Looking closer, I can't help noticing that the only branch calling the affected function isdn_writebuf_stub() starts out with:

	printk(KERN_WARNING "isdn_write minor %d obsolete!\n", minor);

So I guess it really doesn't make much difference one way or the other. But it's certainly more correct that way, so:

Quoted 1 line
Quoted 11 lines
drivers/isdn/i4l/isdn_common.c +1 -1
@@ -1952,7 +1952,7 @@ isdn_writebuf_stub(int drvidx, int chan,
 	if (!skb)
 		return -ENOMEM;
 	skb_reserve(skb, hl);
-	if (!copy_from_user(skb_put(skb, len), buf, len))
+	if (copy_from_user(skb_put(skb, len), buf, len))
 		return -EFAULT;
 	ret = dev->drv[drvidx]->interface->writebuf_skb(drvidx, chan, 1, skb);
 	if (ret <= 0)
Signature · 4 lines
Tilman Schmidt                          E-Mail: [email protected]
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)