linux-user emulation of setsockopt ignores optlen

Bug #1075339 reported by Bugdal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

setsockopt always treats the argument as a 4-byte int. This breaks timeout options (for which it's an 8- or 16-byte timeval structure, depending on word size) and possibly other socket options. int is probably a safe default, but options whose values are other types need special-case conversion code.

Revision history for this message
Peter Maydell (pmaydell) wrote :

Agreed; we would ideally be more careful to return ENOTSUP for options we don't know we handle correctly. It would be useful if you said which particular options you were interested in and provided a test case...

Revision history for this message
Bugdal (bugdal) wrote : Re: [Bug 1075339] Re: linux-user emulation of setsockopt ignores optlen

I mentioned the timeout options (send/receive timeout) which are the
ones I was interested in.

Revision history for this message
Peter Maydell (pmaydell) wrote :

We fixed our setsockopt emulation to correctly convert timeval parameters for SO_RCVTIMEO and SO_SNDTIMEO back in 2013.

Changed in qemu:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.