linux_dsm_epyc7002/tools/usb/usbip/src
Nobuo Iwata 220c61b6f7 usbip: deletion of incorrect socket descriptor checking
This patch removes checking of socket descriptor value in daemons.

It was checked to be less than FD_SETSIZE(1024 usually) but it's not
correct.

To be exact, the maximum value of descriptor comes from
rlimit(RLIMIT_NOFILE).

Following kernel code determines the value :
    get_unused_fd_flags() : fs/files.c
    __alloc_fd() : fs/files.c
    expand_files() : fs/files.c

The defalut (soft limit) is defines as INR_OPEN_CUR(1024) in
include/linux/fs.h which is referenced form INIT_RLIMS in
include/asm-generic/resource.h. The value may be modified with ulimt,
sysctl, security configuration and etc.

With the kernel code above, when socket() system call returns positive
value, the value must be within rlimit(RLIMIT_NOFILE). No extra
checking is needed when socket() returns positive.

Without 'usbip: vhci number of ports extension' patch set, there's no
practical problem because of number of USB port restriction. With the
patch set, the value of socket descriptor can exceed FD_SETSIZE(1024
usually) if the rlimit is changed.

Signed-off-by: Nobuo Iwata <nobuo.iwata@fujixerox.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-07 10:19:49 +01:00
..
Makefile.am usbip: move usbip userspace code out of staging 2014-08-25 10:38:56 -07:00
usbip_attach.c usbip: tools: Start using VUDC backend in usbip tools 2016-04-26 15:19:50 -07:00
usbip_bind.c usbip: move usbip userspace code out of staging 2014-08-25 10:38:56 -07:00
usbip_detach.c tools: usbip: detach: avoid calling strlen() at each iteration 2015-09-22 12:07:45 -07:00
usbip_list.c usbip: tools: Start using VUDC backend in usbip tools 2016-04-26 15:19:50 -07:00
usbip_network.c usbip: move usbip userspace code out of staging 2014-08-25 10:38:56 -07:00
usbip_network.h usbip: move usbip userspace code out of staging 2014-08-25 10:38:56 -07:00
usbip_port.c usbip: adding names db to port operation 2016-05-03 14:32:07 -07:00
usbip_unbind.c usbip: move usbip userspace code out of staging 2014-08-25 10:38:56 -07:00
usbip.c usbip: move usbip userspace code out of staging 2014-08-25 10:38:56 -07:00
usbip.h usbip: move usbip userspace code out of staging 2014-08-25 10:38:56 -07:00
usbipd.c usbip: deletion of incorrect socket descriptor checking 2016-11-07 10:19:49 +01:00
utils.c usbip: move usbip userspace code out of staging 2014-08-25 10:38:56 -07:00
utils.h usbip: move usbip userspace code out of staging 2014-08-25 10:38:56 -07:00