Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1921485rdb; Tue, 20 Feb 2024 10:53:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUrCSo3zzBK5Of0U17n6UV7YZJpV9DE3Db8b/m4Vsk5URe/e7f0MVaZHwRbaWKWA8qIIpbj1fiFEb/Oy21KFV1mCFV2cjXU6B+qDfSOaw== X-Google-Smtp-Source: AGHT+IFCzy7fXnidJD/HciUqCZsuqrCggCwXkhvpzRWL7qnN1oukMMpLXpIHpCgTKzmIQAm3st2w X-Received: by 2002:a05:6830:1645:b0:6e2:df15:ded1 with SMTP id h5-20020a056830164500b006e2df15ded1mr16218034otr.3.1708455205609; Tue, 20 Feb 2024 10:53:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708455205; cv=pass; d=google.com; s=arc-20160816; b=L+2ljNWRpfP7xGuspHczcU5V3NYEbS1VpJ4jkKho3J8Xv8pqEGztiSverq0Ae+I3Kx 6L6stI18EqPJyu6nrwkS2KmASNz0PObC73P4zBghd6boZp34F4U7i502dVyt5u0k5ubf H9f/tODuWxOYLG4n8WRR16jWQvPyBplfO3CXj6v1hV/Z3fMjSTNrtd+idDsSORIJYToy HmchB90M+sBjXawE6cgfx4Ar0Qqgmx8w6+IQ9hg4At6xblju0h4uqw7A6KRdD1WoD2b/ 0RUNYB+7gPQt281Pb7ou3GbxOVLv7KN6h8w60pGvpQJ1r2z+8iZ6HTSaNhXt8n2SID/O Rqbw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ttT+oUr1Lbw6TB+hJGfXC/KcUaPT+W/hoj/H1Fnb1fI=; fh=0e1MYbxZUcMMKelJwf6QsQZ4ew9xOytFnxRfFt2g7I0=; b=ja74cKzF+U7STROGE1NQIAhRqari9BrWc3s4HbIT1nhlJIW22C1W5LWsakqjdbU3as GIiivIix52p5JH/e60kCmmCj0xehiJTcn/+eTWPnydfPHRsnuUzCfE2KJcJ3oB78Ldte SCEl15V4LFr7TX0AyRWqYuIsz5lgc3S5tdsyLVbUIox4/rcxG4fwrKn37VSEF5G9QK4R 2TmOJlkTEVe9g7JGTOXzf9FcRWjTpjYPLUZ8IyMQnzT3yz1VWDjRXwRjjHEpLo6z21mh AQnATsuUCJtFeaoz5ghrzuF0Zxd0gMLH611orfkVAjjsLNba2sJvVfRSXYqR4QC8LpPU bSrA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=keLjzovI; 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-73550-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73550-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id fu36-20020a05622a5da400b0042dc23ea45dsi8613969qtb.645.2024.02.20.10.53.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 10:53:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73550-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=keLjzovI; 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-73550-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73550-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5A8FC1C22ABB for ; Tue, 20 Feb 2024 18:53:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5A7414A089; Tue, 20 Feb 2024 18:53:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="keLjzovI" Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 559CA12EBEC for ; Tue, 20 Feb 2024 18:52:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708455179; cv=none; b=iJImqjEIGpSZRHk6qkL9YDn4iO6ITsRytrqLh+pjjn+Zoeid0kku5aKxXWVnrMccb5ZiCIf1ePbLLWF0cKeONUXiuPYZVzoTZLXIqqh+Aw9dmGM8dMxwmY6di6cuXtNeZ0HemHTBt9DC8auigqWg7dFnmUy/uik6c11W72ay0Ww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708455179; c=relaxed/simple; bh=CVIv5v7FW9q0p/1gcpjdt6M8rpS3zScBxTRDYlpKUvQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SitR7C2hI1R4F509fNRwXqNZ2p+u5FP4N7iUxrFtGTl199IWi5uMF7x+1k6vas2rawtTkDAMUI0nK4yCQ1aYKK7KJwEdwEUSMF0GHdyCQQpt3/LUEpbKeEGwAjI3KKhw7DSqPQTP2exVXwEAO2LbBU3ubIPETHTRQb8TQ2p6J2A= 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=keLjzovI; arc=none smtp.client-ip=209.85.210.179 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-pf1-f179.google.com with SMTP id d2e1a72fcca58-6e22e63abf1so2171577b3a.3 for ; Tue, 20 Feb 2024 10:52:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708455178; x=1709059978; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ttT+oUr1Lbw6TB+hJGfXC/KcUaPT+W/hoj/H1Fnb1fI=; b=keLjzovIo7xRpYovVlbwUDTnk+C7HkhXhgGP+cKa1wnQTyW6jiM4m6qAcr6SJQ8NPC fbb7Js2GOaamMU1crSqHeTj5MA6bygsHjYTEmgXqsvy41Uo8Y0HbWRQDkSuhA58f5MwK LCHh3qy1jEcArd9ClxXcg6icTehX+4CGJwsKw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708455178; x=1709059978; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ttT+oUr1Lbw6TB+hJGfXC/KcUaPT+W/hoj/H1Fnb1fI=; b=KpmCQxKiJZdT5ked41/XFC8sulbWwS4V7OHH19WsTSh5J7dLLk8KTgk0v4/G4foKLQ Bo/i3TZCd93gPMCtuN7hE7eWX5Q5qsRUlc04tLlLki0M51EA+GlB+Dvg2p2LGLtEWDxr TJS8VYaHdKDuP2I7DZ10ZtiWqlPsDRxJXqifwUlZ/02P5I3OVkGtq4m75ZAWYr/3FGsd Jm/hb35YOOmreggAfZhtqTyNqUsDKleFr6MHA9AKWH6tewU7cwgTLH51CwhRGljMkiwu ubKwrt4/aQ64YKAfmsUTN0TK9oP29tmoYAydaTsTRiucPGV+Ay3P8KYJSgrzxHq7nZw6 8bNQ== X-Forwarded-Encrypted: i=1; AJvYcCWT8MesssBkKQ2pXa8hLwjE5/Zsd0/F6a6i+CAlh1R66BvylxwsIWJvf8vkf4ojpXnTIrSEgXieEqkQg318FFU58E685Qbw4dcj2rZz X-Gm-Message-State: AOJu0YxA6kmFLvpBSaKCW8WcKAsMr65BokNTcAbRXcWTHKOEL8LiB8VA 9O3Y5ALzUNC7FdhWfglLfZZTTRQtsY9duKlrGoRD/W2fsG6XHcVW2O4bGdX4nw== X-Received: by 2002:a05:6a20:d707:b0:19a:fa19:23e7 with SMTP id iz7-20020a056a20d70700b0019afa1923e7mr16735038pzb.55.1708455177721; Tue, 20 Feb 2024 10:52:57 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id ka26-20020a056a00939a00b006e4831f3304sm1053520pfb.208.2024.02.20.10.52.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 10:52:57 -0800 (PST) Date: Tue, 20 Feb 2024 10:52:56 -0800 From: Kees Cook To: Daniel Borkmann Cc: Mark Rutland , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , Haowen Bai , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, Yonghong Song , Jonathan Corbet , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , Joanne Koong , Yafang Shao , Kui-Feng Lee , Anton Protopopov , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v3] bpf: Replace bpf_lpm_trie_key 0-length array with flexible array Message-ID: <202402201047.DF40C42D24@keescook> References: <20240219234121.make.373-kees@kernel.org> <4a4fadc5-5aac-3051-f1e6-c56d40350e35@iogearbox.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4a4fadc5-5aac-3051-f1e6-c56d40350e35@iogearbox.net> On Tue, Feb 20, 2024 at 11:18:40AM +0100, Daniel Borkmann wrote: > On 2/20/24 12:41 AM, Kees Cook wrote: > > Replace deprecated 0-length array in struct bpf_lpm_trie_key with > > flexible array. Found with GCC 13: > [...] > This fails the BPF CI : > > [...] > INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/skel_internal.h > INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf_version.h > INSTALL /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/usdt.bpf.h > In file included from urandom_read_lib1.c:7: > In file included from /tmp/work/bpf/bpf/tools/lib/bpf/libbpf_internal.h:20: > In file included from /tmp/work/bpf/bpf/tools/lib/bpf/relo_core.h:7: > /tmp/work/bpf/bpf/tools/include/uapi/linux/bpf.h:91:2: error: type name requires a specifier or qualifier > 91 | __struct_group(bpf_lpm_trie_key_hdr, hdr, /* no attrs */, > | ^ > /tmp/work/bpf/bpf/tools/include/uapi/linux/bpf.h:91:58: error: expected identifier > 91 | __struct_group(bpf_lpm_trie_key_hdr, hdr, /* no attrs */, > | ^ > /tmp/work/bpf/bpf/tools/include/uapi/linux/bpf.h:93:18: error: unexpected ';' before ')' > 93 | __u32 prefixlen; > | ^ > /tmp/work/bpf/bpf/tools/include/uapi/linux/bpf.h:95:7: error: flexible array member 'data' not allowed in otherwise empty struct > 95 | __u8 data[]; /* Arbitrary size */ > | ^ Ah-ha, my test build of cilium happened to cover up the lack of stddef.h. Fixed now and sending a v4... -- Kees Cook