Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2559099ybl; Thu, 29 Aug 2019 09:45:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJjx0scO5wAeqJVT7nGkHSqEVfmRthCu5F0cYiu7srGTsIT34ovC0MPvL5GPwVceH3uk3Y X-Received: by 2002:a62:640e:: with SMTP id y14mr12397973pfb.222.1567097130608; Thu, 29 Aug 2019 09:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567097130; cv=none; d=google.com; s=arc-20160816; b=ns+NuXIOvCdkxPn1Ygr1DHkFVttutnJW0vJcxVMUtMwL8QcdRlmH/KB1f3N9SMRE3P zIczQ4N4xctkdhwBVxp0673q2aDbYpRnsJhI+nfOZLFhZ9F914uAXYO4cFvUkV4Wdlp0 FmBre3HEYTBQlUpDuYB/69U9IP77WB/5uSt6O0d5hFcT5zxNRNTOAuIv+D2Cm/SLQ89q wkC3+yb/qyvAtqM/CuQaLYzoJjvXMr2AGSNfF1UwUqhiL4G+IJJk6OtlPh5lxWcvv4nq MTGUyuSJcW2MmOoBiZ+d3+jNkqucYJ3J/hnv5CMJuy/y+5PU5IdtzJztabjj56g4Y3pO FRhA== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=J0mIptJpgCrji3rnOXUkwAg2sK122VXt0E9fIlxztOM=; b=Fk74k/JciPmccDoLnMZB3GHb5uxAXciMDsJFiLdoQ8y4kfsrLjvNQoWl6h+68mrg4a y2LoRDAqVxWjpsV6Gx0nN67car1bKMznf+h4y2UFJl9/OXar5YX56uQu3YTgNyMadD8F j2AupPaoPpOWhw9MKguVeKQqPf3cCYGh4GXMuVc7AkU91DWOGvKuA4Koj8Pou4cP1Ui4 51sIdjRNIeh7lz3lM4Fgcf+pK4edmD+JP+HXpY9SqDfIQinPCzyX1qbmOWTdEvZvbmAR Inn062Klyt4LLOYrydGGXAMKD6XMFD90p17I/dg+eAFROS07kqvVQu5cMn0Cy29vyxOa n3Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=CjUWiJmE; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x18si3006300pff.208.2019.08.29.09.45.15; Thu, 29 Aug 2019 09:45:30 -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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=CjUWiJmE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727914AbfH2QoM (ORCPT + 99 others); Thu, 29 Aug 2019 12:44:12 -0400 Received: from mail-ed1-f41.google.com ([209.85.208.41]:45965 "EHLO mail-ed1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727118AbfH2QoM (ORCPT ); Thu, 29 Aug 2019 12:44:12 -0400 Received: by mail-ed1-f41.google.com with SMTP id x19so4713996eda.12 for ; Thu, 29 Aug 2019 09:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=J0mIptJpgCrji3rnOXUkwAg2sK122VXt0E9fIlxztOM=; b=CjUWiJmEnPc7cpwJ/wsprTOwzmCKVjptR7CYO147EQ8lCVLk9PNsUUNihGjDi0yAiU AdhSK4kl0aEt2i34anAuJ5CHeotYjHF8tIYEm3pizhouRuUK1YrIQE9k7itxJ0YcnexA 2xxmCkBC+zU1PddIE30q0E+GQLwS5xXelvTGwgwTgCRHUc1mpEfEbNdN9FaevS84+w0A KKda+pmQs9qgR1c9qFKdc00Mlryh7p5phtUGHaZ50O+d2E8lL9LWq8PdysrjSDlD/08l rDCf6VUX8OHUCdYLvFfNVFqqKJyeiQ3PwuqXv0ooKBfDDDwygOUbgOX0gZqeldc+118y 0m1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=J0mIptJpgCrji3rnOXUkwAg2sK122VXt0E9fIlxztOM=; b=rT5l54nwonyWI8ISn5fC5K2YxuYxJj/9geNSJnk4qYz8Bzi7PEMkZSyUtmuFEjDM1Z NYnoOPSHcUUnnj8jDSwRzDrRxS0R7qnWKqtktTLgyRgvk91njgNEGxdmwUJwMDH7qe9s KiYqgbvDbecI77JPN0bT5yts1FCj3f1xGgU1J3Y3hX90b3mPL2mpPZiNCHVzbi5OJL3y unC9AHXgIl0E7QoOiNoe5iFKFuhBXWv3it1B6ONuLrpokIU6/Q7fDFV904bNX0X9+ZRU ybpUAV6zJ5nJ4sNcazTtNKoXEx6KoUQE0DoyQ+BlK6sHFEb3Hgt6OqTpwu/Ja/YeBt2N Mubw== X-Gm-Message-State: APjAAAXEDGXMa4+mgEEMq92oDS1yaGS52rs3cy6vAWm5aPIWp6OWWria IVrmzliiNjdQ3umDn/+HOyu2HA== X-Received: by 2002:a50:884b:: with SMTP id c11mr10893613edc.138.1567097050284; Thu, 29 Aug 2019 09:44:10 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id o11sm444273ejd.68.2019.08.29.09.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 09:44:09 -0700 (PDT) Date: Thu, 29 Aug 2019 09:43:43 -0700 From: Jakub Kicinski To: Hillf Danton Cc: john.fastabend@gmail.com, syzbot , aviadye@mellanox.com, borisp@mellanox.com, daniel@iogearbox.net, davejwatson@fb.com, davem@davemloft.net, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: general protection fault in tls_sk_proto_close (2) Message-ID: <20190829094343.0248c61c@cakuba.netronome.com> In-Reply-To: <20190829035200.3340-1-hdanton@sina.com> References: <000000000000c3c461059127a1c4@google.com> <20190829035200.3340-1-hdanton@sina.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Aug 2019 11:52:00 +0800, Hillf Danton wrote: > Alternatively work is done if sock is closed again. Anyway ctx is reset > under sock's callback lock in write mode. > > --- a/net/tls/tls_main.c > +++ b/net/tls/tls_main.c > @@ -295,6 +295,8 @@ static void tls_sk_proto_close(struct so > long timeo = sock_sndtimeo(sk, 0); > bool free_ctx; > > + if (!ctx) > + return; > if (ctx->tx_conf == TLS_SW) > tls_sw_cancel_work_tx(ctx); That's no bueno, the real socket's close will never get called.