Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2795638rdb; Mon, 4 Dec 2023 07:46:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxY61tu6DRNC0rXyXOJZxpfYcno5VSY9M0O+6D1enTwUQfXmuIYf5wPXuS3/42JUhmsvKh X-Received: by 2002:a17:90b:4c41:b0:286:b6b6:2a54 with SMTP id np1-20020a17090b4c4100b00286b6b62a54mr1037581pjb.23.1701704812964; Mon, 04 Dec 2023 07:46:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701704812; cv=none; d=google.com; s=arc-20160816; b=FacCFTjVeofgixsoYRu5ehjdR3Y/WIZTIxe8EBla3Etiuy3rhPghkKiZZ5xc8TY0WB zl/b2EJcp+GalSaB96LbQ6P8BigZaSYWPTDdU+9NUskCyd5Cy4MFaAHIUjIFXs5Itixu lFeJ/yQpEMTKrAiNNrGe0oZg1x6x8f5hlrG418lpmsX3CA3qCz8AR+s477MjQLtpFqBk Yps13KRf4qVgqyN2D7tOHthxuu2UQS4EgFssC4AWSdAjJKSKElqFNAW8TwGnj84tOcIN vjfQ7EY/lNQCUmcgn6CzcKBcBb/3HF419YlRn3Bv5sv7s7qan6vKJbOlZY7Xcic/oppz Wfog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=amuIbHDzAqT6Bi8G+JeF8+U+6uTvPFyg5L8vg4OnGtE=; fh=p6Au+5sjTHalsqTv9fMcVOEjyCisN3IZ917rdXf63tU=; b=QeUh4SCNLP8BjAoppcHDEOjshjci1gDBnA+Sd4d4nzi84W+Gcnwv98xjA46tP2ywdT fbcNmqY8CBjeVhA1VWXy0ZR22TSQAa5S0S0WRJsfCJIxY7mPMNmaUj4zbqVOCl96FCyu HTg03JsF66apbD+wWl6hX3118L1ztpHrcP0KOWrKl6RVnsKbO0C+970itkZDwQ3xVeJA 1pjTh3JlBh9Sf0P5bKCQbKAsZCtvMbzvpuzyGC1aS3PQCrHdseSse4YSP0GryIjrN1NA fwQLO1yfnngVrDUhn/+vcd6RC/6oUUjxvdXFuPFzIDg+/UkOr4DQl92/MDzTHaKk0lKr GOvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jiNBf39K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id r17-20020a17090aa09100b002858ed80acfsi10242260pjp.131.2023.12.04.07.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 07:46:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jiNBf39K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 00E4E80579F7; Mon, 4 Dec 2023 07:46:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234119AbjLDPqf (ORCPT + 99 others); Mon, 4 Dec 2023 10:46:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230496AbjLDPqe (ORCPT ); Mon, 4 Dec 2023 10:46:34 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1279BB0; Mon, 4 Dec 2023 07:46:41 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3333fbbeab9so1629642f8f.2; Mon, 04 Dec 2023 07:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701704799; x=1702309599; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=amuIbHDzAqT6Bi8G+JeF8+U+6uTvPFyg5L8vg4OnGtE=; b=jiNBf39KnHXR+xpCcNzLvlEARTxj22HWfK5HZx+B0wDkr4HXzBxHIJUvskI+bQP+OK PtCyJoZ0kaGdJK7atwPF2AQ+jUipJE5CsC63oWFan5zpI2sSVgyerJDaPUUyXnoqV/09 oAXn2couPit2yH7PL0JXCde30LszbobSmPKk2yz8L8XseHoTefME9oxQ/vNm3YCfuKzl 24dGOQVisG8JwRDHBfYTTLUpfpUfigVXHWQ4C5sWv9Nt1kPqVZJYm+gJGD1a07V9o0jt +Jk1QU9STysfLp+wHejrdmACL4B3OPcstLzDhtOPujEvZAxF3QQ8ejSupFNbT484FFq3 rlKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701704799; x=1702309599; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=amuIbHDzAqT6Bi8G+JeF8+U+6uTvPFyg5L8vg4OnGtE=; b=kALgXUE/GQ9L58wwYQy1yyC9Vugno2nLP0m4QOsaXFIC63jCbPvdG2ahR6Mkrz/NAn 8DtJn7i0vJMUoH+oNtiOZaGr9uzmxWSrxV3KJr1req5HSXEN63k9jiR5VxcDVUtz4gMI flYK+NnHL9n5/L8ZitYOA4wfL69zJFdMtBa4ziiaU0/uinoSCsyK9uva9Cn7VcOeMjqy Unlw5IzL3/26MalmrbNISa/NzHeh4bDAAFrQJxbrPt57ksEW0eocmJNOso9Pchwpf0S6 fy260GjaeKQbfhv61DPbMksw2sCvZiaAXyx96V0uEvwf4hoZfYEcMfAY2+U9eLK6nzsG T1kQ== X-Gm-Message-State: AOJu0YwkM2ET+jLSfHkdi0yDA5fAJzHK4nBXH55oq4mWnO/ZejeBkN8n 1NGxigWWtOb4QqMkMQq0pHYiL3bvb9capqg5gIQ= X-Received: by 2002:a5d:4534:0:b0:333:2fd2:68f2 with SMTP id j20-20020a5d4534000000b003332fd268f2mr3128201wra.133.1701704799369; Mon, 04 Dec 2023 07:46:39 -0800 (PST) MIME-Version: 1.0 References: <20231130205010.it.412-kees@kernel.org> In-Reply-To: <20231130205010.it.412-kees@kernel.org> From: Ronald Monthero Date: Tue, 5 Dec 2023 01:46:27 +1000 Message-ID: Subject: Re: [PATCH v2 0/2] qnx4: Avoid confusing compiler about buffer lengths To: Kees Cook Cc: Anders Larsen , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 morse.vger.email 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 (morse.vger.email [0.0.0.0]); Mon, 04 Dec 2023 07:46:50 -0800 (PST) Cheers Kees, BR, ronald On Fri, Dec 1, 2023 at 6:51=E2=80=AFAM Kees Cook wr= ote: > > 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 >