Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2363338lqo; Mon, 13 May 2024 16:46:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUxswvsUSLsfkbrl6Dh9OYNqF/86veZrtuVvw2p4eBL17h8jZ/lHn1Q4UvuMt5LsGLxD1rLsfJssmWaAEt9mBBrWrFh2RwTszKj9QKSFA== X-Google-Smtp-Source: AGHT+IFoKNMussAKI7FmVD+j67fIe/dtMv8/8mvTcg3ZbtpWaU0cu7bwvsP57bS1A+eG5QrvgJxz X-Received: by 2002:a05:6870:f10b:b0:23f:f4d2:c0df with SMTP id 586e51a60fabf-24172f9987bmr14686107fac.54.1715643982061; Mon, 13 May 2024 16:46:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715643982; cv=pass; d=google.com; s=arc-20160816; b=mX81Rq+mjIsU0b+olBlE6IqabT4a8FWv3yJREH7bKAEKGwZtZxZzAFw/KiYtKZjO4h /8BrnaJ4uCZm/wpUAb2UBj3yvvh1zZxZo3a/sTFAFmCpJsu6/FCMYMxClNa4Ck7qMsnq FQD3vAGM2TEM2EFuRLmAEWMHWFHpBiT6Ew1QkN1I0gRkueKqRah0SJ9mbbWvIWNWyatB jKUWc6c7RM0V7ePYmTWw4q+r7bNjwmuQjKyPHG9v8EPoBAxJ9OJRQVecfNDqe35fstXM NMTcJZL4S+1M2SaSCeIxsrpifZPD/+3cDMn4qjxrNB+KFBalF7QEv991C/VbP9b0HRED xLAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=DYyPp/GZh5UOQMAPDnHfvV0S7X7W7YFaMKKEzXMQZG4=; fh=+IAfA6cBj1gZKq/anuD+JMWCkBxJycD9ID+EMllH+mo=; b=xh3L0CQWnBwqj7KePCLH07OZK2J7+ZLDlbQMBcFvEPTADA9XX4zigRvRNicZvncb71 DWAlYgH1iEbNVLgZ+fgWOWvMG7P8k0KVNSAmfUAyjSPJwNJeIouyOVpQcmb5qCXDQ162 XVrrAJFbKJ1PAFSMMA3ZVTv5YnYAL6f3hDXepDbTWa0eHVS5Usab3qMi4hk9ljROeOY3 DaCVj/SYcyNQLBsdtSzARhbAxorzteWnA5iTg7qSOj4JZDZkHpzcLqzLOQk4MBeHyqDu q33kLLcl98Afcv8H2Bd89XdqaNnKw2PHpGV2cWi/KwcVR3Pa14QwLWqUtUK7qFTMtQy8 55qQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=c0DMEE5N; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-178185-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178185-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6340b2a0b00si9790288a12.234.2024.05.13.16.46.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 16:46:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178185-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=c0DMEE5N; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-178185-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178185-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A3B80285083 for ; Mon, 13 May 2024 23:46:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8494885938; Mon, 13 May 2024 23:46:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="c0DMEE5N" Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2620382488 for ; Mon, 13 May 2024 23:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715643975; cv=none; b=Js2uEKiMkf8+M6bQervgq1CLNpk2FWF9WIisqhCjZmKRcezuph9cMdSAAQBIfFGGOduRGPuxPVEqbUyy3JwFQHozPhbMI5QcxrSzCb21TZTHYrqQzwsjYQCpRubuR/RaVtiPmyaxp9fzDfF+phDWs9vKEaHsdfVKnhYpYM5c9jA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715643975; c=relaxed/simple; bh=AAdoFPqByr+rSZV5fnbb1g3bDcI5/e0JDBu1rdESPU8=; h=MIME-Version:From:Date:Message-ID:Subject:To:Content-Type; b=mcOPHS3mlsclYaPWyyLGI70p6h7AKM4VFYC5VdU4woxP7nT1EA7aXrgcPMCeCE/R44Q5BqwJYN0ve/4dZk5zQlKVQ2g5OhlovQsC9m70b+M7rYDuXcbHklh1uyF1k67/MYJ6dQGlf114kQk7bBjZfVEXwrvlErhH6yV5VAhrhsU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=c0DMEE5N; arc=none smtp.client-ip=209.85.208.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-572a1b3d6baso3802a12.1 for ; Mon, 13 May 2024 16:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715643972; x=1716248772; darn=vger.kernel.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=DYyPp/GZh5UOQMAPDnHfvV0S7X7W7YFaMKKEzXMQZG4=; b=c0DMEE5NRO4Y0Lnf/ikNn2o1vk11p2ZVcnL7pIMD0I/R4eEShWBTgpCZQ50eDoVvD/ V4XCQRdzN99pPACrqUvlf0pgrZc8HYYUpL+IvYvZmpHg0ciUXTQfFBBWo9qfnP1pyB4P 67ktNKzixRUVH1vMP4y6qGZCAMUo/qn3bIKD+PHYnPYMQP2z1THrkDeC84VagxOVqsmT QZ8joN02RJdGULYTNivBKIe8JAg23OjCbVtI8GjaIM+4tAhsuNtnbyRvVF8aO+9VNcPa 80JnidbmHtySfeT5pGwo/paAAQIDJoKU0pTwmcNFavYFUJyNjHg4Hvb81MWr1BP43tqR T4kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715643972; x=1716248772; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=DYyPp/GZh5UOQMAPDnHfvV0S7X7W7YFaMKKEzXMQZG4=; b=w52a1MYqvmUguSj444olAjiZEqAdjSGBLjVrgiQlHWGu6TChfxix1xzWDyHdlT7023 VvsVLfZf3FjMF/Dv8b4XmPpE6PoRR7TldKhUc+ZKDX3gRUz3GEBHk9PjvwD3Eku4zdek SJnStu1yOGeQjW2bOAqladDKWqLhqVHnazf+DhFoMygAIQjrLTAtswEu7NXPOeUujiBS q/lOGALCYWD2D+ipHWBM59m/dLBAQ0s0eQH9TThxJSsFN+HNfkNqC3aVXdIC7jilkpQS tkk5jYLukpkV+Be+z3FKVogxcMqgd1fThdJrzv0m9ktAMQmsQaP3agePzErVJjNe/XtN ooHQ== X-Forwarded-Encrypted: i=1; AJvYcCUEeat6bGTArs8OEZY1dE24fcYiDOZxSRiBEjjX9vPfa+CdIiXa5um8eLXHZ02axktflw5DpG5ykiUqd+D3Ua5yr95dJtCQ+tqwsKsQ X-Gm-Message-State: AOJu0YyriAJCL0S1yDqe63ecTIxiAhzbGTFLWDE7PtHM2jP2sPdp1/fY 1krZmSvEFds1x2AM/KoJYL8vQpEgfgZW6LY2LTidtO0R+ax8/HlpxPljx6eyBjWnkblIHY7yg/H +KXh/CQ/oH1OPz3JfiNl+uNtKm0o36zWcJFY= X-Received: by 2002:a05:6402:1e87:b0:572:25e4:26eb with SMTP id 4fb4d7f45d1cf-574ae5d8176mr396424a12.7.1715643972027; Mon, 13 May 2024 16:46:12 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bill Wendling Date: Mon, 13 May 2024 16:45:54 -0700 Message-ID: Subject: [PATCH] hpfs: Annotate struct hpfs_dirent with __counted_by To: Mikulas Patocka , Kees Cook , "Gustavo A . R . Silva" , Nathan Chancellor , Nick Desaulniers , Justin Stitt , LKML , linux-hardening@vger.kernel.org, clang-built-linux Content-Type: text/plain; charset="UTF-8" Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). Cc: Mikulas Patocka Cc: Kees Cook Cc: "Gustavo A. R. Silva" Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Justin Stitt Cc: linux-kernel@vger.kernel.org Cc: linux-hardening@vger.kernel.org Cc: llvm@lists.linux.dev Signed-off-by: Bill Wendling --- fs/hpfs/hpfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hpfs/hpfs.h b/fs/hpfs/hpfs.h index 281dec8f636b..ac137787f1f9 100644 --- a/fs/hpfs/hpfs.h +++ b/fs/hpfs/hpfs.h @@ -357,7 +357,7 @@ struct hpfs_dirent { u8 ix; /* code page index (of filename), see struct code_page_data */ u8 namelen; /* file name length */ - u8 name[]; /* file name */ + u8 name[] __counted_by(namelen); /* file name */ /* dnode_secno down; btree down pointer, if present, follows name on next word boundary, or maybe it precedes next dirent, which is on a word boundary. */ -- 2.45.0.rc1.225.g2a3ae87e7f-goog