* PATCH 2.5.2.6: fix netlink
@ 2002-01-01 23:39 Jeff Garzik
0 siblings, 0 replies; only message in thread
From: Jeff Garzik @ 2002-01-01 23:39 UTC (permalink / raw)
To: Linus Torvalds, Linux-Kernel list; +Cc: David S. Miller
[-- Attachment #1: Type: text/plain, Size: 359 bytes --]
Now my kernel builds. On to "make modules"... :)
netlink uses minor number as an index into an array, and correctly
checks to make sure array-OOB does not occur. So, this is patch is an
obvious one...
--
Jeff Garzik | Only so many songs can be sung
Building 1024 | with two lips, two lungs, and one tongue.
MandrakeSoft | - nomeansno
[-- Attachment #2: netlink.patch --]
[-- Type: text/plain, Size: 1727 bytes --]
diff -u -r1.1.1.1 netlink_dev.c
--- net/netlink/netlink_dev.c 2001/11/09 22:12:55 1.1.1.1
+++ net/netlink/netlink_dev.c 2002/01/01 23:20:06
@@ -41,7 +41,7 @@
static unsigned int netlink_poll(struct file *file, poll_table * wait)
{
- struct socket *sock = netlink_user[MINOR(file->f_dentry->d_inode->i_rdev)];
+ struct socket *sock = netlink_user[minor(file->f_dentry->d_inode->i_rdev)];
if (sock->ops->poll==NULL)
return 0;
@@ -56,7 +56,7 @@
size_t count, loff_t *pos)
{
struct inode *inode = file->f_dentry->d_inode;
- struct socket *sock = netlink_user[MINOR(inode->i_rdev)];
+ struct socket *sock = netlink_user[minor(inode->i_rdev)];
struct msghdr msg;
struct iovec iov;
@@ -80,7 +80,7 @@
size_t count, loff_t *pos)
{
struct inode *inode = file->f_dentry->d_inode;
- struct socket *sock = netlink_user[MINOR(inode->i_rdev)];
+ struct socket *sock = netlink_user[minor(inode->i_rdev)];
struct msghdr msg;
struct iovec iov;
@@ -105,7 +105,7 @@
static int netlink_open(struct inode * inode, struct file * file)
{
- unsigned int minor = MINOR(inode->i_rdev);
+ unsigned int minor = minor(inode->i_rdev);
struct socket *sock;
struct sockaddr_nl nladdr;
int err;
@@ -137,7 +137,7 @@
static int netlink_release(struct inode * inode, struct file * file)
{
- unsigned int minor = MINOR(inode->i_rdev);
+ unsigned int minor = minor(inode->i_rdev);
struct socket *sock;
sock = netlink_user[minor];
@@ -151,7 +151,7 @@
static int netlink_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
- unsigned int minor = MINOR(inode->i_rdev);
+ unsigned int minor = minor(inode->i_rdev);
int retval = 0;
if (minor >= MAX_LINKS)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-01-01 23:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-01 23:39 PATCH 2.5.2.6: fix netlink Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox