From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH v2 net-next 2/2] kcm: Check if sk_user_data already set in kcm_attach Date: Wed, 24 Jan 2018 12:52:54 -0800 Message-ID: <1516827174.3715.30.camel@gmail.com> References: <20180124203541.3172-1-tom@quantonium.net> <20180124203541.3172-3-tom@quantonium.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, rohit@quantonium.net, jchapman@katalix.com, g.nault@alphalink.fr To: Tom Herbert , davem@davemloft.net Return-path: Received: from mail-pg0-f49.google.com ([74.125.83.49]:44110 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072AbeAXUwz (ORCPT ); Wed, 24 Jan 2018 15:52:55 -0500 Received: by mail-pg0-f49.google.com with SMTP id m20so3546195pgc.11 for ; Wed, 24 Jan 2018 12:52:55 -0800 (PST) In-Reply-To: <20180124203541.3172-3-tom@quantonium.net> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 2018-01-24 at 12:35 -0800, Tom Herbert wrote: > This is needed to prevent sk_user_data being overwritten. > The check is done under the callback lock. This should prevent > a socket from being attached twice to a KCM mux. It also prevents > a socket from being attached for other use cases of sk_user_data > as long as the other cases set sk_user_data under the lock. > Followup work is needed to unify all the use cases of sk_user_data > to use the same locking. > Reviewed-by: Eric Dumazet