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=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,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 8B6B1C43381 for ; Thu, 14 Mar 2019 01:23:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 50FBF213A2 for ; Thu, 14 Mar 2019 01:23:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M1c47ujO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726568AbfCNBXu (ORCPT ); Wed, 13 Mar 2019 21:23:50 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:39428 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726412AbfCNBXt (ORCPT ); Wed, 13 Mar 2019 21:23:49 -0400 Received: by mail-qt1-f195.google.com with SMTP id t28so4301722qte.6 for ; Wed, 13 Mar 2019 18:23:49 -0700 (PDT) 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=ql/oEoT1Nocox4/u536p+az7slruYIXhRaawNt8j2tQ=; b=M1c47ujOrHj3+y8VZWMo2lrX2L+XMQ8U8efxw1qH3KeXMos8ZK4M9rO4dzHRH/csLC 6zNi3V8hfWxmmJwMVVF0h25vD/Q5gvmjdRL6Vv4E3lMQMmrsXuy6AjONyEZ6XLdafyyJ 2deb0I3DiObTdLrHtxgd8ka+tMOid/RJajClMCmMTCcK+iC9IcW3QgxJRiOdPLMeTRYu sYyPwHo6LJqvXLK3dCalpN6hJ5EHoNnIoQdA5AEnO3uez2L0OdSTjYSZiciYvklXQq4g hfp38blU0X0jo5FjgknO+RHJl+nVqfq9cIN7aQQlTCTeNQ/Y/dVSCC35LYiC3RfUa3Oa t3wA== 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=ql/oEoT1Nocox4/u536p+az7slruYIXhRaawNt8j2tQ=; b=eMONRuE9LtyDbZxOONUkecZKq+m/tYOSXIJr354jnH/sES2QBKoOSKOdBWxfc2rRmP tcAy3iKksDEzKH6fJy6SSVDGy6fUzzDMy+c5wuTuUGpieYFPjSfGAOoym/gY/J8r30i/ M4YnlRHIVppcw9FRq7Q2LFSJPIeIuW9Kb32DNgXUjWUhpAzMAnL5U643zOexKdjaAH8R SAZ9bkITwpOM0nO96uGrXi7r7othHjONyd3ES6fZluyCjGZeuiGEHx05wJ8msxxDaR+p PvLEozWFtPjaJAbMSguff0XFn2ns3BvjMcRewnzlpQmtN30y21Z1U6OERzSnW9e/Aekh yxdg== X-Gm-Message-State: APjAAAVOWNr/EVIi/CZ6T6nLYN5K26f6VXxe7AO/5O+MM7Xjz54ZmeqQ 6lKNqTOqCHQ8MnqrVDrxQCs= X-Google-Smtp-Source: APXvYqweA9pPSd24b5wseIfDc7ZpQS3ih0wGnaZ9QlBBHj4ctnVNtveu6V4+tCDaA8AnAWu724mvQA== X-Received: by 2002:a0c:e706:: with SMTP id d6mr9541061qvn.141.1552526628457; Wed, 13 Mar 2019 18:23:48 -0700 (PDT) Received: from localhost.localdomain ([177.220.172.154]) by smtp.gmail.com with ESMTPSA id t27sm1925926qth.97.2019.03.13.18.23.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Mar 2019 18:23:47 -0700 (PDT) Received: by localhost.localdomain (Postfix, from userid 1000) id 759B7180C43; Wed, 13 Mar 2019 22:23:44 -0300 (-03) Date: Wed, 13 Mar 2019 22:23:44 -0300 From: Marcelo Ricardo Leitner To: David Miller Cc: netdev@vger.kernel.org, lucien.xin@gmail.com, nhorman@tuxdriver.com Subject: Re: [PATCH RFC v4 0/5] SCTP: Event skb list overhaul. Message-ID: <20190314012344.GA13514@localhost.localdomain> References: <20190311.200919.2201899718784012074.davem@davemloft.net> <20190313160621.GI13343@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190313160621.GI13343@localhost.localdomain> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Mar 13, 2019 at 01:06:21PM -0300, Marcelo Ricardo Leitner wrote: > On Mon, Mar 11, 2019 at 08:09:19PM -0700, David Miller wrote: > > > > This patch series eliminates the explicit reference to the skb list > > implementation via skb->prev dereferences. > > > > The approach used is to pass a non-empty skb list around instead of an > > event skb object which may or may not be on a list. > > > > I'd like to thank Marcelo Leitner, Xin Long, and Neil Horman for > > reviewing previous versions of this series. > > > > Testing would be very much appreciated, in addition to the review of > > course. > > > > v3 --> v4: Fix the logic in patch #4 so that we don't miss cases > > where we should add event to the on-stack temp list. > > > > Signed-off-by: David S. Miller > > Code review LGTM too. > Running some tests, should be done by the end of the day. Tests were good with the exception of one unrelated issue. ACK from my side thus. Xin, would you mind carrying forward this fix? I think we need to fix the other sockopts too. Thanks! ---8<--- >From ddba48476b343dce84a82036e7914a1f7ac3f0c8 Mon Sep 17 00:00:00 2001 Message-Id: From: Marcelo Ricardo Leitner Date: Wed, 13 Mar 2019 22:13:52 -0300 Subject: [PATCH] net/sctp: fix ignoring asoc_id for tcp-style sockets on setsockopt Currently if the user pass an invalid asoc_id to SCTP_DEFAULT_SEND_PARAM on a TCP-style socket, it will silently ignore the new parameters. That's because after not finding an asoc, it is checking asoc_id against the known values of CURRENT/FUTURE/ALL values and that fails to match. IOW, if the user supplies an invalid asoc id or not, it should either match the current asoc or the socket itself so that it will inherit these later. Fixes it by forcing asoc_id to SCTP_FUTURE_ASSOC in case it is a TCP-style socket without an asoc, so that the values get set on the socket. Fixes: 707e45b3dc5a ("sctp: use SCTP_FUTURE_ASSOC and add SCTP_CURRENT_ASSOC for SCTP_DEFAULT_SEND_PARAM sockopt") Signed-off-by: Marcelo Ricardo Leitner --- net/sctp/socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 533207dbeae955604a6304a8f67b65c9f580fd05..85205a2d9a7dc5c289a94bf4672b240040cbb546 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -3024,6 +3024,9 @@ static int sctp_setsockopt_default_send_param(struct sock *sk, return 0; } + if (sctp_style(sk, TCP)) + info.sinfo_assoc_id = SCTP_FUTURE_ASSOC; + if (info.sinfo_assoc_id == SCTP_FUTURE_ASSOC || info.sinfo_assoc_id == SCTP_ALL_ASSOC) { sp->default_stream = info.sinfo_stream; -- 2.20.1