Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1080907imj; Sat, 9 Feb 2019 15:13:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IZRAkA6pmP0ZuKmYRArIsRQjr4vBWSjkn9JQysYK66cEedSBuXKOsyV1VX8q7ejnbjXJZBJ X-Received: by 2002:a17:902:12e:: with SMTP id 43mr12955443plb.31.1549754000687; Sat, 09 Feb 2019 15:13:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549754000; cv=none; d=google.com; s=arc-20160816; b=ocST3qnOd0Oe3lj/+26IY9vXvHAEmF+HOaK9iMIL7DOzNUegWZn72Eh0vOrs7mbumb zwPjjWPhm2FsaIr1dXiT0otuqYj4jzlzuiTKJCt32noaOXiH0XOVRLuQngwXaNDpFW3h xre6d/SMRKNuadmob/CvpPWl0uWBhDTEFqZ9Yaj8iRzIjefS0il71QuS6J6ZDK42lG6s 86/38pZFi4conqTzHZ0af5WZPTI4qN+SoURTY+ReqVr4mUgZmEjwvOleDjDFmzW8SYFu 54ny2F3G8zls1yRKVG+y1DXMxNb7nVp87CH7m1XiyNHX8ArkaqT4DNQQfpW5cgVX+5CZ WbLQ== 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=HTy02c1+HXhaX/HgdT2bLrSHtixk9/r73laVWGrQ4wI=; b=KNJxkASXUj/V/khEEOAO4rFwDwatergeYgv1V4Qgvf6bHs1d0zy9JiDEsIq9u8LCfh SsVAlx75Gde2tmNK+MDKRdE9lb4WD/O2z4WC+QeSUf+q0hf9QZrK0Mjfxy2WrM/umP/G WnYU15Yfnf8i7NViY13LseUm9TeyvY6KJKhIt79LC/99Du7IdErdDh+Ogk5IVmSRhyVc HEIX9pftRKtHoMx8hy/xHR1L8svBRxub8nIBdDHYvTaF1fMh1CnwqE/n1CTtvuMJ0HYH IsPmVBKv5rapZa1WR8nDTcTc7r4Hj4LgsS9P+0Oc3SA0dLp8mm6RXrKv9+8u11YjMFcY L18w== 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 q14si5926933pgf.47.2019.02.09.15.13.05; Sat, 09 Feb 2019 15:13:20 -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 S1727139AbfBIXMV (ORCPT + 99 others); Sat, 9 Feb 2019 18:12:21 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:49710 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726933AbfBIXMU (ORCPT ); Sat, 9 Feb 2019 18:12:20 -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 C9F7D14B3D8EC; Sat, 9 Feb 2019 15:12:19 -0800 (PST) Date: Sat, 09 Feb 2019 15:12:17 -0800 (PST) Message-Id: <20190209.151217.175627323493244750.davem@davemloft.net> To: marcelo.leitner@gmail.com Cc: julien@arista.com, netdev@vger.kernel.org, linux-sctp@vger.kernel.org, linux-kernel@vger.kernel.org, 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 From: David Miller In-Reply-To: <20190206203754.GC13621@localhost.localdomain> References: <20190206201430.18830-1-julien@arista.com> <20190206203754.GC13621@localhost.localdomain> 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]); Sat, 09 Feb 2019 15:12:20 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marcelo Ricardo Leitner Date: Wed, 6 Feb 2019 18:37:54 -0200 > 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? What a complete mess we have here. Use new socket option numbers next time, do not change the size and/or layout of existing socket options. This whole thread, if you read it, is basically "if we compatability this way, that breaks, and if we do compatability this other way oh shit this other thing doesn't work." I think we really need to specifically check for the difference sizes that existed one by one, clear out the part not given by the user, and backport this as far back as possible in a way that in the older kernels we see if the user is actually trying to use the new features and if so error out. Which, btw, is terrible behavior. Newly compiled apps should work on older kernels if they don't try to use the new features, and if they can the ones that want to try to use the new features should be able to fall back when that feature isn't available in a non-ambiguous and precisely defined way. The fact that the use of the new feature is hidden in the new structure elements is really rotten. This patch, at best, needs some work and definitely a longer and more detailed commit message.