bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pflocal getsockname not working with payload


From: Samuel Thibault
Subject: pflocal getsockname not working with payload
Date: Fri, 14 Aug 2015 00:03:33 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Hello,

X11 authentication is currently broken, because pflocal's implementation
of getsockname is broken.  It seems to happen since the enabling of
payload optimization.

I have attached a simple testcase: in glibc getsockname()
calls socket_name() which returns a port, and then calls
socket_whatis_address() on that port.  In pflocal, that turns into
calling sock_get_addr() which eventually calls addr_create which creates
a port in the addr_port_class.  Then socket_whatis_address is called, but
addr is NULL, i.e. the lookup failed...

I've added a call to mach_port_clear_protected_payload to disable the
payload optimization for those addr ports, and it then works nicely.

Also, I had to disable the msgh_bits and msgh_protected_payload
mangling, otherwise pflocal was completely not working, I'm not sure
what these bits were useful for actually.

Thoughts?
Samuel

Attachment: test.c
Description: Text document

Attachment: disable-payload-pflocal.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]