From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA906C169C4 for ; Tue, 29 Jan 2019 12:05:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5A4820881 for ; Tue, 29 Jan 2019 12:05:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dwJah2KQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729313AbfA2MFh (ORCPT ); Tue, 29 Jan 2019 07:05:37 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:34200 "EHLO mail-qk1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728595AbfA2MFh (ORCPT ); Tue, 29 Jan 2019 07:05:37 -0500 Received: by mail-qk1-f179.google.com with SMTP id q8so11343833qke.1; Tue, 29 Jan 2019 04:05:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pkqTtGrrPcWiOBcpFHVgGL+ZlC+FPxCEZbmUkte1+1g=; b=dwJah2KQqnONUnI9saQg46c0TnALUkrWZu8agsZFRzpDGj1VwROqdeTE9C7txsQjVX M/W8nnTinkhsCnbHq5FXteVV2tzZQHCLxp+gkgD0kWyk57ygQ+0av+f7b+lC5dOB99Hu iHS0m2nV1+xBZFksEVwwp+ohbq4ZAXcpXQ3fQNzZr3IcooR4CXOPEygHdeatS3zQWnbI xsmhBc9Rhz39iL5VKngD05VkeIShJcOKrcHEM7rCyXwt4bOfZW8C0ZbFk0zvr4kvcMyj Pve4Rpy9Mto68ZT23YI4VoWZUhULrs9ETqy5dhC9/BK98trhN/jULH7apZ82LmvTTngq 5Jvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pkqTtGrrPcWiOBcpFHVgGL+ZlC+FPxCEZbmUkte1+1g=; b=FA1scP6YZgV5/7/ungDkY+xpLq4YMe7U2Gxi6czOzhirnRN6m1YYQbI8kFLRFU0H7W uszJAP3e2kYNZE3UYUWpXbeCwek6dxjzmLZKIxyeoC5gbU+KXsIAmsMuuhQRCuwEz4su Vl6t2A81t9Zsq7EKPhinUWEy/5PwNLuDn2kZkHQowLi+DH281QjaU7xvszrGYNy2pB5y sC7sZx1/7BhqlvuC5PzLjN2hzA9RSiOoKqyRgECahV3Csj7OtQWB9h1SHHnCciigUqj+ eGGQDHVY2v6ciqr3V8RJWyvEvXMtcwbNIZtp2U50GhwgkLkpftP+4/6wC90iLd7j+bUN raEA== X-Gm-Message-State: AJcUukcmGk9lazamzyLKT/pc9Ef1V9jUMzGbPyxmqJt6b2NFy4AIdrxp 8XkJupeh9Fr1wGCu2hTvXLI= X-Google-Smtp-Source: ALg8bN46zB46B574FFBwy7bK5mIEGopEUpCzS5hegentzTjKo+UZnhqLisQ0EMNoPtxgmS6c3NES5Q== X-Received: by 2002:a37:4d8e:: with SMTP id a136mr23067715qkb.318.1548763535653; Tue, 29 Jan 2019 04:05:35 -0800 (PST) Received: from localhost.localdomain ([2001:1284:f019:aafc:355f:d963:bdee:e508]) by smtp.gmail.com with ESMTPSA id n11sm44016523qke.82.2019.01.29.04.05.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Jan 2019 04:05:34 -0800 (PST) Received: by localhost.localdomain (Postfix, from userid 1000) id 0E34B180B7C; Tue, 29 Jan 2019 10:05:32 -0200 (-02) Date: Tue, 29 Jan 2019 10:05:32 -0200 From: Marcelo Ricardo Leitner To: Xin Long Cc: network dev , linux-sctp@vger.kernel.org, davem@davemloft.net, Neil Horman Subject: Re: [PATCHv2 net] sctp: check and update stream->out_curr when allocating stream_out Message-ID: <20190129120531.GC10665@localhost.localdomain> References: <8a5df8eb5cc41dfc3d08e294147b9729bbe90aa0.1543473776.git.lucien.xin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8a5df8eb5cc41dfc3d08e294147b9729bbe90aa0.1543473776.git.lucien.xin@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Nov 29, 2018 at 02:42:56PM +0800, Xin Long wrote: > 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. > > Fixes: 5bbbbe32a431 ("sctp: introduce stream scheduler foundations") > Reported-by: Ying Xu > Reported-by: syzbot+e33a3a138267ca119c7d@syzkaller.appspotmail.com > Signed-off-by: Xin Long We are sort of mixing things up here. We have a bug on SCTP stack that triggers panics. As good practices recommends, the code should be as generic as possible and the SCTP-only was dropped in favor of a more generic one, fixing rhashtables instead. Okay. But then we discovered rhashtables are going away and we are now waiting on a restructing to fix the panic. That's not good, especially because it cannot and should not be backported into -stable trees. That said, we should not wait for the restructuring to _implicitly_ fix the bug. We should pursuit both fixes here: - Apply this patch, to fix SCTP stack and allow it to be easily backportable. - Apply the generic fix, which is the restructuring, whenever it actually lands. Thoughts? Thanks, Marcelo