Skip to contentSkip to conversation

linux-user emulation of setsockopt ignores optlen

Qemu-devel Bugdal 2 participants 4 messages Nov 5, 2012 – Jun 17, 2016

lore
Share & tools
lore

Bugdal

author
#0 lore raw

Public bug reported:

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.

** Affects: qemu
Importance: Undecided
Status: New

Signature · 19 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1075339

Title:
  linux-user emulation of setsockopt ignores optlen

Status in QEMU:
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1075339/+subscriptions
#1 lore raw

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...

Signature · 19 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1075339

Title:
  linux-user emulation of setsockopt ignores optlen

Status in QEMU:
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1075339/+subscriptions
author
#2 lore raw

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

Signature · 19 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1075339

Title:
  linux-user emulation of setsockopt ignores optlen

Status in QEMU:
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1075339/+subscriptions
#3 lore raw
In reply to Bugdal

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

Signature · 19 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1075339

Title:
  linux-user emulation of setsockopt ignores optlen

Status in QEMU:
  Fix Released

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1075339/+subscriptions