From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] sctp: init active key for the new asoc in dupcook_a and dupcook_b Date: Wed, 02 May 2018 11:16:37 -0400 (EDT) Message-ID: <20180502.111637.1201522056104570616.davem@davemloft.net> References: <96c2191206cb67ccec250ca1ec66d83dc9f40c9a.1525239464.git.lucien.xin@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linux-sctp@vger.kernel.org, marcelo.leitner@gmail.com, nhorman@tuxdriver.com To: lucien.xin@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:33016 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750936AbeEBPQj (ORCPT ); Wed, 2 May 2018 11:16:39 -0400 In-Reply-To: <96c2191206cb67ccec250ca1ec66d83dc9f40c9a.1525239464.git.lucien.xin@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Xin Long Date: Wed, 2 May 2018 13:37:44 +0800 > When processing a duplicate cookie-echo chunk, for case 'A' and 'B', > after sctp_process_init for the new asoc, if auth is enabled for the > cookie-ack chunk, the active key should also be initialized. > > Otherwise, the cookie-ack chunk made later can not be set with auth > shkey properly, and a crash can even be caused by this, as after > Commit 1b1e0bc99474 ("sctp: add refcnt support for sh_key"), sctp > needs to hold the shkey when making control chunks. > > Fixes: 1b1e0bc99474 ("sctp: add refcnt support for sh_key") > Reported-by: Jianwen Ji > Signed-off-by: Xin Long Applied.