Bug #31566 | my_write(fd, 0x0, 0, flags) fails with EFAULT on some platforms | ||
---|---|---|---|
Submitted: | 12 Oct 2007 14:23 | Modified: | 20 Dec 2007 0:38 |
Reporter: | Axel Schwenke | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 5.0.46 | OS: | Linux ( ) |
Assigned to: | Alexey Kopytov | CPU Architecture: | Any |
Tags: | bfsm_2007_10_18 |
[12 Oct 2007 14:23]
Axel Schwenke
[12 Oct 2007 15:50]
Konstantin Osipov
Chad, please treat this as a community contribution.
[15 Oct 2007 15:45]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/35578 ChangeSet@1.2535, 2007-10-15 19:44:58+04:00, kaa@polly.(none) +1 -0 Fix for bug #31566: my_write(fd, 0x0, 0, flags) fails with EFAULT on some platforms Since the behavior of write(fd, buf, 0) is undefined, it may fail with EFAULT on some architectures when buf == NULL. The error was propagated up to a caller, since my_write() code did not handle it properly. Fixed by checking the 'number of bytes' argument in my_write() and returning before calling the write() system call when there is nothing to write.
[24 Oct 2007 17:16]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/36287 ChangeSet@1.2535, 2007-10-24 21:16:20+04:00, kaa@polly.(none) +1 -0 Fix for bug #31566: my_write(fd, 0x0, 0, flags) fails with EFAULT on some platforms Since the behavior of write(fd, buf, 0) is undefined, it may fail with EFAULT on some architectures when buf == NULL. The error was propagated up to a caller, since my_write() code did not handle it properly. Fixed by checking the 'number of bytes' argument in my_write() and returning before calling the write() system call when there is nothing to write.
[25 Oct 2007 4:57]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/36317 ChangeSet@1.2551, 2007-10-25 08:19:57+04:00, kaa@polly.(none) +1 -0 Replaced 'return' with DBUG_RETURN() in the fix for bug #31566.
[7 Dec 2007 23:08]
Bugs System
Pushed into 6.0.5-alpha
[7 Dec 2007 23:09]
Bugs System
Pushed into 5.1.23-rc
[7 Dec 2007 23:10]
Bugs System
Pushed into 5.0.54
[20 Dec 2007 0:38]
Paul DuBois
Noted in 5.0.54, 5.1.23, 6.0.5 changelogs. The internal my_write() function was made more robust against non-portable behavior of the write() system call for a buffer length of 0.