Opened 9 years ago

Closed 8 years ago

#233 closed defect (fixed)

getsockname() and getpeername() fail when using high memory

Reported by: rudi Owned by: bird
Priority: normal Milestone: libc-0.6.5
Component: libc Version: 0.6.4
Severity: normal Keywords:
Cc:

Description

The functions getsockname() and getpeername() will fail, if the variable containing the size of "struct sockaddr" is located in high memory.

It is suggested not to pass the address of that variable directly to the IP stack but use an intermediate local instead.

See http://svn.netlabs.org/qt4/ticket/179#comment:4

Change History (12)

comment:1 Changed 9 years ago by bird

(In [3674]) libsocket: Made it possible to pass sockaddr parameters in high memory to accept, getsockname, bind, connect and getpeername. (untested) References #233.

comment:2 Changed 9 years ago by bird

(In [3675]) 0.6: Backporting 3674 - part 1. References #233.

comment:3 Changed 9 years ago by bird

Resolution: fixed
Status: newclosed

(In [3676]) 0.6: Backporting r3674 - part 2. Fixes #233.

comment:4 Changed 8 years ago by Silvan Scherrer

Resolution: fixed
Status: closedreopened

in my tests with samba and libc064 connect() still does not work when built with -Zhigh-mem

comment:5 Changed 8 years ago by Silvan Scherrer

Milestone: libc-0.6.4libc-0.6.5

comment:6 Changed 8 years ago by Silvan Scherrer

as a addition socketpair() doesn't work also when the fd is in high-mem

comment:7 Changed 8 years ago by Silvan Scherrer

see http://svn.netlabs.org/qt4/ticket/179 for a little testcase. sockname_fail.zip

comment:8 Changed 8 years ago by Silvan Scherrer

getpeername() always returns -1 now.
http://svn.netlabs.org/libc/changeset?reponame=&new=3674%40trunk%2Flibc%2Fsrc%2Flibsocket%2Fgetpeername.c&old=2446%40trunk%2Flibc%2Fsrc%2Flibsocket%2Fgetpeername.c
the LIBCLOG_RETURN_INT(rc); on line 48 was eliminated by accident i guess

comment:9 Changed 8 years ago by dmik

No, I guess it was eliminated on purpose, but the last statement should be LIBCLOG_RETURN_INT(rc);. Anyway, for the time being, the hot fix of libc_dll.lib is here ftp://ftp.netlabs.org/pub/odin/test/libc_dll_233_regression_fixed.zip.

comment:10 Changed 8 years ago by bird

Changesets r3745 and r3746 addresses the regressions. r3747 addresses the socketpair() high memory issue. (0.6 branch)

comment:11 Changed 8 years ago by bird

r3748 forward ports the changes to the trunk. Case closed.

comment:12 Changed 8 years ago by bird

Resolution: fixed
Status: reopenedclosed
Version: 0.6.4
Note: See TracTickets for help on using tickets.