Reported by Marcus Meissner to the Kernel Bugzilla: http://bugzilla.kernel.org/show_bug.cgi?id=2966 The dvd_read_bca() function in drivers/cdrom/cdrom.c shows a potential buffer overflow. The variable buf[4+188] is allocated on the stack, however cgc.cmd[9] and cgc.buflen are set to 255: cgc.cmd[9] = cgc.buflen = 0xff; This can be exploited by a custom made USB Storage device and used for local privilege escalation (aka plug-in this USB device to get root). This function has been introduced in 2.2.16 (back in 2000) and as of today it hasn't changed. Jens Axboe confirmed that this is a typo and it should read: cgc.cmd[9] = cgc.buflen & 0xff; It is to mask high bits of the length. It doesn't use the high 8 bits for transfer length, since we are always < 256 for this case.
Created attachment 131920 [details] Proposed patch from Jens Axboe
committed in stream E5 build 42.0.1. A test kernel with this patch is available from http://people.redhat.com/~jbaron/rhel4/
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2006-0617.html
committed in stream U5 build 42.4. A test kernel with this patch is available from http://people.redhat.com/~jbaron/rhel4/