Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp595542rdb; Thu, 30 Nov 2023 12:51:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXbeP0LkyCdR3KXENMP3QNIm5PV7pCf5zaR3qOoRW5BW3W61A30TDh5JckgBeV6jHa2Z7J X-Received: by 2002:a17:902:d48b:b0:1cf:b8bc:1311 with SMTP id c11-20020a170902d48b00b001cfb8bc1311mr25344166plg.48.1701377509895; Thu, 30 Nov 2023 12:51:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701377509; cv=none; d=google.com; s=arc-20160816; b=OPLRaI3A+tiXvuRF6BbXtpfi2kngIEUZGk9j8wmMxnGfFT8k6wYzUjaGsAYeY2P4Pv A14CvLBdcHW0EZcsfLUPBiWf26FjR/BCg81jL0BYCTIQ/mrGxb3RH5UOpRDq0XsMvXdZ cfP86M5j6W/FP4dnLVKVmFCkZu4bVD927AAJWw5ykXrBW3JqsP1UMmXFyQadSFflAxUb ceFoKX2tDOrq7fwLt8SeaubvPx0oIv7cP3J41xQvpqvl/4htl5Ous3QgegsHDPm4O4rV RVsedVaZ6jEAy+vOn71hPGE52pb7L31fd7qjl9WI1CQoPV+mr2TSAnbBXY/GodhkrVdw hjoQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=TfXrVytW8Y4xCjr3/gaeCHfvnpxnYpvkHqeDQcGVwOI=; fh=jPF1t1OjVWw43kqQI21RGk54ztKXfsMiTjLe7/DkAmM=; b=dupcSI+30Ash5Adr13igcAHZ+2xU+C4ZdQEXXNUCxulerRYQbWuQCzG06x3KlZtLcE 1PWv1JK58VPTogM3Be/n38O9mFO9Zjn9PRZFMHeC7BQtkf5gmSLScE09A86mv1gXgo4J 8f4ycy8YPd73/FzuQTK1HhAFoOwHGqGbzJjxN/dW8zdcwa6zFhfQ3La58gGOW7vDF5TT 9Aw1rvLzorwM+/sOW0JSBFwJvO+qIN27PxKgFPj9koPc94GTb+q/opmTYQxMVdDaX0NQ W8u1kIUPd6oxIzA4fikCCMzq9iNduJWYOoYGW/8b6YY4Qb6acIUp7sEHKn9ewFasLdM/ tcOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dJ9R1pwJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id jn13-20020a170903050d00b001cf96a6e95csi1814432plb.325.2023.11.30.12.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 12:51:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dJ9R1pwJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 013158080C4C; Thu, 30 Nov 2023 12:51:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376755AbjK3UvS (ORCPT + 99 others); Thu, 30 Nov 2023 15:51:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376474AbjK3UvQ (ORCPT ); Thu, 30 Nov 2023 15:51:16 -0500 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89DD71710 for ; Thu, 30 Nov 2023 12:51:22 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6cdd214bce1so1393610b3a.3 for ; Thu, 30 Nov 2023 12:51:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701377482; x=1701982282; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=TfXrVytW8Y4xCjr3/gaeCHfvnpxnYpvkHqeDQcGVwOI=; b=dJ9R1pwJMTPVhzdrYhLbJ8W9lwde+dJ/qNBb5KcVjm6+EceGXJOIt2sE2+QzauhBHL TRW4jQ61YcLTBFINAKki+zpg0qWVYOKX6SwjITD9pKYVCNjTJv+HZJyApoxgWzpdRbGK RGFfglNHb4e9DgGKT/j+Bpz5p2awanneFpP7k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701377482; x=1701982282; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TfXrVytW8Y4xCjr3/gaeCHfvnpxnYpvkHqeDQcGVwOI=; b=WOsfaSl00+uHBH+3A6VsP1btdc59e+gYehxJp1klfmsmGJ41ggaDMctqngZBXS0Hhl DznH75Ddj+k3hKzDkudFjfNJ9nszgH1ggCsjR6t92Bip975FlQ1XJjvzOWnwcCb6LVbO vvk1u2734xfcmCt/0ZS0ASJ6WPN5jPfWXP5zikicxszVfr2pz3cQ3C/V6+f7268DzVF/ BnCNj5Q2R9UB0+0O00E5tDHBb6nVcANLU8LeHIp/HbBqrLUsZPXvB7QJqO34Sl6eE4oy rH1nybZ1+OIkqjIZdyWqHgG1xGsOMZlot95Bx6ngiI5/9JDFcITBWC1VkPYUFPQBT/kS hQgQ== X-Gm-Message-State: AOJu0YzCpOcHOqrOC3L9KiHlPbPHT0GMgJ+Cx3NTBD0XqKk+AyHobVaG wRM8sWXiecBrCfZqN2nwqTdpBQ== X-Received: by 2002:a05:6a00:8017:b0:6cd:e35f:997f with SMTP id eg23-20020a056a00801700b006cde35f997fmr4212615pfb.6.1701377481968; Thu, 30 Nov 2023 12:51:21 -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 h22-20020aa786d6000000b006cde4523767sm1644052pfo.22.2023.11.30.12.51.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 12:51:21 -0800 (PST) From: Kees Cook To: Anders Larsen Cc: Kees Cook , Ronald Monthero , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH v2 0/2] qnx4: Avoid confusing compiler about buffer lengths Date: Thu, 30 Nov 2023 12:51:17 -0800 Message-Id: <20231130205010.it.412-kees@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=780; i=keescook@chromium.org; h=from:subject:message-id; bh=0qK/8Psz3/9NxX1Im3q4MPGhQi0CsgBgrOpGBgXV7zA=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBlaPXHiFovd++oDnR0c7ouJGNE/dKwiifPcyLlf BxYEhZAN/CJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCZWj1xwAKCRCJcvTf3G3A JpZqD/9ccxMmnau5U6ctKyloMELcYhn18hIIYhEld/95TcvsFCH8Xn1gWf4jnM6fBhzjbMHL7vM FdZMtQ1r7pJgY9xAOy6BUbX+ujkp89xA1lREEil7ioxgGsQIFhfQTCyBDgLxOiuM+ZTzDWe8jI9 P7X3F1lxG0o53OU9wmVZKaPnXgAZS2DZaFrXUFOrHJmBMLcCt1MJFkYqY3p4xQ2AaUiStQZWVd+ O1cLTqWf1BP1FKuPMkHk/ioYCEl9ZVHOCu+mzOVp6xZXSUErstM4qf9cKLT2Sw5dAlg1Pzt0WH7 9+17k/UEqMfBfiM77PhiNXvGof8gv8/q+MG1jmWXiBSZo4+tUO2nL9STnwBfXCB1AE6FMYHcmEN ueCb92HCmY6Xa9k7CD5EBSZJvJQ6gwXD0Vgmr+Ono8U+TjQL/n9SFwv+T2xELITi9xvd4Luq0NT BiHXq+BQA5x0lP0epsz0rZVgdFhxmu6WIpf0bE2sHw273x6XsoAPhblPDuMmMsmjVKLe+OCgDbw foI51L8vJEfoh+HJxo7S1R61w3Lr94N7oU6iN9YU1PUsGMBl2jL6xpxtnPwQiX/bQyqdUpxv7xY sWOmaVksXt+PQO8fm00bzGkqo7rGSqZ39kq1avwTyOZKBrHgE3bVbm5SAL49wC5AP8zPzHrc26U xWEewmde 3L/xIsg== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 30 Nov 2023 12:51:46 -0800 (PST) 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