kern/72920: linux emulation : path "prefixing" is not done on unix domain socket addresses

Andriy Gapon avg at icyb.net.ua
Wed Oct 20 05:00:51 PDT 2004


>Number:         72920
>Category:       kern
>Synopsis:       linux emulation : path "prefixing" is not done on unix domain socket addresses
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 20 12:00:50 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Andriy Gapon
>Release:        5.2.1-RELEASE-p11
>Organization:
>Environment:
5.2.1-RELEASE-p11 i386
>Description:
It seems that pathname "prefixing" is not performed for unix domain
socket calls in linux emulation e.g. "/compat/linux" prefix is never
tried to be prepended for bind() and connect() calls. 
When mixed with filesystem calls this leads to linux applications
failing in scenarios like this:


mkdir("/tmp/foo");
//this will create /compat/linux/tmp/foo/ directory

s = socket(AF_LOCAL, SOCK_DGRAM, PF_LOCAL);
strcpy(addr.sun_path, "/tmp/foo/bar");
addr.sun_family = AF_LOCAL;
bind(s, (struct sockaddr *) &addr, SUN_LEN(&addr));
//this will try to bind socket in /tmp/foo/ directory
//which does not exist

I have experinced this problem on FreeBSD 5.2.1 with two real-life
applications:
	oracle 9.2.0.4.0
	IBM WebSphere MQ 5.3

>How-To-Repeat:
Existence of this problem can be easily verified using a small program 
with the above code (make sure /tmp/foo directory is not existant).
>Fix:
fix should not be very hard to implement, but I'd prefer that someone more
familiar with the code would do it (someone who wrote the similar code for 
filesystem calls).
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list