Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp781524pxb; Thu, 19 Nov 2020 13:43:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKjisj292/kNiQZ6C4PpYj3oaa4trfQQicc+SrvZ/hjjbFiF3L8JUN8DrlGOVWIdCkaP6h X-Received: by 2002:a17:906:ccd3:: with SMTP id ot19mr31087274ejb.44.1605822185704; Thu, 19 Nov 2020 13:43:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605822185; cv=none; d=google.com; s=arc-20160816; b=G/FWc/EJS74rCma4HNS9samEb0Hv0tXyaPfG+HCf3DeTVdJAtjZF2xMUMa/u0zYAGS mc5h0NgjpPdN5N1UgSt0/Se9ZeLwF8dTYhNDO5geb3zO4DauzVCUGFfrBzYOmXxudPaL bzX8bimoHUIJKNjcIffzMbdoQw//iuUPLsMwS+L4Ak9n3uE5TC7e2tAh3X+/N6BMakW+ xMdxZ0poDdHhNQ2tYgKkBom8UhHf+d80M5sV0xTU5paHBj/NKh8d5RO27H9Tn8I9XKmr FxHvkXxc1pODmKCfI/gVTRsvsDpzEDiqP7w3RO58M86zsaODFAXJldAhd7BphFHDWMpR ebQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=fO3abGMe6aEbuQQNfcMhV3rLE5ots6C1i/A0DsWb7Vs=; b=SrASy94dSCzgCPf78heW/+wMCBtlIcqN90K0LAH4JLhlO48DLrlSu9MsU+1J5xsTem Bu3oOccMSCqw34s/6vpc+y6llLf239x2WsZaXB0yvalMoPKkda0dm0XyZMFQWMMlz0Mm D0Yts9cylm24ktenPZLz/7BGHcknhKM09iNuPEx91Z3AF0xXWCudE5TG3BrHqPXAMn66 AqKXvs1M4O75Pk3Q5tgZoDSKegpbasdzaU5GWQSs1KQDhXxIYujHRWEEIUH5+c6GvYCM sqJsraxXJUElJc3KyeK8CLWGRBJ37g6JmHRXUll5kRf9I/mD9DidLzLgYuZz1g+/MxZW KODg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q7si606148edc.249.2020.11.19.13.42.41; Thu, 19 Nov 2020 13:43:05 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727745AbgKSO74 (ORCPT + 99 others); Thu, 19 Nov 2020 09:59:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:59088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726641AbgKSO74 (ORCPT ); Thu, 19 Nov 2020 09:59:56 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EDAB624695; Thu, 19 Nov 2020 14:59:52 +0000 (UTC) Date: Thu, 19 Nov 2020 09:59:51 -0500 From: Steven Rostedt To: Segher Boessenkool Cc: Peter Zijlstra , Florian Weimer , Nick Desaulniers , Sami Tolvanen , Mathieu Desnoyers , linux-kernel , Matt Mullins , Ingo Molnar , Alexei Starovoitov , Daniel Borkmann , Dmitry Vyukov , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , netdev , bpf , Kees Cook , Josh Poimboeuf , linux-toolchains@vger.kernel.org Subject: Re: violating function pointer signature Message-ID: <20201119095951.30269233@gandalf.local.home> In-Reply-To: <20201119143735.GU2672@gate.crashing.org> References: <375636043.48251.1605642440621.JavaMail.zimbra@efficios.com> <20201117153451.3015c5c9@gandalf.local.home> <20201118132136.GJ3121378@hirez.programming.kicks-ass.net> <20201118121730.12ee645b@gandalf.local.home> <20201118181226.GK2672@gate.crashing.org> <87o8jutt2h.fsf@mid.deneb.enyo.de> <20201118135823.3f0d24b7@gandalf.local.home> <20201118191127.GM2672@gate.crashing.org> <20201119083648.GE3121392@hirez.programming.kicks-ass.net> <20201119143735.GU2672@gate.crashing.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Nov 2020 08:37:35 -0600 Segher Boessenkool wrote: > > Note that we have a fairly extensive tradition of defining away UB with > > language extentions, -fno-strict-overflow, -fno-strict-aliasing, > > These are options to make a large swath of not correct C programs > compile (and often work) anyway. This is useful because there are so > many such programs, because a) people did not lint; and/or b) the > problem never was obvious with some other (or older) compiler; and/or > c) people do not care about writing portable C and prefer writing in > their own non-C dialect. Note, this is not about your average C program. This is about the Linux kernel, which already does a lot of tricks in C. There's a lot of code in assembly that gets called from C (and vise versa). We modify code on the fly (which tracepoints use two methods of that - with asm-goto/jump-labels and static functions). As for your point c), I'm not sure what you mean about portable C (stuck to a single compiler, or stuck to a single architecture?). Linux obviously supports multiple architectures (more than any other OS), but it is pretty stuck to gcc as a compiler (with LLVM just starting to work too). We are fine with being stuck to a compiler if it gives us what we want. -- Steve