Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp1064138lqo; Thu, 9 May 2024 03:53:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjpknVfp1phyO6NuYknDUCelLRm2yUSLHKA8opgYy9yaObIaR/aTJjNY2xts1JZpSIjICH6ZYWEcezxvvBjewPigukZtD78KZNB+wwhQ== X-Google-Smtp-Source: AGHT+IEH68ef76NpSvpsfZkFr+NPuZnvASE86si1awOvp6cwb2khVFKsRPrZPJGKFdF+PiGNjw/Y X-Received: by 2002:a50:bb07:0:b0:56d:b687:5a45 with SMTP id 4fb4d7f45d1cf-5731d9ccf90mr3385800a12.1.1715251991394; Thu, 09 May 2024 03:53:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715251991; cv=pass; d=google.com; s=arc-20160816; b=p77fvEQ/h/MATgrhzQ/D3WG/Z3bkeSfHDZUlwrwKyW0SBWiwEd6xSM9go+djQtoYRx Ps77AZ9De5NJ9w7tsgkGUb/a5WWdyrocX6SgO0Ouka1Qam1BwNcVCBHz+TJZjjUcyiei nILV++A0+WxDCPPiKzdLYzRZSqWAX9QnfkuRrg0lSXHtmIcwq+GatoL+W+C4OzQP5EoM r8uuCybx0WMVy7hxe8cvpagHnLsTn68KmLfdBP5+fozpcQ+rwyYA7ypsqv3o2jFXpp6s b+//jOB2cwwjUif19+++I22j7Bo6JCPk9YmNxpWkHEsjyuR30Cut5fCCrMIlt2jL5/Yi FIjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=e7z0v/MhjoIRCMcX4IPYi9XvMRKn+UlhFSRYOf0bl00=; fh=W86SXa5vHUg6SPXlcYN+IyRZ52ejauvALY08tWeFRiU=; b=tw0gHzqsO6pmkBFjlu6JqGmd4SnAozA7o3Np2zjuFLN842+lzY8s+mvv5Bke2dgZ0I weYB2andM2dT7kLbvOSkuopnmBCGrTl9ZP008Yr8YDFdBetWwOjAicwsDkjt2M9TlkvD EAWD1+68ZcinY1trQA4q9YRu/xa5fOlM6PVOg5Lh6Mw1IBXS3VuKesyV+F/TxbwwCUvP w3TIIxMMwL0srsVXKKpnf+780jSLLMtcU0oSlS5yAwny+v59ecBPTFck2TWMb6V/JJsE LVpwNyS889EZjzy4ZBSu8cKAMatmIFSqeDsOTLQWH4cjhIhKoBk6woyONqhs1lrG6ZTy qDJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=UTy4D9Ck; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-7389-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7389-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c36d6c1si647029a12.547.2024.05.09.03.53.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 03:53:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7389-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=UTy4D9Ck; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-7389-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7389-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 993CD1F21585 for ; Thu, 9 May 2024 10:53:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E590712FB1B; Thu, 9 May 2024 10:53:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="UTy4D9Ck" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 82D3E12F37C; Thu, 9 May 2024 10:53:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715251985; cv=none; b=QDPe2NL4kOZsCdYHiJXAj9J97Sb9OTyg7SNLjgQBjsoyaXCsmModUwwDpIhH+UyqyV1+W3qW4K+aHouDUVIKxmf5oIzG5k6lR2cQnRTk7a0bRWxxKh7giwwJM+0P5XZOHAZ9UuCS4L6s3u4xG1x8RA1gwjjGaiXUCcWPXLdykVA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715251985; c=relaxed/simple; bh=TkwNWDqoHA+H+7j4DdwcM/R93W1nTiD50C2NF+X+k2c=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=NrLIcjmkUXuP6v0TsTKx0l4PJeZDdPawm/SNIrmUQtRnr8oWonZLTMPI0saDk42Nh+la3H/phAT06tLsYp6D6/Vq1ujrvAGczJV1Y9GfDBUxNHQLvl5txw3A8283qSwluKvsG5KLOWrYuQ5SSnQVO63TUBOlFTQ43137jQIeG+Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=UTy4D9Ck; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=e7z0v/MhjoIRCMcX4IPYi9XvMRKn+UlhFSRYOf0bl00=; t=1715251983; x=1716461583; b=UTy4D9CklN7Fl5pTZwiHsuxnMuRHtTU6HiEDg2yl+RtXZ7B 2qGmVGdf/YwsdZXsRdvGM2TulwtO2PGwqFxcNdyRGf6vwSFibSpn3m/gCeU+yOkDOuUGhATYUxtXX 4pCdmknlm7hfYA2fZ2mCB3iKTRqvF5mie7DvxDjdQJ2rpXGCBqrj+PeY/tRG9SCk2oWbHLvCHoJ5Z fAJimjXteve3s+7qhed1VqFzkWK4bfbpNpYKOXZmn8zLh9PVbEjuG3o/bNtbTNKv4E9aJXU38HCNW Q+MB8DLuBpiw5ObKHBgs0/5R3ROYVWSPzh7bib5NglDT3+aNLJyTQ+vBwqncMWxg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1s51OT-0000000D1B1-2HJC; Thu, 09 May 2024 12:52:57 +0200 Message-ID: <161df39ee89ae640828d3226a8de3d60f786ddd7.camel@sipsolutions.net> Subject: Re: Fwd: UBSAN: array-index-out-of-bounds in net/wireless/nl80211.c and net/mac80211/scan.c From: Johannes Berg To: Jannik =?ISO-8859-1?Q?Gl=FCckert?= Cc: Bagas Sanjaya , Linux Kernel Mailing List , Linux Networking , Linux Wireless , Jouni Malinen , "John W. Linville" , Kalle Valo , Emmanuel Grumbach , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sam James Date: Thu, 09 May 2024 12:52:56 +0200 In-Reply-To: References: <12b6ac611c1a44b4eadbb1316636b7268ab66a50.camel@sipsolutions.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned On Thu, 2024-05-09 at 12:49 +0200, Jannik Gl=C3=BCckert wrote: >=20 > > (Seriously. If you're running with bleeding edge toolchains that pretty > > much nobody has yet, send patches.) >=20 > I'm not sure what to make of this - this bug has been around ever > since the code was added, modern toolchains just happen to be one way > to expose it. No, that's incorrect. This is perfectly valid code: struct x { int n; int a[] /* __counted_by(n) */; }; x =3D alloc(sizeof(*x) + sizeof(int) * 2); x->a[0] =3D 10; x->a[1] =3D 20; x->n =3D 2; However, the uncommenting of the __counted_by() annotation will lead to a complaint. johannes