Skip to contentSkip to conversation

Null dereference in socket.c

DISCUSSION Chuck Ebbert 3 participants 3 messages Sep 28, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

After debugging an oops (https://bugzilla.redhat.com/attachment.cgi?id=209231)
I find it happens here in socket.c::sock_ioctl() line 902:

default:
=============> err = sock->ops->ioctl(sock, cmd, arg);

                        /*
                         * If this ioctl is unknown try to hand it down
                         * to the NIC driver.
                         */
                        if (err == -ENOIOCTLCMD)
                                err = dev_ioctl(cmd, argp);
                        break;

ioctl is NULL and the kernel jumps to address 0. Should we add a check for that?

Bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=306801

maintainer
#1 lore raw

From: Chuck Ebbert <[email protected]>
Date: Fri, 28 Sep 2007 18:58:36 -0400

Quoted 15 lines

After debugging an oops (https://bugzilla.redhat.com/attachment.cgi?id=209231)
I find it happens here in socket.c::sock_ioctl() line 902:

default:
=============> err = sock->ops->ioctl(sock, cmd, arg);

                        /*
                         * If this ioctl is unknown try to hand it down
                         * to the NIC driver.
                         */
                        if (err == -ENOIOCTLCMD)
                                err = dev_ioctl(cmd, argp);
                        break;
Quoted 5 lines

ioctl is NULL and the kernel jumps to address 0. Should we add a check for that?

Bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=306801

Every protocol should provide a non-NULL ->ioctl() method, find out which one isn't and fix it.

#2 lore raw
Quoted 18 lines · On Fri, 28 Sep 2007 16:00:57 -0700 (PDT) David Miller <[email protected]>…

From: Chuck Ebbert <[email protected]>
Date: Fri, 28 Sep 2007 18:58:36 -0400

Quoted 15 lines

After debugging an oops (https://bugzilla.redhat.com/attachment.cgi?id=209231)
I find it happens here in socket.c::sock_ioctl() line 902:

default:
=============> err = sock->ops->ioctl(sock, cmd, arg);

                        /*
                         * If this ioctl is unknown try to hand it down
                         * to the NIC driver.
                         */
                        if (err == -ENOIOCTLCMD)
                                err = dev_ioctl(cmd, argp);
                        break;
Quoted 8 lines
Quoted 5 lines

ioctl is NULL and the kernel jumps to address 0. Should we add a check for that?

Bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=306801

Every protocol should provide a non-NULL ->ioctl() method, find out which one isn't and fix it

Auditing the net-2.6.24 tree all instances found by cscope are safe.

Signature · 1 line
Stephen Hemminger <[email protected]>