Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp1018433lqo; Thu, 9 May 2024 02:12:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUTfnz4/cGA3RIWEm0ot0KKRGPoFHgBX+Fy1+nHQMCZxfBnMGc7sfZuqBbR88/vCBOfu6L3ura0mhiItjrsTk1S9vsAYejEmrjO1j1wKA== X-Google-Smtp-Source: AGHT+IEHDc2hhXPMJY+UT+onaOCLDvUx2gtyUUy7PJaud1j9GVnbX7GzxMqZ2pc2RcKUFfFK+/AR X-Received: by 2002:a17:902:aa8f:b0:1e3:ff5e:159f with SMTP id d9443c01a7336-1eeb029bc9bmr51729695ad.18.1715245940506; Thu, 09 May 2024 02:12:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715245940; cv=pass; d=google.com; s=arc-20160816; b=i/b1TBlrJIog9os+40Jb/gB/3lTsIPY8Lb3fdwHMuBrWw1U5Om/otnVN9HBZrp2+rE z1io9m4mAss1e5oaGmpMWsW8/jh+n5eMs2/q2QLEVC3j5QjPs+FAmiggPMM7yUWh5BuT yvtXktsFAKlCZZAGG/5ZZm55yeFUM7U7vMsnyxmDVJ/UQwZLjrQGdhtZlX7Uha9ucevP MQqfvsdd+PabSIVEUtCnb/pjTlsgelHbwCJngsLz0HxaEdIbI3L0nBOOwPvX/7pFbaYx wbuB5gsFyn/lc9Dk4iToAVT/26Bo6Iaw+hWK0MfjvVFo8GlE3bUV16GMk+yag+Y2tl58 MFUg== 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=yfHOQBr6dYYpRW7k8Z7MK8HKsShTr3RZAMKrgndv9oc=; fh=j+t8JYUzdkdckdpWTx1QZuMWXSpRMJ23AWBOacQP40Q=; b=zCtb0R+j3H38bduo66UY1AKwV9uFnxsllF5EJT219eoM18kIl1mszUzyQ9vKfje5pX 2fnUNVyd/jjBMaOuaOXj20adIAtQGxFacgoAkLh0uBz7/VDA+ILUI8QqaqxKJo7h46BI kgUc82QTN4Sdqg/osFqtQr0cWjdL7h/NOFWCI9BD7lX51NT9P5arOSqiRbTM5UDPrKK/ HdqBUVBqixph0ToQEbqWM2WZNLXdOavlrjQaZND2Qj6jqxO7CScyX5H3ZW0TydJZw/kU Eo3dojrDFrMu5Y62dTxFiNAyQnXcjejVTiNQYh8VoW1fS/0DUKkftHDPAg4JOwRnhEux lZ+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=l0Nfxtls; 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-7383-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7383-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c14d081si10424745ad.482.2024.05.09.02.12.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 02:12:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7383-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=@sipsolutions.net header.s=mail header.b=l0Nfxtls; 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-7383-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7383-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EF80D28213F for ; Thu, 9 May 2024 09:12:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49D1214A4D6; Thu, 9 May 2024 09:12:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="l0Nfxtls" 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 BDC0F1494D9; Thu, 9 May 2024 09:12:12 +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=1715245936; cv=none; b=KahqqbdyBTRTHVpwxtCR7uySlmMBq9vWax42kkkOIQEjrU4+V5dnYWNWDWGcXpt3w9ynUY6wWcuRSsGJsiFDBD8fh3n7cHQ6ETjKeeIdB1U5Dvx//6mEkL6SsxOxNRPT41ciqisxDRCdw2RgLGqBQAqNGi3VN6OKrwCGGimcY24= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715245936; c=relaxed/simple; bh=tIrasCcyV33AYR5O1egEtEOiQXsAZNYT11I2V7GFPPw=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=iwd7eRXuHMYy1rjgJdDrpCasT3pYmzumWfGztioOPYU2rvEb5SsUVv9WKXC0E5cuoVHbtRLE7eTpcW4oTRHQwUXUu0pVuo7PGNo7NYjLVq1Bv43HCzhxDJeeF3049e7VQUoyDLC9O51X4pQ/UEm1dYWDEVN8JO0jB85uHGCyBJ8= 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=l0Nfxtls; 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=yfHOQBr6dYYpRW7k8Z7MK8HKsShTr3RZAMKrgndv9oc=; t=1715245933; x=1716455533; b=l0NfxtlsCjeSF7DbWgNMVjegulwCTZ/o6ysRh408+PoJC3Z BfgJKmeAfsAWmC+4YyMAzKvNZj9ubk2JqgCcrBEnFlVGAcSFJiifXMQ+nS9iqdsihnKxFqF2SaIi6 QLhNDzR6XGauqrq7MLySwOgaOUC9YzgTdoktCNGMs4yYAtGzvOTJEmWX1YIk/Y6wgLgLAkbrWCjA8 HtvNkBEe/3nr/a94T/rkdguSc37T2Fg7lfVpEkyEyshwNWoYgZ4Yuu0wSHakOMfWQmIRybXallySR YnNb4aHN4C7H0dFBLQS2MyUPtNzpcFkfsb8rgOuUqUhAxXghraBaZPrmRhULIwtg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1s4zRq-0000000CuiJ-3TvE; Thu, 09 May 2024 10:48:19 +0200 Message-ID: <12b6ac611c1a44b4eadbb1316636b7268ab66a50.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: Bagas Sanjaya , Linux Kernel Mailing List , Linux Networking , Linux Wireless Cc: Jouni Malinen , "John W. Linville" , Kalle Valo , Emmanuel Grumbach , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jannik =?ISO-8859-1?Q?Gl=FCckert?= Date: Thu, 09 May 2024 10:48:17 +0200 In-Reply-To: References: 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 07:07 +0700, Bagas Sanjaya wrote: > Hi, >=20 > Jannik Gl=C3=BCckert reported on Bugzilla ar= ray index > out-of-bounds catched by ubsan along with full kernel trace dump (see > https://bugzilla.kernel.org/show_bug.cgi?id=3D218810): >=20 > > I am seeing multiple array-index-out-of-bounds related to `ieee80211_ch= annel[]` iteration. > >=20 > > This is with a Mediatek MT7921 chipset. > > I have only tested with kernel 6.8.9, but I don't see any channel index= related fixes in master. > >=20 > > This was discovered as part of Gentoo Hardened enabling CONFIG_UBSAN_AR= RAY_BOUNDS > >=20 > >=20 > > [ 106.194465] UBSAN: array-index-out-of-bounds in /var/tmp/portage/sys= -kernel/gentoo-kernel-6.8.9/work/linux-6.8/net/wireless/nl80211.c:9203:29 > > [ 106.195063] index 42 is out of range for type 'struct ieee80211_chan= nel *[]' > > [ 106.200924] UBSAN: array-index-out-of-bounds in /var/tmp/portage/sys= -kernel/gentoo-kernel-6.8.9/work/linux-6.8/net/wireless/nl80211.c:9252:5 > > [ 106.200926] index 0 is out of range for type 'struct ieee80211_chann= el *[]' At least one of these should be fixed by https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git/commi= t/?id=3D838c7b8f1f278404d9d684c34a8cb26dc41aaaa1 > > [ 106.201036] UBSAN: array-index-out-of-bounds in /var/tmp/portage/sys= -kernel/gentoo-kernel-6.8.9/work/linux-6.8/net/mac80211/scan.c:364:4 > > [ 106.201037] index 0 is out of range for type 'struct ieee80211_chann= el *[]' No idea about that one. Send patches. (Seriously. If you're running with bleeding edge toolchains that pretty much nobody has yet, send patches.) johannes