Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1333909rdb; Fri, 9 Feb 2024 19:50:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWSAvVuIC+gx7ZZzLwbmGs70mC++mkRDOIVIAaUqVzgAMDackM1VEZlp2Nl6jUWf5hSvrGgnq+EeTRjeusxQiY1cGLn6u8eqJfOyDTQwg== X-Google-Smtp-Source: AGHT+IH78LS9P3znrJhDjc+pmmuPlnGU6aBrnJVArTobSawYUjqSDSKSnAiIaXnhjcIxKLXTZjBL X-Received: by 2002:a05:6a00:4b0a:b0:6e0:47b9:b727 with SMTP id kq10-20020a056a004b0a00b006e047b9b727mr1211806pfb.30.1707537057645; Fri, 09 Feb 2024 19:50:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707537057; cv=pass; d=google.com; s=arc-20160816; b=zXA/+WjAyVePQrKJbnfGQiK5JvsmOtxuv4dIo5JXMu2i07aRgFy0UUGIshcxOBtJrp QFkY3AV6Yk6/CCW9nVtxRwML1NLzHlO5pe4b5MLrqMK1zQEjZFzsaClAISg88DDyK1IN /cyug7Gl+H8MGhQdYIy//loIekQ+im5rT6ceC1PDarkRZD2u31ozEIlzOrZoCRhRxMRd UTFQOMKjlJKVeBQt0ZwTqCnKvYMn8t/Ud9ol82tM7Vj1le5KZ/O6IwS0yYbgiMn1tFfr 9p6B47lJ9GjChgwEASjb4kzQXa0ewVvmrqhcLA8F61jKh+GIphch0Y7YfNpALEdmsqnH YO+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=W64qZAI3h8NJ4txSVPm6MF/X+ayduigBYWPV+cPrB00=; fh=V4nFmKLwUvOZA4FVgCeuXzB6SdnKkzpOzkQ/Ur6/utc=; b=YmGndubmsyz+LE8nDXi6PLg0pYLCsBL41ra/pijMzL78nUERx4X1FYKXpW+Zb6qQm2 uokqHS6ne2RFJdByDI3iYPfZZQm62TR7pw8kk1Gtao1zWCOTwXJMefAUR43CnJrPrhOc MNsyz8ZHVvze7ahPPzC96KC9IlgW/FY2FJCAEhhGsywLnsA0zItdM2ARPVA0mBtLMJV5 OcjkyuEXVT1r21UPw107Tl5NNuOsPK1vPPrxbu7DdkoBZGY+1Bo4Y6daWqr7W4fEvsm/ 41qSwxJNaxoRpJBHE4pGAH0JcrXVVnkPHn07xKsbr/V1fzPSkCv82GhvQKZA9ikdvrK5 37Gw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=n+xFz7Nr; arc=pass (i=1 spf=pass spfdomain=embeddedor.com dkim=pass dkdomain=embeddedor.com); spf=pass (google.com: domain of linux-kernel+bounces-60273-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60273-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCU2+80lNpSiq0aYtdNkKIRt/ZkW+tkQkeUgahoPPCrFpMK2ZoiR1o6u3IdC1QEdN09ztZ3OVVhaK6ALEdC7YBptCsXBLmVZbO+ab2AxPA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a18-20020a637052000000b00585999a38a6si2530990pgn.793.2024.02.09.19.50.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 19:50:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60273-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=fail header.i=@embeddedor.com header.s=default header.b=n+xFz7Nr; arc=pass (i=1 spf=pass spfdomain=embeddedor.com dkim=pass dkdomain=embeddedor.com); spf=pass (google.com: domain of linux-kernel+bounces-60273-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60273-linux.lists.archive=gmail.com@vger.kernel.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 E1694282410 for ; Sat, 10 Feb 2024 03:49:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE15E5663; Sat, 10 Feb 2024 03:48:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=embeddedor.com header.i=@embeddedor.com header.b="n+xFz7Nr" Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD45A5226 for ; Sat, 10 Feb 2024 03:48:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.89.44.37 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707536937; cv=none; b=FiIAMY5SZKHf2cri51jH+P3jMy1fcIoQaATE06JYPQDeZmpaxN9nUi+R5zHhbs6+z6Ce2dzvDeFNJWmKQ8iV8uVPKCgp5DQgF/nQD/njgxtoK4I0spCX0V7gKCsJEdHjCmKXK/yT3J/kOrpiDGsA93C9qwRKNTdb9HWY+OlGHWo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707536937; c=relaxed/simple; bh=N5lIWGJSxWQYVGgLG22Dg9ozki3dEHmzpJWQ5H3czUs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Uo2134UAUnPmnF/LUOSazEzeJIBrryNRUt3NSYall/rFwLBaViOZ2z0CZXR7QBT1YPhBnDEl3PscptAj32QK5pE5MKmFwEvZRCOcq3wM4Zj3+G/Wd+LDRxqzi7xxfZt16yRaDC8yz+vOc4AeDck1jxjb6xFAyNk8D5A8VJFB/Qk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=embeddedor.com; spf=pass smtp.mailfrom=embeddedor.com; dkim=pass (2048-bit key) header.d=embeddedor.com header.i=@embeddedor.com header.b=n+xFz7Nr; arc=none smtp.client-ip=35.89.44.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=embeddedor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=embeddedor.com Received: from eig-obgw-6006a.ext.cloudfilter.net ([10.0.30.182]) by cmsmtp with ESMTPS id YdGgrilt6rh9zYeMIr7VxR; Sat, 10 Feb 2024 03:48:54 +0000 Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with ESMTPS id YeMHrPXtNGqq0YeMHrelFO; Sat, 10 Feb 2024 03:48:54 +0000 X-Authority-Analysis: v=2.4 cv=RrpmLzmK c=1 sm=1 tr=0 ts=65c6f226 a=1YbLdUo/zbTtOZ3uB5T3HA==:117 a=VhncohosazJxI00KdYJ/5A==:17 a=IkcTkHD0fZMA:10 a=k7vzHIieQBIA:10 a=wYkD_t78qR0A:10 a=J1Y8HTJGAAAA:8 a=1XWaLZrsAAAA:8 a=VwQbUJbxAAAA:8 a=20KFwNOVAAAA:8 a=cm27Pg_UAAAA:8 a=YSKGN3ub9cUXa_79IdMA:9 a=QEXdDO2ut3YA:10 a=y1Q9-5lHfBjTkpIzbSAN:22 a=AjGcO6oz07-iQ99wixmX:22 a=xmb-EsYY8bH0VWELuYED:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=W64qZAI3h8NJ4txSVPm6MF/X+ayduigBYWPV+cPrB00=; b=n+xFz7NrN34AhWBnk8Veb7KwtU 3dDtW8x91tz7n+rUUge8REcm8x8TLDk3WKJjVTtaYpa04THv2tVnEwPFegbM+Ew1OGAJwVwthc9BX rwhpwGVK0QKRYjkHH8gEQB6/S4/7GfU4At1uyvA5cXAY3uA4LBj4GB7ZHB2yIrrXh4xbqTrxBycvO uNyDB5/dSW+tARJ3Ajyv+7wg/NVPr/foDXFLqcYw1i1o8FB/R2tcCy/QgIXw+Ly4QPQhc8Z0sO0n4 neKQ9F7W5MSIRynA/L+d2UReES9QZ5YX13E58VsamyYfBDNMDHkgAii7ygd1Lu3Pgir/QB/MMNxHa Gz8M/QlA==; Received: from [201.172.172.225] (port=48392 helo=[192.168.15.10]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96.2) (envelope-from ) id 1rYeMF-0031L3-2h; Fri, 09 Feb 2024 21:48:51 -0600 Message-ID: Date: Fri, 9 Feb 2024 21:48:50 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] net/ipv4: Annotate imsf_slist_flex with __counted_by(imsf_numsrc) Content-Language: en-US To: Kees Cook , Jakub Kicinski Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , "Gustavo A. R. Silva" , netdev@vger.kernel.org, linux-hardening@vger.kernel.org, Rasmus Villemoes , Dan Williams , Keith Packard , Miguel Ojeda , Alexey Dobriyan , Dmitry Antipov , Nathan Chancellor , kernel test robot , linux-kernel@vger.kernel.org References: <20240210011452.work.985-kees@kernel.org> <20240210011643.1706285-2-keescook@chromium.org> From: "Gustavo A. R. Silva" In-Reply-To: <20240210011643.1706285-2-keescook@chromium.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 201.172.172.225 X-Source-L: No X-Exim-ID: 1rYeMF-0031L3-2h X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.15.10]) [201.172.172.225]:48392 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 18 X-Org: HG=hgshared;ORG=hostgator; X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfJpmLu+ZStihoYf7BcNht3BafH2ujlyL3/yYmDDws/mgRRIvIAMAVMr/jEybtKIjksxnisKM/sXWKNXEueP5yJQP3fFDIHF00jhvU5THvoBkSXzMRyjB GYeC7Wz+5T7NESUea6DotaOMUlaMP2B4xjC5uU/QvF/OZt41Cc9z/qp9EcLa+e25n/YSq7pJZ/iAusUcL4rMjcugf34U9fN/r+oaKZZL7Z5NCsj3E4AOTAjz On 2/9/24 19:16, Kees Cook wrote: > 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: Jakub Kicinski > Cc: Paolo Abeni > Cc: "Gustavo A. R. Silva" > Cc: netdev@vger.kernel.org > Cc: linux-hardening@vger.kernel.org > Signed-off-by: Kees Cook LGTM: Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo > --- > 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..445f6ae76f1e 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_ATTR(__be32, imsf_slist_flex, > + __counted_by(imsf_numsrc)); > }; > }; >