avoid Oops in net/core/dev.c

avoid Oops in net/core/dev.c

Post by Dan Alon » Sun, 29 Jun 2003 15:00:53



Linus, please apply.
Patrick, please read on.

This fixes the kernel crash in the case when we do an SIOCSIFNAME
ioctl on /proc/net/dev to rename a network interface, and
we supply a string such as "foo%sbar".

BTW, I've seen more places of this phenomenon, but they
are not with strings that come right from userspace like
this one.

BTW2, the attempt to rename the device here doesn't affect
sysfs. Patrick, we need a class_device_* interface that does
this.

--- linux-2.5.73/net/core/dev.c 2003-06-27 10:46:59.000000000 +0300

                                return -EEXIST;
                        memcpy(dev->name, ifr->ifr_newname, IFNAMSIZ);
                        dev->name[IFNAMSIZ - 1] = 0;
-                       snprintf(dev->class_dev.class_id, BUS_ID_SIZE, dev->name);
+                       strlcpy(dev->class_dev.class_id, dev->name, BUS_ID_SIZE);
                        notifier_call_chain(&netdev_chain,
                                            NETDEV_CHANGENAME, dev);
                        return 0;

--
Dan Aloni

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

avoid Oops in net/core/dev.c

Post by Greg K » Sun, 29 Jun 2003 22:00:07



> BTW2, the attempt to rename the device here doesn't affect
> sysfs. Patrick, we need a class_device_* interface that does
> this.

That's a good idea (I'm the person to blame for the class_device code,
not Pat.)  Care to send a patch?

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

avoid Oops in net/core/dev.c

Post by Dan Alon » Sun, 29 Jun 2003 22:10:08




> > BTW2, the attempt to rename the device here doesn't affect
> > sysfs. Patrick, we need a class_device_* interface that does
> > this.

> That's a good idea (I'm the person to blame for the class_device code,
> not Pat.)  Care to send a patch?

I have no patch, but I thought of either using lookup_one_len()
and then d_move() to create a new dentry or to rip out some
code out of vfs_rename_dir(). Anyway, I'm no VFS expert, so
no patch any time soon.

--
Dan Aloni

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. Oops when accessing /proc/net/llc/core

Hi,

IIRC, this has been reported before. I get this message after a cat
/proc/net/llc/core on 2.5.44. No further oops or trace.

Unable to handle kernel paging request at virtual address 00000200001858c0
Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing

--jochen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. CD_Writing Problems with Yamaha 4260/Adaptec 1505

3. bug in /net/core/dev.c

4. user processes

5. net/core/dev.c:1465

6. filename bug in solaris 2.5

7. assertion (!atomic_read(&skb->users)) failed at net/core/dev.c (1524) in net_tx_action

8. Pine-3.91, and Linux 1.0.9 (lackware) problems

9. net/ipv4/*, net/core/neighbour.c jiffies cleanup

10. /proc/dev/net doesnt show all net device

11. /proc/dev/net doesnt show all net devices

12. avoiding core dump

13. Avoiding core from gmc?