Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3137495ima; Sun, 3 Feb 2019 14:32:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IaYcoAP3KclviQmw+GKM5QUoUV0gUmdCWFXs7tHoYsbXiyua8T6u60AHG45xqzDU8/dyH07 X-Received: by 2002:a17:902:e90d:: with SMTP id cs13mr809457plb.189.1549233122254; Sun, 03 Feb 2019 14:32:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549233122; cv=none; d=google.com; s=arc-20160816; b=MgBOu04r6D+eYNkpLcHAMOaURlYi0uDEEsaLcDQHWZgOG4zcmDAzlqwWTd0z+2Rwzx ds5vRNOZwh81uYp2mBPoalBDN2WC/e6m3VCxKeWEn7k2KmOQcfr0Om2xl5+aK1tzDy30 s4QZmn768wtB0ptP/MuXA8lPA18pSIP37HFUrNBzITTR/BbUpf9IyjuRFM4wsee7d6qh fAE+9jGYlsINOU7XT9NdzYGeyayp8eXmqM5lb5tz7ZnhHV9ybUdHhcIQoTh3DM1VlSgh onlZ7LTYYSNy6eGUodUAksyWArDV2q2Hsl5v6w4TXqFBfarQlvvw76hdA+rD8ahIU7Cg Y/Ow== 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:from:subject:cc:to:message-id:date; bh=G0bCHeA6ZaGIEUee0RcQTFi8mKpWNflhHQc0L5D5zW8=; b=mE0Awx6zvPBG4WJyo1swrHTfJyInP2Q3n4n4hhPnEEXpTrYc2TF+wAtt9N807d80U8 HfFAGfbhIt2+qJqJdUgS1WfdEs6RI7GzIKopOCfLVtMXrMoLCmjbnWeQlO80mKECR7gv I4Ozl1OwDUJy+rb7ss/0jUyqyk6GhpBM6Y0KH5JqeBYF1Ij/bz4tnhu7vn/A3n+6iqus 4tjl/JifDD1tk0Z39Wr3H/n/ZM4osVD1lzT73Yt5FTmjGJFmWucXWcEXQA1gRQKKpv+4 //0DQJxOdNFTWLA31xqqa4FhDeXLAiYIs7dnvAFkTJy1sWc8dcIyda2MuWAsjiiTISZs bPyA== ARC-Authentication-Results: i=1; mx.google.com; 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 l123si14475980pfc.187.2019.02.03.14.31.46; Sun, 03 Feb 2019 14:32:02 -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; 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 S1728014AbfBCWbk (ORCPT + 99 others); Sun, 3 Feb 2019 17:31:40 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:44642 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726673AbfBCWbk (ORCPT ); Sun, 3 Feb 2019 17:31:40 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id B37EA14CB66FD; Sun, 3 Feb 2019 14:31:39 -0800 (PST) Date: Sun, 03 Feb 2019 14:31:39 -0800 (PST) Message-Id: <20190203.143139.2186062220005546704.davem@davemloft.net> To: lucien.xin@gmail.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-sctp@vger.kernel.org, marcelo.leitner@gmail.com, nhorman@tuxdriver.com Subject: Re: [PATCHv3 net] sctp: check and update stream->out_curr when allocating stream_out From: David Miller In-Reply-To: <91ab89c95836cfcacbe823f4bc0ecd2568bad113.1549222078.git.lucien.xin@gmail.com> References: <91ab89c95836cfcacbe823f4bc0ecd2568bad113.1549222078.git.lucien.xin@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 03 Feb 2019 14:31:40 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xin Long Date: Mon, 4 Feb 2019 03:27:58 +0800 > Now when using stream reconfig to add out streams, stream->out > will get re-allocated, and all old streams' information will > be copied to the new ones and the old ones will be freed. > > So without stream->out_curr updated, next time when trying to > send from stream->out_curr stream, a panic would be caused. > > This patch is to check and update stream->out_curr when > allocating stream_out. > > v1->v2: > - define fa_index() to get elem index from stream->out_curr. > v2->v3: > - repost with no change. > > Fixes: 5bbbbe32a431 ("sctp: introduce stream scheduler foundations") > Reported-by: Ying Xu > Reported-by: syzbot+e33a3a138267ca119c7d@syzkaller.appspotmail.com > Signed-off-by: Xin Long Applied and queued up for -stable. Thanks!