Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2930168pxb; Tue, 13 Apr 2021 14:00:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrhoSD/VsuD2Au5hXcAFd81pSJ9qyT51RvCQVdz5TdAAecTRq0nPFZZtf6yrTOx1ICyYym X-Received: by 2002:a17:903:1cf:b029:e8:c4ca:be6d with SMTP id e15-20020a17090301cfb02900e8c4cabe6dmr34929853plh.39.1618347644017; Tue, 13 Apr 2021 14:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618347644; cv=none; d=google.com; s=arc-20160816; b=Y1yPwdm98Fz1M7RnAs9pcqXyCHuC+O1rnOAjuBjP7K93GgzXzkCaP+D+Q5nzkAo8w6 9H0kpDTeppsn513y0gJRGti7Qcg8XWmJHYiTUs8VDlBWaBTr5S+NtXoh2AUQmsTS15gI Ei8aAlYZwUJgFm6RVQ5AYVRbjfGG7WLK1BmGZSoNI/Dg9Xt6ajR8W54/Fhja86OQC3I2 SPOBs2PdRnB8MsuQ3brPQn3ikSQfoGNoWr/Dz7JS4YKZB83SVPiCO/CP3PVHNyWN18N5 q1lYV4gub8y269yIREo3QOtG+dXR8AlgAi8u7P4TcCYVSOqAqJWY62KS361N0oIRjXXA St3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qCzCnYr3+785S76q01Q/UXckp8I3YkeIwVVNFc/YH5M=; b=01AauztVmL9JPe0G4j1zTTCwlHehpPBdba+yomLyqtKexhrEjIdxmCP9/nxiZuVA64 sfC0dKyOYnpaj3EJf+VCHyD3CReQKI+57AW7NHgiWRcvi4niQikq8KKTqxMOgYV9V2mn cc39z5XSTp9Bw8IT9OFpP7TEXISh97hJQvValopwOndvN44ZYVhdSf2SiaMbH958TFUp KM0YHB2wxTXqyWNUadB9nJdmXCH3SJdHUzNQOK1K+RT9Or5P4SLHLSWh9uCL8AeeVFuf tJEAseDZZ5zzHGgywy6ZHRtVJTctAKa6GyK8qvRIF23TFrF/YsFeu8n7692sIvad4aP1 Gimg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g3rAJOjj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id 20si11666425pgs.543.2021.04.13.14.00.30; Tue, 13 Apr 2021 14:00:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g3rAJOjj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1346553AbhDMPVM (ORCPT + 99 others); Tue, 13 Apr 2021 11:21:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346552AbhDMPVK (ORCPT ); Tue, 13 Apr 2021 11:21:10 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C666AC061756; Tue, 13 Apr 2021 08:20:50 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id d15so5223734qkc.9; Tue, 13 Apr 2021 08:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qCzCnYr3+785S76q01Q/UXckp8I3YkeIwVVNFc/YH5M=; b=g3rAJOjjRkKXa8uh49lSVVH/mQz/fKZoW9IhSPi0jr5PoZeflJNTxdmaNGW09UDcQW JpFChJhCMHGQ/6xp8DOYecWiIS9fEyB6+Us1LCbI1iYnRZudZdYblSwCbGelX1C+XlFq joJYavZoVD3N1rXYMmtPTukucVBYsF56+Kwzi4IMbdUEk2g0jLzxSUK5j45wiYUYEbXe lVR34K8WQQouphJuhWdmiYvCUb5KJCiVcP+IQ1VXc35UbB0NGotwQZ+ZloXXT2uNfgIl tRfntLjMR51nvAgVFSIG7+GwLdydWH3vT3ZsLiCJv0JfnJhXtreILaLaIzYHcVyPSy/z MGwA== 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:references :mime-version:content-disposition:in-reply-to; bh=qCzCnYr3+785S76q01Q/UXckp8I3YkeIwVVNFc/YH5M=; b=sf7s+mY1dzZlU3Aeoale3TCCtZkp4/oOxaG0iuCiWqZifWBx2OYnJhu6UtXJB/+Trd oGo3ibvDOSt2TXahlagmGtSRcDDCsjQxJmq4zV2Rv6q3HqLo8NEMfUptzOCNnL1NZ7hA zyIDvHxWGR0v1Zvm0TcdyIT4uSm2KR3JP8sfNp0PXvPV5MsNfT1MgzIuR5mljKYomZjQ ccB5716rl2DqllL/L+EdV6nVWkF3Q7G+5yQ7oETg8R3IA+oR84t+kZPl52gq/07ksqQy AZLxzLqeIfsNRmQPmvKdLZ4I06qgwHQPLr8I7C9BL66pRSJv3MJ2kiy3H4XfThPiFFkw fCBA== X-Gm-Message-State: AOAM5323hm7d9kQpjIiSkEGS1rstULiGVFkvGvJEXSW3ONTmSISRe8uA zGavKaCxgrPiuo1aadgYZLY= X-Received: by 2002:a37:6f41:: with SMTP id k62mr25738832qkc.262.1618327249995; Tue, 13 Apr 2021 08:20:49 -0700 (PDT) Received: from horizon.localdomain ([2001:1284:f013:7670:f294:e7fa:2bfe:b930]) by smtp.gmail.com with ESMTPSA id m3sm7259613qkn.65.2021.04.13.08.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 08:20:49 -0700 (PDT) Received: by horizon.localdomain (Postfix, from userid 1000) id 2AFFAC0784; Tue, 13 Apr 2021 12:20:47 -0300 (-03) Date: Tue, 13 Apr 2021 12:20:47 -0300 From: Marcelo Ricardo Leitner To: Or Cohen Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, vyasevich@gmail.com, nhorman@tuxdriver.com, davem@davemloft.net, kuba@kernel.org, linux-sctp@vger.kernel.org, lucien.xin@gmail.com, nmarkus@paloaltonetworks.com Subject: Re: [PATCH] net/sctp: fix race condition in sctp_destroy_sock Message-ID: References: <20210413093153.27281-1-orcohen@paloaltonetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210413093153.27281-1-orcohen@paloaltonetworks.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 13, 2021 at 12:31:53PM +0300, Or Cohen wrote: > +++ b/net/sctp/socket.c > @@ -1520,11 +1520,9 @@ static void sctp_close(struct sock *sk, long timeout) > > /* Supposedly, no process has access to the socket, but > * the net layers still may. > - * Also, sctp_destroy_sock() needs to be called with addr_wq_lock > - * held and that should be grabbed before socket lock. > */ Please also update the following comment in sctp_init_sock(): /* Nothing can fail after this block, otherwise * sctp_destroy_sock() will be called without addr_wq_lock held */ Other than this, LGTM. Thanks. Marcelo