Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4518637ybp; Mon, 14 Oct 2019 06:03:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/HpgqHUS3Jq8JQOVpTHjScxZQIjna3tKxfsnaqo3ZMpSxsblZrZYfS9K2PhAig68j6rSV X-Received: by 2002:a50:8f65:: with SMTP id 92mr29042409edy.9.1571058197801; Mon, 14 Oct 2019 06:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571058197; cv=none; d=google.com; s=arc-20160816; b=TzdajI+lPAJc7EfMpIooKyiWHcHswigv3MaO3jrXdPzo3s3YjFK7n2v9U35pJKmqtt DG78cJtZbplHvayQ/SXiYkloT3kkTpUTFbYfTN367P1taaISWFNhTVUouNgQLc/XZFYx AEsqnv/3GCDlVlmNWMGWlJYEe3/twRZ5QIGOjFvWWrdZnWMBX5Y+xDtYcNY/taaZqPHP KZT2yWQmlDTlgi23A9INgDASiLexQG27CjBk/sEyklaw4Hhlr4wZg8lOcjnX1zMqjDwx gHwplHCpRIZd5zuhCEbp94XcNZaZy/ZTO9loQtA2iG47ldWzjlH2a5pOav43JZxBhI4X zNJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=299WARGSZgoZwCiaRSp9MfhaJD92jcm3ybh9xwS/7l4=; b=cV/EHpy8YN09Owaus2a1a+S/ES3Skvz6udjNd4/DbeE7Ep4hVAMQT5/CGultGVM+QS JAzS+S7j3VoYkYdnnWU5ivCXqlVM8ewT7BYHer7SDLxJkgE1ez9f2REv7YZx3aJRQ6Fe zAgOnYtqwAu6mNeFK9TJaz+u1/mgTehjED8mi1RyVQTM4FNmEd2R4JRmD0KdjJDgtbJR u1hs6LQRqh2Q0Lx7cAyFcU+gGWp66dUx5MSNsr5HE+1pAm1VtbwrJS/Tlx8npYHjz78v 51aYnxREnEEfVnkgAqF7mIF2yw4MRMCTEwqHFPNVxdB/rITtMs9h8C+3cJ/TDeLqVpqo 4dDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GG4wBPKh; 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 z15si5634406edq.410.2019.10.14.06.02.53; Mon, 14 Oct 2019 06:03:17 -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=GG4wBPKh; 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 S1730646AbfJNMdT (ORCPT + 99 others); Mon, 14 Oct 2019 08:33:19 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:34905 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730394AbfJNMdS (ORCPT ); Mon, 14 Oct 2019 08:33:18 -0400 Received: by mail-pl1-f194.google.com with SMTP id c3so7981731plo.2; Mon, 14 Oct 2019 05:33:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=299WARGSZgoZwCiaRSp9MfhaJD92jcm3ybh9xwS/7l4=; b=GG4wBPKh4WWdXWO7eT20LMXhp9cSJvxqbfEVrPtEWg+cCsguD4J7kV24sXQj2gdVhP YeR5JrcakPxGza6af07ubK7OYWCC+DMN2air7u49a6u/FyOtH3rpcQjuFT6FkKt1ViOR HMYOanXyje3n8O3gV8DduH6/jBlr/amLx0cASO/O6H3Sl5QP7vaHGqSNnjtte/GFDOBB HlbWYA7by9uht2FNFiZyEKyCAAWNgFKKZCIoWv51q6hQXauOrykQYDr+FbUovyHzIbw+ ofx/YhfGjNvFv6/7UiNKz3LzIvrapI6tm4PvRj/lkJrlqE5cGaruXh816YzxqsorMSc0 Ewfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=299WARGSZgoZwCiaRSp9MfhaJD92jcm3ybh9xwS/7l4=; b=MSKTtyKeXOK5aWmo0sEw0ce/ejnPEgTGq1kzyKuK2Gc6U0/uj73hA+vhWHCdsQk9o8 z5NaftJsG9zhNvXws2z56jNC7+FB/obPbQXw7GD4CuWlWMNTvgaN4zVgp/JLJJo14QZm OhPBu6egUudZTXdA3cziWZsbsd6KqYSsF+zwI/L7JSmJvkY5sk2NIZZi0ia/AVuha5yJ nNfZ52bHjDyiuI6tBscGBoX58+2nDleMVPCDOQXOkQruA509+IN3/Uj1+oykzUsn+p7G /Lc+4XKgCCjifMruHAQrwBmnfewQcXCn8/9fLd7AbHh4y3S1rhWB2z4PgtYzrmi2mdu+ IibQ== X-Gm-Message-State: APjAAAW3dCmnuKWUQzcy0wp0KVR8/uxz/9y5mRk50bsrVWD5wxh6cVRw r8iVZQ0ujw31lrlJg5erg1U= X-Received: by 2002:a17:902:b20a:: with SMTP id t10mr29891517plr.277.1571056397925; Mon, 14 Oct 2019 05:33:17 -0700 (PDT) Received: from [192.168.86.235] (c-73-241-150-70.hsd1.ca.comcast.net. [73.241.150.70]) by smtp.gmail.com with ESMTPSA id w2sm20155282pfn.57.2019.10.14.05.33.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Oct 2019 05:33:17 -0700 (PDT) Subject: Re: tcp: Checking a kmemdup() call in tcp_time_wait() To: Markus Elfring , Eric Dumazet , netdev@vger.kernel.org, Alexei Starovoitov , Alexey Kuznetsov , Daniel Borkmann , "David S. Miller" , Eric Dumazet , Hideaki Yoshifuji , Martin KaFai Lau , Song Liu , Yonghong Song Cc: LKML , kernel-janitors@vger.kernel.org, Aditya Pakki , Kangjie Lu , Navid Emamdoost , Stephen McCamant References: <124b41aa-7ba5-f00c-ab73-cb8e6a2ae75f@gmail.com> From: Eric Dumazet Message-ID: <0984a481-f5eb-4346-fb98-718174c55e36@gmail.com> Date: Mon, 14 Oct 2019 05:33:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/13/19 11:51 PM, Markus Elfring wrote: >>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv4/tcp_minisocks.c?id=1c0cc5f1ae5ee5a6913704c0d75a6e99604ee30a#n306 >>> https://elixir.bootlin.com/linux/v5.4-rc2/source/net/ipv4/tcp_minisocks.c#L306 > … >> Presumably the BUG would trigger if a really disturbing bug happened. > > How “buggy” is this place if the function call “kmemdup” failed? It is not buggy. The BUG will not trigger. BUG_ON(tcptw->tw_md5_key && !tcp_alloc_md5sig_pool()); This would be different if we had instead : BUG_ON(!tcptw->tw_md5_key && !tcp_alloc_md5sig_pool()); > > Can an other error reporting approach be nicer here? There is no error reported if kmemdup() has failed. timewait is best effort.