Bug 39062
Summary: | drivers/cdrom: dvd_read_manufact() returns Input/output error | ||
---|---|---|---|
Product: | IO/Storage | Reporter: | ale.goujon |
Component: | Other | Assignee: | io_other |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | akpm, axboe |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.39 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
A simple testcase
drivers-cdrom-cdromc-relax-check-on-dvd-manufacturer-value.patch |
Description
ale.goujon
2011-07-09 14:12:16 UTC
We can't just increase the 2048 - that would cause the memcpy to overflow struct dvd_manufact and scribble on memory. I don't think we even use dvd_manufact for anything. I did a patch to truncate the field to 2048 bytes. Please test it? Created attachment 65362 [details]
drivers-cdrom-cdromc-relax-check-on-dvd-manufacturer-value.patch
the patch
I applied the patch against linux-2.6.39.3 (the last stable release). Now, when I run the testcase, I get (as expected) Got len 2048, value ' ' (with value = 2048 spaces ) and in dmesg [ 167.425005] cdrom: Received invalid manufacture info length (2050): truncating to 2048 So the patch works, yay ! I don't know if it can be included for the soon-to-be-released 3.0 linux kernel but whatever, I will ask Ubuntu kernel maintainers if they can backport this minor change. Now, I will try to get wine fixed. Thanks for your work guys, it's always a pleasure to run a linux-based OS. NB: I didn't change the status of this bug as the patch is not yet merged. Any update on this patch ? I received an e-mail saying it was merged and so removed from the -mm-tree but if I check latest linus tree [1], the code is still the same. Can someone tell me on what tree the patch was applied ? Is there any chance it will be merged in the final 3.1 kernel ? Thanks --- http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/cdrom/cdrom.c;hb=HEAD#l1932 I just checked and the patch has been committed in linus tree [1] apparently on Aug. 2 and so will be in the final 3.1 kernel. I can now mark this bug as resolved. Yay ! Thank you guys. --- [1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=aec9f377e4f235c47e27fd8a429555dfa2dda342 |