Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp657407imj; Thu, 7 Feb 2019 09:48:18 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib01rkIHBJV4ZhbdGjo6oVB7UHskyJrawuIIMqMc+2u60eZLsgbj7dnnwvHAcsG/bVSm4PJ X-Received: by 2002:a17:902:b114:: with SMTP id q20mr13247306plr.48.1549561698314; Thu, 07 Feb 2019 09:48:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549561698; cv=none; d=google.com; s=arc-20160816; b=oyR5yQvubwyp28vbr80aUbUs59j11cMrev+hHcTmAG1r/UOPmuQW0bthcRW20CCt3L 9aEeDM0/dmj0KtkYxEewaqWor6Ns/r3PRK+KPUMmuBs/49JE13HHcODW0lkawMprwYvI f7YaOZ6K+9pDQACeuifJnD4wAzsoi3ZvCJ9X/2CRT2n6orx2FlLitL7UFQQG9H1Wge3t seh/o+pqMt/WyI0/AAiJYkQJ69k0+AMA+Ky+NXkoGqzxh5eItkbLr4uba1VsPF8pA6I3 rJ2xUjACjWqIG1sGd6Yddxn2AlzTeuBSut6tXNPjPWDdTWCg4ArKKk2Rfc22iz6gwMtQ uOdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tyFtXeXAq3xEDtPxgYsIo8ynnJPzJwUMHkslAlj3iTM=; b=Ba52aqqmg4IcofUfwrnqnmvyrFdUTTdMiV5vXedSNqIW3vZ/bFU120HmLkTxm0MlIw FenkPmL+itsU+l32O+y0Pdu8Y4vOadnYhAQH0AROOVh5y5vsoJ3DFPgeruwKquz00Rsc FDz507Jung85kVyzP/kKy6L/smq4TY1gm1q4Vq4eTyVXkCzS8ee28LOfqLXN97dAFz6u TIK9dJd9FuSbdCmp1lMk8UvheNjLLmZv0jLzkfAMxsY6nyhubaxuvRPCDl6FdpNnHxvP 3OjI+gaFaV4/dGZN5s3BoZSe8wUYKwlSENNepnc45MYMCCwW+Pf5mVrdB3UyOJ3rwrP3 aWUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jeMcskHP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b21si9223475pls.31.2019.02.07.09.48.02; Thu, 07 Feb 2019 09:48:18 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jeMcskHP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726943AbfBGRrW (ORCPT + 99 others); Thu, 7 Feb 2019 12:47:22 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:45810 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbfBGRrV (ORCPT ); Thu, 7 Feb 2019 12:47:21 -0500 Received: by mail-qt1-f195.google.com with SMTP id e5so783492qtr.12; Thu, 07 Feb 2019 09:47:20 -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=tyFtXeXAq3xEDtPxgYsIo8ynnJPzJwUMHkslAlj3iTM=; b=jeMcskHP8tzhmmEJdeXCNsc6TgSJGDtnNWVPwuqKXEHCIVg/ItMNpEAqIbs4rN+60e uEbfXp3rPACfd9uFQlxJyfcHZBUOPU0MrUc3xIN9TZY6DIiCqkYJ+sr9nkH+7bHVWCUZ T85mRIfsTAPPYiCp29y6VYhIjeiJyAPfBwHG/ysGQalRFVbsSVvJHVxH2Bfz4lUKPB7T jz/anMJ2W1Tp7CLdC4zj1gnRbHQWGC/d/bltqPQyVEFtMIraf6YQo/5mFd5mXkg0AQyC lsFZ4+xz2YaSF83UJ0O2JaqOWOIB0QmrXwk+tjRO3NltTyWQpmMpKIeXRCpq7GmX5xO7 /9Rw== 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=tyFtXeXAq3xEDtPxgYsIo8ynnJPzJwUMHkslAlj3iTM=; b=F4DHqK+DPTZ6tpsjBt4/jQL2pi97sofrR62iYwGEQ1xdUsItRLtzn2Yv2H5PDWPHtK YLdpSAYDt+SQiQF6yjQ/k3/iZibCYzIOW9I6DbVBOfOW531oRI6+SqQ1TZzZd7l2+l4y W9n/DTk1dmwDPfJ3li10f5ZzZxAXGLz7sX/vgF5JjyKrcBWm7t4YtVfaKEKQpoAhTQ4d GkZw9DIZr91MbyUQIB+2qGYZTjQzdvAJWj4Q8X8GA5JczWA+Z1pizih6wA4GMFcZUkF1 lR7h4PDxNtCZBR+JzGtFrp6N/roYySMV/DaoEnqW/Q8UTUf6/nFIzPMwttoy4vsWcC+P XB4A== X-Gm-Message-State: AHQUAubeHA+JsCWs7jWtXh7D/qg3j+Gal8087d5QzeGwj5JwQ5L/hNas 7R+qo9LKHp4OuDvkh6SuW3KUqPFyesM= X-Received: by 2002:ac8:71d0:: with SMTP id i16mr13216853qtp.386.1549561640032; Thu, 07 Feb 2019 09:47:20 -0800 (PST) Received: from localhost.localdomain ([2001:1284:f019:c4a1:e98a:edae:d055:8fc6]) by smtp.gmail.com with ESMTPSA id s65sm11023067qkc.97.2019.02.07.09.47.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 09:47:18 -0800 (PST) Received: by localhost.localdomain (Postfix, from userid 1000) id AEF75180CC4; Thu, 7 Feb 2019 15:47:15 -0200 (-02) Date: Thu, 7 Feb 2019 15:47:15 -0200 From: 'Marcelo Ricardo Leitner' To: David Laight Cc: Julien Gomes , "netdev@vger.kernel.org" , "linux-sctp@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "davem@davemloft.net" , "nhorman@tuxdriver.com" , "vyasevich@gmail.com" , "lucien.xin@gmail.com" Subject: Re: [PATCH net] sctp: make sctp_setsockopt_events() less strict about the option length Message-ID: <20190207174715.GF13621@localhost.localdomain> References: <20190206201430.18830-1-julien@arista.com> <20190206203754.GC13621@localhost.localdomain> <20190206210723.GD13621@localhost.localdomain> <1257941619984a2a992af8d801855c04@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1257941619984a2a992af8d801855c04@AcuMS.aculab.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 07, 2019 at 05:33:07PM +0000, David Laight wrote: > From: Marcelo Ricardo Leitner > > Sent: 06 February 2019 21:07 > > > > On Wed, Feb 06, 2019 at 12:48:38PM -0800, Julien Gomes wrote: > > > > > > > > > On 2/6/19 12:37 PM, Marcelo Ricardo Leitner wrote: > > > > On Wed, Feb 06, 2019 at 12:14:30PM -0800, Julien Gomes wrote: > > > >> Make sctp_setsockopt_events() able to accept sctp_event_subscribe > > > >> structures longer than the current definitions. > > > >> > > > >> This should prevent unjustified setsockopt() failures due to struct > > > >> sctp_event_subscribe extensions (as in 4.11 and 4.12) when using > > > >> binaries that should be compatible, but were built with later kernel > > > >> uapi headers. > > > > > > > > Not sure if we support backwards compatibility like this? > > > > > > > > My issue with this change is that by doing this, application will have > > > > no clue if the new bits were ignored or not and it may think that an > > > > event is enabled while it is not. > > > > > > > > A workaround would be to do a getsockopt and check the size that was > > > > returned. But then, it might as well use the right struct here in the > > > > first place. > > > > > > > > I'm seeing current implementation as an implicitly versioned argument: > > > > it will always accept setsockopt calls with an old struct (v4.11 or > > > > v4.12), but if the user tries to use v3 on a v1-only system, it will > > > > be rejected. Pretty much like using a newer setsockopt on an old > > > > system. > > > > > > With the current implementation, given sources that say are supposed to > > > run on a 4.9 kernel (no use of any newer field added in 4.11 or 4.12), > > > we can't rebuild the exact same sources on a 4.19 kernel and still run > > > them on 4.9 without messing with structures re-definition. > > > > Maybe what we want(ed) here then is explicit versioning, to have the 3 > > definitions available. Then the application is able to use, say struct > > sctp_event_subscribe, and be happy with it, while there is struct > > sctp_event_subscribe_v2 and struct sctp_event_subscribe_v3 there too. > > > > But it's too late for that now because that would break applications > > already using the new fields in sctp_event_subscribe. > > It is probably better to break the recompilation of the few programs > that use the new fields (and have them not work on old kernels) > than to stop recompilations of old programs stop working on old > kernels or have requested new options silently ignored. I got confused here, not sure what you mean. Seems there is one "stop" word too many. > > There are all sorts of reasons why programs get built on systems that > are newer than the ones they need to run on. > I'm currently planning to get around the glibc 'memcpy()' fubar so I > can retire some very old build systems before their disks die. You can virtualize those. That's not really a good reason for building with newer kernel and running on old systems, as virtually any old system can be virtualized. Marcelo > > Fortunately our sctp code is in the kernel - so has to be compiled > with the correct headers. > > > > I understand your point, but this still looks like a sort of uapi > > > breakage to me. > > > > Not disagreeing. I really just don't know how supported that is. > > Willing to know so I can pay more attention to this on future changes. > > Agreed, these structures should never be changed. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) >