Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp736946ybc; Sat, 16 Nov 2019 07:49:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwtxmoga1hZrkPTZG9arjiWfq8U/JlOF/hLpWajQscI6xQccYvAB0rXGA9guP5IOk4mQUUR X-Received: by 2002:a17:906:80d5:: with SMTP id a21mr10714513ejx.114.1573919373136; Sat, 16 Nov 2019 07:49:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573919373; cv=none; d=google.com; s=arc-20160816; b=gd8cDVX+xD3cs5obLcJpzlZ19SCHJC6kAoedRrMm/BxvKI3joZI5iiIIfs6vA3Xz8c 3aRKqYL3rV4PwcylicMlKOsnsTscfV49TrpGbeMdY1lHvfptsFhj7wVmDjj06F7Mau5v uPnmSZhp8v82mCBxCcKhQEDTYbIOgFyM2ppWlFh2Syn2896W7UO+oSAoW7oGsMgZCjMg 8hVonpF+tBKVpLp/g+PIqTYac/4KkWTfWIL1U2+fRkDn6MLA1nPEwFdFSVBWoDGv4GVu nmLbNxjrTCAzTiWTc+i4AFTBFdIWbLBxQR601YaQZIcwgoQxQcgWhFWCCCg5IaXLa1of tRxQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yCxSaROhDkj1xG05T6yqX946JUSy5/8JyxMg9DZzZw0=; b=XW3mt+FmTj+Gn06Gcitgkcske+Uv003uceHVOh+/2Swx4w8/i0Df61HIb4s4wHit9k mWT/jmNf4G82XNYAhtAXuOCZF0h/Z8MZ4rzXAbu8QANOvDkb4gYTd8gjLtsXOWDsM+s/ 1zc9z6YiUtDPA/8qMYeJG3mQoOhKCNTiYLgDO5TMtkfuWQoO60rv42ULTE7HzNCirQWy ImNwX2bLw/cycuiYFPa8UJwUcdRqWb5n6A9ssC0rQ/Eb77mvQ78+snvyeRlGguP1T2ip Kb7wk8YgGOKwvToKD9LlCjhdhkgX1pVhLIYBukBalh4RYBxQAb7OrTArkwnC8BtxOIvD 3hng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JiXUAvgm; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si7967999edj.310.2019.11.16.07.49.08; Sat, 16 Nov 2019 07:49:33 -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=JiXUAvgm; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729566AbfKPPq4 (ORCPT + 99 others); Sat, 16 Nov 2019 10:46:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:52706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729358AbfKPPqX (ORCPT ); Sat, 16 Nov 2019 10:46:23 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E28F4207FA; Sat, 16 Nov 2019 15:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919183; bh=RFeDsKAaoKwlp4/tSmQK0sxDKUceFFliSMPVIObqmk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JiXUAvgmoWkSYjqNBGKMI1i5Y5ouvx5XB10UEoAnMToRtmxxazVJEJb3leDwY+hMX cPQqafRlNd/LGShMw9iJj+sEYsHCKxzkCdTZxD7IZsg8Mc8XbYqRM6L+RHzJJSeT7w 5To9CE1jLcrCj7dRiXuZOVdApvmLz4v56Lxi0JpI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andrei Vagin , Cyrill Gorcunov , Xin Long , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 191/237] sock_diag: fix autoloading of the raw_diag module Date: Sat, 16 Nov 2019 10:40:26 -0500 Message-Id: <20191116154113.7417-191-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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