Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp237616rdh; Tue, 13 Feb 2024 15:42:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXw7hpHQ1wPBtZzs9nD7QBG5RDWqLnF728vLM12+cCmUjtbxbw5nVwFijJ3QXxx5Mf747d9J1wg8NqiJqzXd91apZTCtSG9DwBxxodJ9Q== X-Google-Smtp-Source: AGHT+IGkBw71l0aityB9wRywIyuDmu0M4uF/cANpGYLgLYXeIdE1W9mgzpWWrh2bsxibC070gwCG X-Received: by 2002:a17:90a:fb4d:b0:298:d301:db69 with SMTP id iq13-20020a17090afb4d00b00298d301db69mr374404pjb.33.1707867763928; Tue, 13 Feb 2024 15:42:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707867763; cv=pass; d=google.com; s=arc-20160816; b=eTUDBjwGDA6qUXUWy3GJcsqMbt3c4bGlM+Bn0ib/z9tRwAKPh9S8D48VPyAlDrWCkM +Tk0knLGjbwtqK+tTgUBkt8KoMr7RcAmGNqbiJw9PDqnwa9Qp5FxcrXFYT1b1YFhL11c qPne4UXODuoHyww0LVHDcC5x4YI+WZLeOcwnoFRtzzmu9h6gHvbFrI7dfi6JTavlwgej 3XnkHJjlHGdF028+sriW/vBUMx70FXVnBjmyKp2iiv3aYArST/FxJla/1VPukSP5iC7I KqzTdFHLg1+AcQdkfQ80ijdubVXchnwjQ2QBfTqd1MzxdUj9MM467PQJrDhgnnn4EGIN H/+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=in33zmkUwO/lJCZx5ql5VPHI+fJoeC5L2QBdGV5S4os=; fh=xaCz6y2x//8EjwckWgZIkHee8wypVYDVOzHDLZ7t0Uk=; b=PQMjia+FS3LM43DS6gKO8EgxY48MmepBcYvXA6TD1OT4FGNtxXqmOW9z3Pm4SBS4BO U72bvWKG+zqVq188D/rc7ZEu3r4GsCE0IibxHV7DrdmxgS+Icm9YdjZc5LUR7dfQus2e lO1oSNnC0/qkCI9oSI+YGSF+/QkXQMNIDGX4+EKARMzyxH18hNBCnwj8kr+UF/ZgcAqp 76u3UTIaYRkFSEW9dG4uxX0atHWc57q3OiLBvYDLvO0jo/c/wQ3aBq0Od39p6tTFik4l EtVddYGOmERWnhwPvsOhMeOXWki2SB4/hOsCRa68LKiIOJzS2MbeCrmoM/C9ss4YkxCN HSTg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=heaiVvIL; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-64557-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org X-Forwarded-Encrypted: i=2; AJvYcCV5zH9cSVDRxC0r341E5DxQ/UrkiE0kLW23dIRsOReo4rsRCFkpcslP9PP/JjYWxM8wIQiMdEV62IeT77MA46cDW6CBgYwl+DibWdup4w== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id mi1-20020a17090b4b4100b00295dc06ddb6si129436pjb.129.2024.02.13.15.42.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 15:42:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64557-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=@chromium.org header.s=google header.b=heaiVvIL; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-64557-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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 931A828C10E for ; Tue, 13 Feb 2024 23:42:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A978634E9; Tue, 13 Feb 2024 23:42:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="heaiVvIL" Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.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 B540F633F0 for ; Tue, 13 Feb 2024 23:42:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707867736; cv=none; b=L+0BSySGymmX2yZqRYpu/BKtW8wa1BBv2/RHQt8vRsNBMgT/YGqlrtujsUI6+jlC3H2WE+Xr3bpl02wWY8ggFfeq0Mv4OUkXgiWMIxvcXqsLk3necFsnYkFII8yiw4/dkYPy7Q9SfbrgGaDPyr6mNYgjVUPeziY2YwowFBbPe1Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707867736; c=relaxed/simple; bh=JaLcS0MhnhYo6HqFOcWGWSj+KGWfIIInyL0CMdYPrLw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MaRGE4ljqPwMcoECiSASIWd5OP4VomotWPKuu/PldY4gXSYVcskgM7u+EqyX8jXM4fq7RdtCu+dFYYi2gjulZ1N5XEvtRL0Vc1SNEV3n1WRTv0PvNzMjqJoUs+1aDoRff0U9a4xqa8OxmwbmHzyfMQawUxUHhGHrG0D/mcrNbGY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=heaiVvIL; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-290d59df3f0so3575215a91.2 for ; Tue, 13 Feb 2024 15:42:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1707867734; x=1708472534; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=in33zmkUwO/lJCZx5ql5VPHI+fJoeC5L2QBdGV5S4os=; b=heaiVvIL7p1+JZGvP0iOwvDgcGu/fxW7meOB/pjLgJAoF0/QXH7oF21t33SY3q3pXJ yDnjXvn3Gt8+Ea1HD1xmZGB94kGDzp0lMya85g8nqhjiqlbt+jJw+mVdt6g62zDTpo1n ctP5yc/UOPXm/VYSB5cDnwNnwy/D8FhB3u2aI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707867734; x=1708472534; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=in33zmkUwO/lJCZx5ql5VPHI+fJoeC5L2QBdGV5S4os=; b=HrrAD+zLOax5p6wHaJ3P2pDGrFYmSVYNcWTtzcDJl/FQhzWs0o/BFwx4No/kE/zmDd kKyIhtGmTcqvPAIVJzHW+ASMKk2FIPNeix7CcqBewOjwOeUkOORS48jbbHxPE2gxZJrR ZqKviJDJxyMBbXeoNZaVqTdrw8DX9y2LcEP/pX8H0UlcHHAcGemEEY0X8/Fn/qFu4byQ DOEy8sRPIaZQE6qrLd6lBfijJPquuTKLGLiVypn3ALd/tcUuDW9XHAlECQnylVRBia0w gyqGKbId9a7NOxYkIwit/j/tp+8MiRr15WRtVDC3cPt6W3yxx65HmgjeKCx13Ti4+tjt bg6g== X-Forwarded-Encrypted: i=1; AJvYcCXOJQqCRqRU345KPkacLRIbuBotKJKqSNIIlA3hWXw6nIFwSqTljM3bYmc9ME5oWdLYuu44qxSYF4xwItXAvz7Akk0hVIqS+wsaL2cW X-Gm-Message-State: AOJu0YyGr22gU6rV/PVl4EH95UQcEMRysEIcMdQTigJG5B8Q9KzvEDfa DsNvRqCuWmOSzF4G5Lo118H4AAfM8UjzM7lCYUuKs05tWIidbsioptWiALVoNg== X-Received: by 2002:a17:90b:205:b0:296:892b:4c0 with SMTP id fy5-20020a17090b020500b00296892b04c0mr963267pjb.41.1707867734152; Tue, 13 Feb 2024 15:42:14 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVlVHC1f//hzKVyajZIa/bmyDWH5OQtGUzqsr7wgHc7Wl98sibIfjbfMPN1ydIq6ub1TlcIzCDSFA3iXjUdbeDDzsKqqfzpbT+69BWdJ5tIuPQSp667cZav30hy9odQq233bRml1rpMox0+VHwWhXt05zA4AI4b4mpzbY89rm1HAQzAG7Tl6BNMddRAIwzAcx7tYxnjYGb0oI1hdSdFybB5KKyLqVS5zaEeeDKd2n3VxWwJjV1zekHCmDRfBbtO4enBbIYqFxcpcDNFWrZRtxUVV4I6NQJsVgmOpX0kfTFMV+xj7aNsyIxrSuVMcsdGGwYoTO0C3w546gK4aCssnIdxn9DoE1V0CcXvJHpazg+zsgTWAJm5nz8VuzLL6m8SSOZzj0eJAr0iF6APm2jIUn6882qgS5bguwQXCE6rhN3EjAJsny79IHwcHRs2+m+4iUrKnkAhDTXdeBGsrL8JfZktsMjvUTLzG0opYjNjMn1ux70JX2pVBbys+rlXb13/ Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id f20-20020a17090ac29400b00298c06d843fsm84671pjt.3.2024.02.13.15.42.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 15:42:13 -0800 (PST) From: Kees Cook To: Jakub Kicinski Cc: Kees Cook , "David S. Miller" , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, linux-hardening@vger.kernel.org, "Gustavo A. R. Silva" , Rasmus Villemoes , Dan Williams , Keith Packard , Miguel Ojeda , Alexey Dobriyan , Dmitry Antipov , Nathan Chancellor , kernel test robot , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] net/ipv4: Annotate imsf_slist_flex with __counted_by(imsf_numsrc) Date: Tue, 13 Feb 2024 15:42:11 -0800 Message-Id: <20240213234212.3766256-2-keescook@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240213234023.it.219-kees@kernel.org> References: <20240213234023.it.219-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=965; i=keescook@chromium.org; h=from:subject; bh=JaLcS0MhnhYo6HqFOcWGWSj+KGWfIIInyL0CMdYPrLw=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBly/5T7cTDxgTr0rDIqvT3vhjqivyAqSR9MrmXk vJe8ulo+06JAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCZcv+UwAKCRCJcvTf3G3A JjLOD/9kSRrC1i4wpx5fWHuu7VPgWHXMKYgp17lT1gJYIk6Ae40EuhyRDJZR+MqkiW8msoUquzA cDzdbDz26Z0dJgcnpAmerx78u08EYTTHrYMUaZI00fnzYhfO7GrKKNQ2o4i4C2BOt3IuiO1CbMP zJ4di3CiyGy71ooSKn08Z3/5pTLNAdmig+gl3GP2GNI2U5ny8OHZOOdSXxbaaM5059spgeEdSPF nbU6vXD4q5enmZH3V9CBHGOG/uXxO4okDQDH1y0gKDJu/PQ1foGcmqtqlMoXCMF3bKvq4/eiQ/B dTPsR8alCW97wnaa+pi6F8SlkVC8XmxMghe18rGMMBLVOuh/IS/ypL5K0b5TCPKZ7leqWFiRUEZ Vd7OLDIFl2GbI84vzx4s7kbcM9rhX7ADl46J55D0+xFomlstdpJSJapDvEonhrYUda4b18+paY/ 6a9OxcX4ihmoNr83RlW/n9RXCNtBVQin+GylpP5LQvS07iQ8GCZhy1qr4Uajq1qaffdIDYwSS/M FMytHRtpsPJCOMq7evN65jd5bn82KKnoKnoIx/M/IyePgJy3gKPL6+lVP4YU5db/OgXrvDxuFM3 Bf1sZ826NZDOgvVq2QlC3wP9X3CDLTVHF4Ab4de9u15ky7gTRZMgYZ8CpdLqudDhJ3PyovS9e5S StLpaZfKQmBlPeg== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Content-Transfer-Encoding: 8bit The size of the imsf_slist_flex member is determined by imsf_numsrc, so annotate it as such. Cc: "David S. Miller" Cc: Eric Dumazet Cc: Paolo Abeni Cc: netdev@vger.kernel.org Cc: linux-hardening@vger.kernel.org Acked-by: Jakub Kicinski Reviewed-by: "Gustavo A. R. Silva" Signed-off-by: Kees Cook --- include/uapi/linux/in.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h index e682ab628dfa..2f0c4d40bc7b 100644 --- a/include/uapi/linux/in.h +++ b/include/uapi/linux/in.h @@ -199,7 +199,8 @@ struct ip_msfilter { __u32 imsf_numsrc; union { __be32 imsf_slist[1]; - __DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex); + __DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex, + __counted_by(imsf_numsrc)); }; }; -- 2.34.1