]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Fix pktcdvd ioctl dev_minor range check
authorDan Rosenberg <drosenberg@vsecurity.com>
Mon, 27 Sep 2010 16:30:28 +0000 (12:30 -0400)
committerWilly Tarreau <w@1wt.eu>
Sat, 30 Apr 2011 14:53:03 +0000 (16:53 +0200)
commit2f3213da33d1afa7e11b4c18b40068d32bde1713
tree90384a0491151107717f15405f5aaf262cd94689
parent95dbe336d30e9356c20fc37f6351a0d0c17ad790
Fix pktcdvd ioctl dev_minor range check

commit 252a52aa4fa22a668f019e55b3aac3ff71ec1c29 upstream.

The PKT_CTRL_CMD_STATUS device ioctl retrieves a pointer to a
pktcdvd_device from the global pkt_devs array.  The index into this
array is provided directly by the user and is a signed integer, so the
comparison to ensure that it falls within the bounds of this array will
fail when provided with a negative index.

This can be used to read arbitrary kernel memory or cause a crash due to
an invalid pointer dereference.  This can be exploited by users with
permission to open /dev/pktcdvd/control (on many distributions, this is
readable by group "cdrom").

Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
[ Rather than add a cast, just make the function take the right type -Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/block/pktcdvd.c