Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3643490yba; Tue, 16 Apr 2019 16:07:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKkBk/77g/lh7pFMD6MT8lA6m+zNP+uiIA3SzxunI60isXX2i4iFEw9lrFR83h38UkS44z X-Received: by 2002:a65:53cb:: with SMTP id z11mr77884235pgr.139.1555456054108; Tue, 16 Apr 2019 16:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555456054; cv=none; d=google.com; s=arc-20160816; b=MviEtwwBsF0fi3kZVc9t7+GHwaRq62KL6tXOAmScmedgge/561//7PiiLSX1XS/sAk PgrW9Cdqkfu1d/KrV+MgEIiktdpUP6Bq041dzPAnWcJ5NnImt3Pf4oDDEu/QbXT+jjRP 8UfXCuPIZ8GqWvSoJTn7u3QN19deEq4RXKW/xj1VQHPA2AyRdas1bqmlPgBR+Rwpulb0 Uqr8v+Hpk6HsHdb/O10GPlwkoDK+5Hv4UA49rxjboOI+iFJFyb21S+L92KkA8pkGQhXM gpPGyzcdkk18ykcw9Srh/SC3ejCy1X6OuKkU4oThxUa+QU7xHQQvJnKtg3g+o4CyiPF7 yBfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=D222hi2fI3ZV2+nSZWHWH5bkSynr1vLqwuPHSHAur2w=; b=QhAeuLTfQlKz2EP4inhxszKghr2vQhiAMoan9yJqeEhQzFM/Dky57TsnUS6dOpJm57 9c0UMftBkfLcsSjBinxOBR9Q9j70Z4VK9XwdeoxQvazGVy6sep7IHvOEiFjbJKQN7du2 a3fmoPAOTVY7irNh1mnJBWGcsL+VwZMWIjsidIqkCB0tpvVfHeSXiVYDyiQj8G/ZWQM+ wMfSgDKtPJd86UFb6Nrd3QzWacLF54dsp1s7PCnQD1ugrG3wB9+XCVmHXZp0mUquSN0C AdlA5H4+2OkA0JDMazgRuPGcsaC17SAU9TRhhHO3Hr1asfjUjEctmegAi5dllDHETgnf k0cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EYPAcUwV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r184si46936610pgr.24.2019.04.16.16.07.17; Tue, 16 Apr 2019 16:07:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EYPAcUwV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730727AbfDPXE7 (ORCPT + 99 others); Tue, 16 Apr 2019 19:04:59 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:38702 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727382AbfDPXE6 (ORCPT ); Tue, 16 Apr 2019 19:04:58 -0400 Received: by mail-it1-f194.google.com with SMTP id f22so1478276ita.3; Tue, 16 Apr 2019 16:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D222hi2fI3ZV2+nSZWHWH5bkSynr1vLqwuPHSHAur2w=; b=EYPAcUwV1blcnTqb/nMj/7DO7Tm8Z8yYK38wGJ8WcMbKMmTXSRaDm4r7RfmU3B083D qfvNqWHNsZmgwX+iuma3GWbymnY1OhhehMOwdECDpFyMw2NXFevInyWdYarg/EojyshT cSY31zsFpZ1SLfZvfYuNMI1X6ZtMyZUhF1MGxuJIZICCZ4no/4TAtbOdD7fgd5a1z7Er PYW1iVD6IwjDp7d2sc9X37KVD4+nPf9Flg0tEKM86038MMG6p6hRMObGf9ys/4lBAdrV 5/eFw+BDcVWRA9vWzZGyBIqBPYfADhTCkhha1nTI5MI+Palkaf49/eA8+RAJ0VJrYNxA 74Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D222hi2fI3ZV2+nSZWHWH5bkSynr1vLqwuPHSHAur2w=; b=XcrZZ7j0DVSg+jC2hT3WXM5Bi9BzJD7+XAUMm9GsaMyr8X3XWstjkw68wd8OfwJCwZ AL9PO21kBBboUlNiK86KKr+g9lJYuprsOMZkbmYxsUxxtbfDSU/9IZXmth4y3X3PYYnM hudSfvEXFOfFaIcF+QVm3p8XbCzWCHMHcTOHvXpeYnRSQ8rCpGIEsjTJkcZD/AmzHbuA deKXRLrsZiTLQ1BhrhKCFadOhq9af6YZk2Q1vtfyJo9+wKJ5tuD5SVX7/CejEl2vDL0c ytlKJrW8tWwNM7K2FAczKLMkk7xQcNIxVivqc8kXvlwoj3ffj3hNchKlfSs5ZIyhoa+8 m6QQ== X-Gm-Message-State: APjAAAUNC6ym1LrAXcz/w0wmXWbwnXKDmnn1ZGMJV8P9zTqNkOj57i5A VPVt3JVe/DdC50XtgErqAQdP14aZTE96nUv1IAc= X-Received: by 2002:a05:660c:d4:: with SMTP id q20mr24372791itk.102.1555455897580; Tue, 16 Apr 2019 16:04:57 -0700 (PDT) MIME-Version: 1.0 References: <20190416203143.408835-1-arnd@arndb.de> In-Reply-To: <20190416203143.408835-1-arnd@arndb.de> From: Deepa Dinamani Date: Tue, 16 Apr 2019 16:04:44 -0700 Message-ID: Subject: Re: [PATCH net] socket: fix compat SO_RCVTIMEO_NEW/SO_SNDTIMEO_NEW To: Arnd Bergmann Cc: "David S. Miller" , Eric Dumazet , Willem de Bruijn , Yafang Shao , Linux Network Devel Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Acked-by: Deepa Dinamani Thanks, -Deepa On Tue, Apr 16, 2019 at 1:31 PM Arnd Bergmann wrote: > > It looks like the new socket options only work correctly > for native execution, but in case of compat mode fall back > to the old behavior as we ignore the 'old_timeval' flag. > > Rework so we treat SO_RCVTIMEO_NEW/SO_SNDTIMEO_NEW the > same way in compat and native 32-bit mode. > > Cc: Deepa Dinamani > Fixes: a9beb86ae6e5 ("sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW") > Signed-off-by: Arnd Bergmann > --- > > net/core/sock.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/net/core/sock.c b/net/core/sock.c > index dc7c31d66200..1e418c0b3b73 100644 > --- a/net/core/sock.c > +++ b/net/core/sock.c > @@ -348,7 +348,7 @@ static int sock_get_timeout(long timeo, void *optval, bool old_timeval) > tv.tv_usec = ((timeo % HZ) * USEC_PER_SEC) / HZ; > } > > - if (in_compat_syscall() && !COMPAT_USE_64BIT_TIME) { > + if (old_timeval && in_compat_syscall() && !COMPAT_USE_64BIT_TIME) { > struct old_timeval32 tv32 = { tv.tv_sec, tv.tv_usec }; > *(struct old_timeval32 *)optval = tv32; > return sizeof(tv32); > @@ -372,7 +372,7 @@ static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen, bool > { > struct __kernel_sock_timeval tv; > > - if (in_compat_syscall() && !COMPAT_USE_64BIT_TIME) { > + if (old_timeval && in_compat_syscall() && !COMPAT_USE_64BIT_TIME) { > struct old_timeval32 tv32; > > if (optlen < sizeof(tv32)) > -- > 2.20.0 >