From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net-next] kcm: do not attach sockets if sk_user_data is already used Date: Tue, 16 Jan 2018 14:00:52 -0500 (EST) Message-ID: <20180116.140052.88231511056432866.davem@davemloft.net> References: <1515929577-25914-1-git-send-email-jchapman@katalix.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: jchapman@katalix.com, netdev@vger.kernel.org To: tom@herbertland.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:57698 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941AbeAPTAy (ORCPT ); Tue, 16 Jan 2018 14:00:54 -0500 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Tom Herbert Date: Tue, 16 Jan 2018 09:36:41 -0800 > sk_user_data is set with the sk_callback lock held in code below. > Should be able to take the lock earlier can do this check under the > lock. csock, and this csk, is obtained from an arbitrary one of the process's FDs. It can be any socket type or family, and that socket's family might set sk_user_data without the callback lock. The only socket type check is making sure it is not another PF_KCM socket. So that doesn't help with this problem.