Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp278934ybd; Tue, 25 Jun 2019 21:20:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzj+EBVnZrZFtzFK2Elx3bLBpxxa7bvOQ50pyb+RXmONEgqPsvjH2guMTzSHqYH0ImeuED X-Received: by 2002:a17:902:778d:: with SMTP id o13mr2829877pll.82.1561522855755; Tue, 25 Jun 2019 21:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561522855; cv=none; d=google.com; s=arc-20160816; b=iVcN4zaaBZVJjj0gDEKoWtA784o1OiL/uK/oNSHy05ddcb04WJlVf59CdTy6/E8dW9 pQjeLoME+ysTKH9JlsjH/5Skft0R6M7qsLmOBQuE6QvRFBhg+CBOcZg/THlvA8VoYzXX AP9tBb0F7Ntflikhyy7wDp8DJy/v96HwxyuO+M+N2KcUYpnKO2/CC5gxv+8Vv0T+vQhf s2oWBHIncdpb4+Uh77nMdMhCGf+CF/gJa5dFcRT8kcrY6AbxXkaA1y8mSq2+LLj69ccd S28jxTx2Ao2M/SdaqzTVOmxN7jcztGrb6k+/7pFOs1ce3YGtxS4nYPd3pNR86tFg0SCw cdGA== 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=NgZO8AtV2C/NdSOXt6DcG38OSSlpRBV+WcyoIVx6KVA=; b=EyO/kyxxD2o5vE+pJmDHNisxxT2Y8/jKA3vcAc0vy94aEnctkbcY9sZTYr0IRoWkPH hbNxiVda4lSVJt1ddnRAggSnJnH/SpznTxzg3Cv5oVeUPyeQUxzMlFJu12kYdWhv11rA z40HYx1BI6oTPSJzTkP9Ui362SOllOqKES0KeS9YXazembVlvLgjNUOArgMcyFW7Ai9E hgpfgSRuX9iK4ruoPrmgrjh9k3TV6G06KICFZE7hhlloRBx1N2Abis0XPbAkhJYt1k2o uXS435wQiBO/rbnRxqfTIuoOA6mupN4c/UEgfBnqJ8tl3hAm/WzFPd/ehABhdU/HNSS4 /FIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AnUkRffO; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1si16141878pfb.264.2019.06.25.21.20.38; Tue, 25 Jun 2019 21:20:55 -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=@google.com header.s=20161025 header.b=AnUkRffO; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726565AbfFZEUc (ORCPT + 99 others); Wed, 26 Jun 2019 00:20:32 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:44940 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726076AbfFZEUc (ORCPT ); Wed, 26 Jun 2019 00:20:32 -0400 Received: by mail-yb1-f196.google.com with SMTP id j15so574618ybh.11 for ; Tue, 25 Jun 2019 21:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NgZO8AtV2C/NdSOXt6DcG38OSSlpRBV+WcyoIVx6KVA=; b=AnUkRffO0xVZ1SQ60UmB9V/hFuQN5WA/A2dS6gyKE/n6RAEjhMEwkPsDh0Lu+Sf57A /Iv0j/VW+EOgsh7CtC0NxcWXKJciRo+R4amdHaKfT6P7XPnrtjK4twjpZj8aeaSAO4Oe l4zYvoQ0MiiirQKXYyB4EeT8BZe9/A6bWgPSqxn3k+Fxib8H7lx5bUNkrV9hTcUguQJZ 1c+2Ql1flEop7FgexVatImQvhm3AGRKuv6eA201fgocwbcatuhua+XJ0pygj/R3+xesi G7iP8TFskS26KvYsNqWcaySuWrgJyMbWzswuph5m5X485OoQ/UYVW5vURRpzJrJhfIaU ileQ== 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=NgZO8AtV2C/NdSOXt6DcG38OSSlpRBV+WcyoIVx6KVA=; b=UGZda1m6Z46ZLHTn6rCHGLzShD8OnPZXBln3aLTFBNrw+Zqg9I+0cggeepMgDBoYz5 m96vBvkeK6NfwnIxeQjZEvYy+89EloZtTedNpHqjP1oROYSGtpXuLWG3kK6qOOcgGbef f6y+WrWdREQa1VUabM6p2nTO4rHpJO1sI3zFgiiBIRjaBlkDw7M+Xb+2/XM0jDfvAxpM +bp6I9KVZ5MtHipG/+VDKd4ooBGyjQReV7AwOyrdPr1bfWjudrGIsr7AKFJdRIH0ur6t GsPC7ByQ59VWAyU9qEzhh7dbTz+i8B8KyWdWNruJReqTBDPaOVHWtC9S48LM2QAZULqd izXw== X-Gm-Message-State: APjAAAXwcQun7n+ekAthF9By6AUIz5ocrFjRnOXlO4jeweb5EoEI0R2R SiyyS9/kMc81VkutHz24Z77owdwOWgwnG5j5bqkMRA== X-Received: by 2002:a25:55d7:: with SMTP id j206mr1420987ybb.234.1561522831028; Tue, 25 Jun 2019 21:20:31 -0700 (PDT) MIME-Version: 1.0 References: <20190621214139.GA31034@kroah.com> <20190622073753.GA10516@kroah.com> <20190626020220.GA22548@roeck-us.net> <20190626022923.GA14595@kroah.com> <53b23451-f45b-932d-a2f8-15f74f07a849@roeck-us.net> In-Reply-To: <53b23451-f45b-932d-a2f8-15f74f07a849@roeck-us.net> From: Eric Dumazet Date: Wed, 26 Jun 2019 06:20:17 +0200 Message-ID: Subject: Re: Steam is broken on new kernels To: Guenter Roeck Cc: Greg Kroah-Hartman , Linus Torvalds , "Pierre-Loup A. Griffais" , lkml 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 On Wed, Jun 26, 2019 at 5:43 AM Guenter Roeck wrote: > > On 6/25/19 7:29 PM, Greg Kroah-Hartman wrote: > > On Tue, Jun 25, 2019 at 07:02:20PM -0700, Guenter Roeck wrote: > >> Hi Greg, > >> > >> On Sat, Jun 22, 2019 at 09:37:53AM +0200, Greg Kroah-Hartman wrote: > >>> On Fri, Jun 21, 2019 at 10:28:21PM -0700, Linus Torvalds wrote: > >>>> On Fri, Jun 21, 2019 at 6:03 PM Pierre-Loup A. Griffais > >>>> wrote: > >>>>> > >>>>> I applied Eric's path to the tip of the branch and ran that kernel and > >>>>> the bug didn't occur through several logout / login cycles, so things > >>>>> look good at first glance. I'll keep running that kernel and report back > >>>>> if anything crops up in the future, but I believe we're good, beyond > >>>>> getting distros to ship this additional fix. > >>>> > >>>> Good. It's now in my tree, so we can get it quickly into stable and > >>>> then quickly to distributions. > >>>> > >>>> Greg, it's commit b6653b3629e5 ("tcp: refine memory limit test in > >>>> tcp_fragment()"), and I'm building it right now and I'll push it out > >>>> in a couple of minutes assuming nothing odd is going on. > >>> > >>> This looks good for 4.19 and 5.1, so I'll push out new stable kernels in > >>> a bit for them. > >>> > >>> But for 4.14 and older, we don't have the "hint" to know this is an > >>> outbound going packet and not to apply these checks at that point in > >>> time, so this patch doesn't work. > >>> > >>> I'll see if I can figure anything else later this afternoon for those > >>> kernels... > >>> > >> > >> I may have missed it, but I don't see a fix for the problem in > >> older stable branches. Any news ? > >> > >> One possibility might be be to apply the part of 75c119afe14f7 which > >> introduces TCP_FRAG_IN_WRITE_QUEUE and TCP_FRAG_IN_RTX_QUEUE, if that > >> is acceptable. > > > > That's what people have already discussed on the stable mailing list a > > few hours ago, hopefully a patch shows up soon as I'm traveling at the > > moment and can't do it myself... > > > > Sounds good. Let me know if nothing shows up; I'll be happy to do it > if needed. Without the rb-tree for rtx queues, old kernels are vulnerable to SACK attacks if sk_sndbuf is too big, so I would simply add a cushion in the test, instead of trying to backport an illusion of the rb-tree fixes. diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index a8772e11dc1cb42d4319b6fc072c625d284c7ad5..a554213afa4ac41120d781fe64b7cd18ff9b56e8 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -1274,7 +1274,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, if (nsize < 0) nsize = 0; - if (unlikely((sk->sk_wmem_queued >> 1) > sk->sk_sndbuf)) { + if (unlikely((sk->sk_wmem_queued >> 1) > sk->sk_sndbuf + 131072)) { NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPWQUEUETOOBIG); return -ENOMEM; }