Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp932660rdh; Sun, 24 Sep 2023 19:35:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwhh1pQN8GWPggRU/0zuFRKXRDuENqb9O0m3V7zn9QPwFY1pE9IPNCZeIQfm05xQqcuwbV X-Received: by 2002:a05:6a21:798:b0:160:6983:91d6 with SMTP id mg24-20020a056a21079800b00160698391d6mr1201249pzb.22.1695609347698; Sun, 24 Sep 2023 19:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695609347; cv=none; d=google.com; s=arc-20160816; b=XIGWokPJtjdMnJ4aKjKt6EhBb0Qs4CR8DkeJcuURHU987+VU43i/evk91ee2JqfD2z rnYLUjo2O2KDp8yKJXdOAV1qV+zn83NUDP51/j8Ufq+2iryYFvMceR/m54XXKBL7Ynf1 arkGOWtJCE1PK1SUQ3JeDZHF3A+7Y5bwNkRqCQMI6XHQv+CiIfKf8XO7sDvVnjChSk7p dQXf2EGy3mRu3d9zAiwfKIxorfPRhtrRRNP1OeiSE88qfRUKmdefGi6o2SWanQ8JU/95 FBTqnN/Sv1KmYBXOgAYx7J6vJJs3pu4N0m8hkiRU79vBeXhDNhIaOfdpj5nIaurGqC+e A4/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1XW+n8l4tbJu47AKEn2z/gzBzCsxjR0qfp5ki1h8zQs=; fh=cdwm/EH+xYhMJBB1hkZmCZyfcJt99DEidCBldirkmrs=; b=GReRUZ1P7QY9pOFMbzIfP5lsMu/77qrg2KtRvzFif57yQ/c7jgGxW01Iq3BMJnujIy 6lL7hL2se5GaK9iXh+07tPbBSaUMQZ1C/aqlGWe2r8sqOFQh0WnD6zPbAiGexhONkCVM BQezNwsVH6KriPXcyOjlAqPZQT+FPNKEUrS4hiR2zQPo6DZeMGeiv+FKAKre/H+RBl3j 8YRsY36RjWmdjrrxwVyfUz0qY9pi6Ll3KdcUJE/SarQFGnI5iyqN8fy8lb20Lfp2ogKy k4bILNV7uewFkg/WYS1Dc79Cc5ztqU1T+gnW46hEvtIc2iJEHEfY+aWGi0x7JJgIpaMX iB1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HUqmdfzw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l10-20020a65560a000000b00577f65baa3esi8775908pgs.775.2023.09.24.19.35.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 19:35:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HUqmdfzw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8E4A4802FD2D; Sun, 24 Sep 2023 09:58:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbjIXQ6m (ORCPT + 99 others); Sun, 24 Sep 2023 12:58:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjIXQ6m (ORCPT ); Sun, 24 Sep 2023 12:58:42 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDC59FC; Sun, 24 Sep 2023 09:58:35 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-99c93638322so1166443166b.1; Sun, 24 Sep 2023 09:58:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695574714; x=1696179514; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=1XW+n8l4tbJu47AKEn2z/gzBzCsxjR0qfp5ki1h8zQs=; b=HUqmdfzwZuuAP5NHCaPM55mMyYBlNZyr0WP+t8f4T/ta7sZRaasyCU61wJKu9anNUb iTM+q0+kaq//kUVHaJjde8D5sFsUKUue+OoGj9Ek4HiUGsF+T/oudOOyTfPhR3hJz2+J 6YfoMQzJ5cWq8mrmurxAsZfdUmQh51imy2sh7MEPDpLjSwMn61mbZK6OQ0M6Rvc2lbJH 78nbS4KjGlcvVBXYS6H7q0PYs2aiR6sVex2y3ovfUKEkSHxnIVZpdy13y8vQirb4qnch dQLS+vAkJ2zDmtkFIWt9Nl7grTHtRgETQEcvprwcQZTv3ymtTFAgKFzvUaYcHaI8IxSj Ybpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695574714; x=1696179514; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1XW+n8l4tbJu47AKEn2z/gzBzCsxjR0qfp5ki1h8zQs=; b=lF8z2DrvsyAXxwca17l12NzIcqm63JHQzsHiJhrwvbKsmQLNG0ihoQkTzLkhaHI9Cg 0lBwx9DCcNdR9h/VdTyWe+205BjAfKkn+4KEmh0zVhTqMw74ZCNp36UTFyT0GMTgkMeZ ZP8iKCKvOgdhv3+V7wxA+nukXwISVyAVuGIhO1O11sAu8JZbVEbk0fz5cjHQWHK26Yl8 P7zqP9Ja6+xDKK3Gwekcn/kM1aLkxu0SvAyxuKhwzQMJXEy/qe54ynnnPIbmDP1UTfdP vNB2QgLwqiOpizW+u1EkzcrLDgeLVxlfJ6SR6EogWxoWFRB8mY3rhtHVFsLt2IvI/qJl P8xw== X-Gm-Message-State: AOJu0Yx7395qf9nDV5+XrUZdSd0Ko2dZBRU8oCuJM0NQqyj9VarH6g9x 4oRpRcBPF8x/vmEw4fzpEQ== X-Received: by 2002:a17:906:8a75:b0:9a5:cc2b:50e5 with SMTP id hy21-20020a1709068a7500b009a5cc2b50e5mr6327566ejc.32.1695574713937; Sun, 24 Sep 2023 09:58:33 -0700 (PDT) Received: from p183 ([46.53.250.251]) by smtp.gmail.com with ESMTPSA id e8-20020a170906374800b0099df2ddfc37sm5217076ejc.165.2023.09.24.09.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 09:58:33 -0700 (PDT) Date: Sun, 24 Sep 2023 19:58:31 +0300 From: Alexey Dobriyan To: Linus Torvalds Cc: Kees Cook , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [GIT PULL] hardening fixes for v6.6-rc3 Message-ID: <88707e12-dba9-4a9f-95d7-8d6f3c8f0f58@p183> References: <202309220957.927ADC0586@keescook> <202309222034.F2B777F55@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 24 Sep 2023 09:58:38 -0700 (PDT) On Sat, Sep 23, 2023 at 11:04:57AM -0700, Linus Torvalds wrote: > On Fri, 22 Sept 2023 at 20:49, Kees Cook wrote: > > > > 2) __cplusplus is relatively common in UAPI headers already: > > $ git grep __cplusplus -- include/uapi | wc -l > > 58 > > Look a bit closer. > > Most of those - by far - is for the usual > > #if defined(__cplusplus) > extern "C" { > #endif > > pattern. IOW, it's explicitly not different code, but telling the C++ > compiler that "this is C code". > > So this new #ifdef is an ugly new pattern of "do totally different > things for C++". > > Apparently required, but very ugly nonetheless. Most of those in uapi/ are likely unnecessary: extern "C" means "don't mangle", but kernel doesn't export functions to userspace except vDSO so there is nothing to mangle in the first place.