Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6015579ybc; Wed, 27 Nov 2019 13:26:37 -0800 (PST) X-Google-Smtp-Source: APXvYqw4ZhdvjNx/4sB9DC4v4zeDkFvJxrudE+abLup8S2Gek5aYCyELSghFG/EeRaDVSEvxHPDf X-Received: by 2002:a17:906:3019:: with SMTP id 25mr51634617ejz.280.1574889997170; Wed, 27 Nov 2019 13:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574889997; cv=none; d=google.com; s=arc-20160816; b=jbYIvhAvhqDAX/BYjAPs+dDsKjVl1oIpAXf9pH2BrInxh6Fo3fDC4ZKHI9vlvfE7+M HaAhIZpX+ttRUE53Dxa91onU4OPpt2lEpGvnzqiuO1/HdwgvAVi4H/DgPwzhr1i/0x+L ehCVfBFWHyDdQZSpeigz5TGE11+04mwyK36UXfdBg+PXi/g7iEap4yBXmkZgn5Do4/cQ jXHbXmJOqYIkOJpQagbJVVMr7AypW2WriLoySWV8W6xEVI/NzNG2DS3jMiq3I3pFugnX dOtokmAYIevl9Y8xncD3Gf4S2RH1eaDBgzS4Q+VkQBFsHNMgXnTFXdyzWl7KFuSX8Co7 R2dQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yCxSaROhDkj1xG05T6yqX946JUSy5/8JyxMg9DZzZw0=; b=otTOE6KXnRKEKiy+xUz5RKSTl8bbra6xMV0DFCymPmresvRQ3ClDvnjqWNE61Sy76O a2z8JpxuUN2U4L49gqdZFgQ7D5etqithi/z5cOyuv8fpIFWri07kfWd4vc5PzbgqfBdA enK8SNpb5NTrv2gQ/npv0Z011UNtY7lO5knWmbEHaXBkyhp0OBlHJ5vSKAo3L3pfX7wz XnRalOKe0raKh1kdbur1dL8EClSh/pZXHh+Q2rLnPLXYIQQ2NMjy2yBluyho25V9u+VM 9uj9l7BEpDLOsQVDndVvBuBoDc+aJqQ9Xs/C24ievGIfIsIEByW4z/cb/qa6sVzyRrW9 7hZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KVv2aAJ9; 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 n9si665893ejc.119.2019.11.27.13.26.12; Wed, 27 Nov 2019 13:26:37 -0800 (PST) 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=@kernel.org header.s=default header.b=KVv2aAJ9; 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 S1728507AbfK0VYB (ORCPT + 99 others); Wed, 27 Nov 2019 16:24:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:57114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727361AbfK0VDt (ORCPT ); Wed, 27 Nov 2019 16:03:49 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A34832080F; Wed, 27 Nov 2019 21:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888629; bh=RFeDsKAaoKwlp4/tSmQK0sxDKUceFFliSMPVIObqmk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KVv2aAJ9Wyn/af6EzBzegKmbQ29gBNVop47WqPc6CkZBvrlSD6uYrQ2r7a3QJBT21 lDCf43Uqgak4lX6A2ePFAB4kQTjuZQRF01/BFIFESCsJZAt9KK0oENJiCrl4jcyrPF +ToqgeA9fj8KDZLJPQ9Kse39KePaOEaeQPwYLJRo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Cyrill Gorcunov , Xin Long , Andrei Vagin , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 208/306] sock_diag: fix autoloading of the raw_diag module Date: Wed, 27 Nov 2019 21:30:58 +0100 Message-Id: <20191127203130.323653726@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrei Vagin [ Upstream commit c34c1287778b080ed692c0a46a8e345206cc29e6 ] IPPROTO_RAW isn't registred as an inet protocol, so inet_protos[protocol] is always NULL for it. Cc: Cyrill Gorcunov Cc: Xin Long Fixes: bf2ae2e4bf93 ("sock_diag: request _diag module only when the family or proto has been registered") Signed-off-by: Andrei Vagin Reviewed-by: Cyrill Gorcunov Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/core/sock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/sock.c b/net/core/sock.c index 6c11078217769..ba4f843cdd1d1 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -3347,6 +3347,7 @@ int sock_load_diag_module(int family, int protocol) #ifdef CONFIG_INET if (family == AF_INET && + protocol != IPPROTO_RAW && !rcu_access_pointer(inet_protos[protocol])) return -ENOENT; #endif -- 2.20.1