Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp3014433rdb; Mon, 4 Dec 2023 14:10:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPv2dYpEIxxBPx2JR0w3lVnAh+dGXAqk0JbdI7Tw/qVjAvjMuyORTtwq3GeKu22zltMiZm X-Received: by 2002:a05:6a00:1784:b0:6ce:47f4:2b45 with SMTP id s4-20020a056a00178400b006ce47f42b45mr223532pfg.13.1701727825613; Mon, 04 Dec 2023 14:10:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701727825; cv=none; d=google.com; s=arc-20160816; b=U7Jb0vTd2DqlxYD1oBkt3qmJXol0jiD6ooYGIDbPq7s80aAUb4s6acpmRPYHt+qkCs XwOO3RbWBWXiBBw+I/FvtniwPQks4drTaR4p1MVHVti0j44Q0RFpd+sZ+j0IzGRlSSCJ mvNdDzjWI7zmKscdWlkrNbpfi7E5SgBZ1dmpt+bpahcGnljKF9di6BLB/xTQ+3/5tl2W 9eNFaFNKCh91kAdvMfaOOw1U/qgF6hXJYbmSGfX4OOCaP4yqUE8EGkF4sn70cD1oC+Mh ovD5g7gj97adhO7zvKCsy6q8dVZuId0hx5jltwqZi0XBvdktrEu9QtFgZoZjbMkWaxLB JgcA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=37lLGq0t65HiQcCI/lHUkF2BBlMT4MulFisBI2pP0eQ=; fh=eBAGpu23RSmYKGrq726ENyXyog/sVwiDHKnZBjt1KyU=; b=rbhZ90b4F8grbhZp6bCetfUxjbrd5ZuewYa7CVUgREwgZ+eLKOg26/aROD8oMeIABg UgsihXGtKHItxR41g8pdS6B/au7umriS3wfQSx5MrRu3z/DM7eoJC99ejxEYNsGbLOaw EtkpBM0JmTLMB1X2EvqHHU1PeobYwP8o87BJrs888yFB8EFBY9MwOBwMcQbV7ZZg8Cm5 MZK79/8WTpxTg/njlXTjksp5jxwPEPRISxAdSkj9/63fzik1tRunhewIDiBgaS2urkh7 bsCuldUOq/cFayrF2yfV174VhhBxtLP9e7ic7eHMYCumfhbOzQ8WKjXWx8bn4YknaJE1 u3VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YY+m3a0e; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id u191-20020a6385c8000000b005c6634fa849si4297047pgd.89.2023.12.04.14.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 14:10:25 -0800 (PST) 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=@chromium.org header.s=google header.b=YY+m3a0e; 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=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 486D3807759B; Mon, 4 Dec 2023 14:10:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233852AbjLDWKO (ORCPT + 99 others); Mon, 4 Dec 2023 17:10:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230027AbjLDWKO (ORCPT ); Mon, 4 Dec 2023 17:10:14 -0500 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57393D5 for ; Mon, 4 Dec 2023 14:10:20 -0800 (PST) Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6ce3534bf44so1556305b3a.1 for ; Mon, 04 Dec 2023 14:10:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701727820; x=1702332620; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=37lLGq0t65HiQcCI/lHUkF2BBlMT4MulFisBI2pP0eQ=; b=YY+m3a0e+rHMlAnVpwiVrIZfhQCHWZbJgCQv2rmTk9t+DCVpIfg5C1MMwYcG/LbIFT C07IuUACyG0OpNlYsmJVbNK7l2H2+NbqpBBzqNlOSSdF1+U1tFsNVEU/y5JfDARzs5wi 7dEEhsM6teLNfxli7gOgXBJDAQn9FoiYkkthI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701727820; x=1702332620; h=in-reply-to:content-transfer-encoding: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=37lLGq0t65HiQcCI/lHUkF2BBlMT4MulFisBI2pP0eQ=; b=qhomMUx53LMfxGh4bkmhJMNWySHGiN30gxn3CicnSqtHK9F2F80ti8Y7Ph1mAn9EHB 3567+GPzW7IK3yrLcg1DEmnVdQjBMgg5VYN/8OBoxGQJhVORKLiJlhPWOsQBsnNXNAkP sgYucv21IHMMPBe5pG06OUpMcrw42UKWalrjKl2qTy9Dh8lOsp+ilRh83AltsiqT7DeC uOLoQic6348JtZEwcpEFaLjaHZZgKTQqUPJWlzx1WliOpQFoEOgSCPCrUUERLWjvMDPK FeUqu/RXeDpOpIHVZYZVhRYhJc8TxnRs4JYsxwgNwzghrdN8w5HuasSKg46fmuXCSgAc JI8A== X-Gm-Message-State: AOJu0YxqQp1joYRLbBLaKuY8BFkSV9es9AS9H5bKOsT9qEKmCTUSwXQ7 4tUxXl1Rwa4VvotDsdpl4UKpqQ== X-Received: by 2002:a05:6a00:a18:b0:6cd:d67f:7cb with SMTP id p24-20020a056a000a1800b006cdd67f07cbmr276199pfh.16.1701727819715; Mon, 04 Dec 2023 14:10:19 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id t23-20020a056a00139700b006ce53b30d66sm1985284pfg.46.2023.12.04.14.10.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 14:10:18 -0800 (PST) Date: Mon, 4 Dec 2023 14:10:18 -0800 From: Kees Cook To: Ronald Monthero Cc: Anders Larsen , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2 0/2] qnx4: Avoid confusing compiler about buffer lengths Message-ID: <202312041410.708A1416AD@keescook> References: <20231130205010.it.412-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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]); Mon, 04 Dec 2023 14:10:24 -0800 (PST) On Tue, Dec 05, 2023 at 01:46:27AM +1000, Ronald Monthero wrote: > Cheers Kees, > BR, > ronald Is this a "Tested-by"? :) -Kees > > > On Fri, Dec 1, 2023 at 6:51 AM Kees Cook wrote: > > > > Hi, > > > > This attempts to fix the issue Ronald Monthero found[1]. Avoids using a > > too-short struct buffer when reading the string, by using the existing > > struct union. > > > > -Kees > > > > [1] https://lore.kernel.org/lkml/20231112095353.579855-1-debug.penguin32@gmail.com/ > > > > v2: > > - Use BUILD_BUG_ON() instead of _Static_assert() > > v1: https://lore.kernel.org/all/20231118032638.work.955-kees@kernel.org/ > > > > Kees Cook (2): > > qnx4: Extract dir entry filename processing into helper > > qnx4: Use get_directory_fname() in qnx4_match() > > > > fs/qnx4/dir.c | 52 ++++++------------------------------------ > > fs/qnx4/namei.c | 29 +++++++++--------------- > > fs/qnx4/qnx4.h | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ > > 3 files changed, 78 insertions(+), 63 deletions(-) > > > > -- > > 2.34.1 > > -- Kees Cook