Bug 506222
Summary: | memchr() with huge length returns unexpected NULL | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Petr Vandrovec <petr> |
Component: | glibc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | low | ||
Version: | rawhide | CC: | jake, jakub, rhel, schwab |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2009-07-24 09:35:07 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Petr Vandrovec
2009-06-16 07:01:33 UTC
Introduced in 2.10.1 by http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/x86_64/memchr.S.diff?cvsroot=glibc&r1=NONE&r2=1.1 It uses signed comparsion between number of characters processed (%rsi) and requested for processing (%rdx): cmp %rsi,%rdx jle xxx It means that memchr() with length argument over 2^63 will immediately fail these tests, returning NULL. Switching comparsions to unsigned (and depending on the fact that before %rsi can reach 2^63 process will be killed by #GP or #PF so there is no possibility of looping forever for length=-1..-15) seems to do the trick. Fixed in git so far. This is fixed in rawhide for quite sime time as well. |