google / gvisor

Application Kernel for Containers
https://gvisor.dev
Apache License 2.0
15.85k stars 1.3k forks source link

GetSockOpt system-call handler needs refactoring to improve Linux parity #1007

Closed iyermi closed 11 months ago

iyermi commented 5 years ago

The GetSockOpt() syscall handler (in syscalls/linux/sys_socket.go) can be improved to address varying lengths of data copies, including less than int-sized copies. Currently it relies on the binary.Size() of the returned buffer from netstack to CopyOut(). This forces the netstack handlers to handle different size cases separately for each option, which otherwise can be handled by the caller across all options.

This helps with keeping up with Linux parity as in net/ipv6/ipv6_sockglue.c::do_ipv6_getsockopt() and net/ipv4/ip_sockglue.c::do_ip_getsockopt().

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 1 year ago

A friendly reminder that this issue had no activity for 120 days.

github-actions[bot] commented 11 months ago

This issue has been closed due to lack of activity.