Bug 200621

Summary: getxattr() with zero value makes strace call free on invalid pointer.
Product: [Fedora] Fedora Reporter: James Antill <james.antill>
Component: straceAssignee: Roland McGrath <roland>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: ldv
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 4.5.15-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-17 03:07:09 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:
Bug Depends On:    
Bug Blocks: 201088    
Attachments:
Description Flags
strace-4.5.14-alt-print_xattr_val.patch none

Description James Antill 2006-07-29 04:35:55 UTC
Description:
 getxattr()/lgetxattr() and presumably fgetxattr() make strace call free() on an
invalid pointer when they return 0 byte values. Eg.

% attr -s mime_type -V '' foo
Attribute "mime_type" set to a 0 byte value for foo:

% attr -g mime_type foo
Attribute "mime_type" had a 0 byte value for foo:

% strace attr -g mime_type foo
[...]
lgetxattr("j/src/and-httpd", "user.mime_type"*** glibc detected *** strace:
free(): invalid pointer: 0x082fa530 ***


How reproducible:
 Always

Comment 1 Dmitry V. Levin 2006-09-01 15:24:04 UTC
Created attachment 135384 [details]
strace-4.5.14-alt-print_xattr_val.patch

Proposed fix for the memory corruption bug.

Comment 2 Dmitry V. Levin 2006-11-26 11:41:32 UTC
Fixed upstream.

Comment 3 Roland McGrath 2007-01-11 11:15:14 UTC
these bugs are fixed upstream in the coming 4.5.15 release

Comment 4 Roland McGrath 2007-01-17 03:07:09 UTC
4.5.15 in rawhide and in updates for fc5 and fc6 fixes this.