Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp300667ybg; Mon, 1 Jun 2020 01:29:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTUCHW/w377Gh1MeuUuCLKUqVoecb8ZJw7BbtZsCzAuddy6INVi7S5KMhP7ThWNHwLEJUR X-Received: by 2002:a17:906:e2d5:: with SMTP id gr21mr8168835ejb.219.1591000166565; Mon, 01 Jun 2020 01:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591000166; cv=none; d=google.com; s=arc-20160816; b=jMm/uRO9lFzquAvmG5Ms+VOkK1fiwBxMXKH4V8ut0yvSLzJDe7dowESD+Ii0My5kUe UYPp6R/VyeMPCH8WlapXMupALPHxgMl9wGT9n8iYuxOo9pKs3EWk/59bEPIkGOHAPmQj Bdj6J52BV6tEb5FtEQKGUl1caf10aOeM4CJPis4kEOJbppQnbyecm+a6wzlCDvNhB+s9 6pTPgj2eLhqRq0sJfj7+8qJ3leKRvnxYXjNwpGYfpKs9nuEWRtVxcprPzqDx0O+HLQaQ 0+VGjbzFSzlMHNrtH3fDHzOFx/JSqCkWI7iG+5L0G5ol3WLp/BZjEXNmttsGH4XhNXCB mInA== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=PlMBAKqNh8eTHSDw0JACf1Xzwa2DFml2fu0Ayk32yDE=; b=wXN3OIv37izeHVHpmOA6o6Bf3ZFP+L6NvqLbD/1ifYe2PITEeAgrekPL8ivce4J0aH BdHntq4mR2FuP7a0K+hKwyKvan3MGV/mwHG1JmdU1icV04JBrcF5xlDOcbKBkkKjDTwj 3klNvbmHyjfvlMh43c0RF8sJkquCM0F67XVF3yCNn8VHBy9Iq4MAtG4Kc8DcnGqK858/ E6JUdNcL/OI+bYd84D0u7On6OLlI3iIxQXbxiPJCzar4Out+kkM8HDByV3wkzvXC1ukA DE0cX4jDbfZ9WdQjO+XrzQuMkQFNkaqMZpVU9BPDDsxlcf1WTxpdn0MANtdvnD0t6Ors OdFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k1si8434921eja.313.2020.06.01.01.29.02; Mon, 01 Jun 2020 01:29:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728195AbgFAI1N convert rfc822-to-8bit (ORCPT + 99 others); Mon, 1 Jun 2020 04:27:13 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:26364 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728106AbgFAI1M (ORCPT ); Mon, 1 Jun 2020 04:27:12 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-4-qyf_xz7jMHaz2OtF4B_ISQ-1; Mon, 01 Jun 2020 09:27:08 +0100 X-MC-Unique: qyf_xz7jMHaz2OtF4B_ISQ-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 1 Jun 2020 09:27:08 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Mon, 1 Jun 2020 09:27:08 +0100 From: David Laight To: 'Marcelo Ricardo Leitner' , Christoph Hellwig CC: "David S. Miller" , Jakub Kicinski , Vlad Yasevich , Neil Horman , "linux-sctp@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "cluster-devel@redhat.com" , "netdev@vger.kernel.org" Subject: RE: [PATCH 2/4] sctp: refactor sctp_setsockopt_bindx Thread-Topic: [PATCH 2/4] sctp: refactor sctp_setsockopt_bindx Thread-Index: AQHWNdMG2Q0k5UY/FEi3sQ5al/OVkajDcLLw Date: Mon, 1 Jun 2020 08:27:08 +0000 Message-ID: References: <20200529120943.101454-1-hch@lst.de> <20200529120943.101454-3-hch@lst.de> <20200529160544.GI2491@localhost.localdomain> In-Reply-To: <20200529160544.GI2491@localhost.localdomain> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marcelo Ricardo Leitner > Sent: 29 May 2020 17:06 > On Fri, May 29, 2020 at 02:09:41PM +0200, Christoph Hellwig wrote: > > Split out a sctp_setsockopt_bindx_kernel that takes a kernel pointer > > to the sockaddr and make sctp_setsockopt_bindx a small wrapper around > > it. This prepares for adding a new bind_add proto op. > > > > Signed-off-by: Christoph Hellwig > > Acked-by: Marcelo Ricardo Leitner > > > --- > > net/sctp/socket.c | 61 ++++++++++++++++++++++------------------------- > > 1 file changed, 28 insertions(+), 33 deletions(-) > > > > diff --git a/net/sctp/socket.c b/net/sctp/socket.c > > index 827a9903ee288..6e745ac3c4a59 100644 > > --- a/net/sctp/socket.c > > +++ b/net/sctp/socket.c > > @@ -972,23 +972,22 @@ int sctp_asconf_mgmt(struct sctp_sock *sp, struct sctp_sockaddr_entry *addrw) > > * it. > > * > > * sk The sk of the socket > > - * addrs The pointer to the addresses in user land > > + * addrs The pointer to the addresses > > * addrssize Size of the addrs buffer > > * op Operation to perform (add or remove, see the flags of > > * sctp_bindx) > > * > > * Returns 0 if ok, <0 errno code on error. > > */ > > -static int sctp_setsockopt_bindx(struct sock *sk, > > - struct sockaddr __user *addrs, > > - int addrs_size, int op) > > +static int sctp_setsockopt_bindx_kernel(struct sock *sk, const > > + struct sockaddr *addrs, int addrs_size, > > + int op) The list of addresses ought to be 'const'. IIRC that requires the test for 'port == 0' be moved down a few layers. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)