Re: [PATCH netdev] "wrong timeout value" in sk_wait_data() v2 [message #13341 is a reply to message #13273] |
Thu, 24 May 2007 23:59 |
davem
Messages: 463 Registered: February 2006
|
Senior Member |
|
|
From: Vasily Averin <vvs@sw.ru>
Date: Thu, 24 May 2007 09:23:14 +0400
> 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>
Thank you for this bug fix, patch applied.
|
|
|