diff options
author | Vasily Averin <vvs@sw.ru> | 2007-05-24 16:58:54 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-05-24 16:58:54 -0700 |
commit | ba78073e6f70cd9c64a478a9bd901d7c8736cfbc (patch) | |
tree | bb33cc056c76eb799f008e4ab68662222ab1047f /drivers/net/tulip | |
parent | c883f215a23a9352097b8d17fb8dae22ff134a14 (diff) |
[NET]: "wrong timeout value" in sk_wait_data() v2
sys_setsockopt() do not check properly timeout values for
SO_RCVTIMEO/SO_SNDTIMEO, for example it's possible to set negative timeout
values. POSIX do not defines behaviour for sys_setsockopt in case negative
timeouts, but requires that setsockopt() shall fail with -EDOM if the send and
receive timeout values are too big to fit into the timeout fields in the socket
structure.
In current implementation negative timeout can lead to error messages like
"schedule_timeout: wrong timeout value".
Proposed patch:
- checks tv_usec and returns -EDOM if it is wrong
- do not allows to set negative timeout values (sets 0 instead) and outputs
ratelimited information message about such attempts.
Signed-off-By: Vasily Averin <vvs@sw.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip')
0 files changed, 0 insertions, 0 deletions