From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH] net: support compat 64-bit time in {s,g}etsockopt Date: Fri, 27 Apr 2018 19:47:07 -0400 (EDT) Message-ID: <20180427.194707.1957018124499215257.davem@davemloft.net> References: <20180425142154.28891-1-lance.richardson.net@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, gopalsr83@gmail.com, vapier@chromium.org, hjl.tools@gmail.com To: lance.richardson.net@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:59456 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932980AbeD0XrM (ORCPT ); Fri, 27 Apr 2018 19:47:12 -0400 In-Reply-To: <20180425142154.28891-1-lance.richardson.net@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Lance Richardson Date: Wed, 25 Apr 2018 10:21:54 -0400 > For the x32 ABI, struct timeval has two 64-bit fields. However > the kernel currently interprets the user-space values used for > the SO_RCVTIMEO and SO_SNDTIMEO socket options as having a pair > of 32-bit fields. > > When the seconds portion of the requested timeout is less than 2**32, > the seconds portion of the effective timeout is correct but the > microseconds portion is zero. When the seconds portion of the > requested timeout is zero and the microseconds portion is non-zero, > the kernel interprets the timeout as zero (never timeout). > > Fix by using 64-bit time for SO_RCVTIMEO/SO_SNDTIMEO as required > for the ABI. > > The code included below demonstrates the problem. ... > Fixes: 515c7af85ed9 ("x32: Use compat shims for {g,s}etsockopt") > Reported-by: Gopal RajagopalSai > Signed-off-by: Lance Richardson Really nice commit message and test case. Applied and queued up for -stable, thank you.