Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp324944lqb; Tue, 4 Jun 2024 12:30:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWB+wEzlxKGfAJm++lwzJdl3LdJzg6vMS/a+vZddfPer/yQ7P13XhZq4R8mCFTgD8/3p28LOAKL+p3dqY7AbReU7FJAb0qdUKTRJpf5Ew== X-Google-Smtp-Source: AGHT+IHo7NZWdlvwJ1DpQ9SCEe/RN2ARCRpV5JezGR+74WD4PAVyI2csimBw/k8KVjXsdmuHEpdQ X-Received: by 2002:a2e:9187:0:b0:2ea:853f:18e4 with SMTP id 38308e7fff4ca-2eac7a11f96mr1143641fa.13.1717529447932; Tue, 04 Jun 2024 12:30:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717529447; cv=pass; d=google.com; s=arc-20160816; b=hutA2x75VhYlqbpkl15RSPTPX0BBYw50vxTCtktlaTJTb6RXo2l6XC5nQsibFNHzJa zi/lNrdMzWgEipEKZSRKHiCdxkhdr144tdNHXcTBIpgFAQEVHPV2Lh5aigufi6n/qGf3 ExNoRio0YSY/Y396uxvMgnCru8dgftasno2CwYDnR3MrhGK/+JCTb/TnbJjlDpHcMQ8g DxD1kBF/sB6T7zWhjU3L8Geidj80FaA3+JB4ZHd5huHDUG8rICtfcASTPCXeKDvOrfs/ jkqdWM6m1JoNd8P38g2EkdMT5Q9TukHvQwBG5PtQ64iSmG7XS/JtVrdPWTPyFLk8fmiF O2YQ== 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=SjfoPtdjADSbT41zcd4TQ1qMWoklnCAhWIpkfEJKm1Q=; fh=D5cqU3J7fbX8E8MHMW2j2n4TkAfYr5F0f+LthG8QKqU=; b=eJlp+o7l8nRAAgrARovQRXxCm1pD7MrA7Q6/0zY0a7bOiXN4DVTjnZUh71li07cFzV 4TD97ai5+C/2060WcvCOF3Pwz6fKsI1MIH6mG51J0d6TVtykzK9j2lkRLaAwYQUBGb3Q 6PKr3oRs57j7W/dPKGE3PuBU7we1Tr79v6HHWc8wEnMabqFETkjFLoOisgQS940/tI1L 6rH3xOMJSWbaAOOXA7wu06BXOVlCV7kZIZ3Vp/JOMehJnQJ/QW6zhk30WMW5o4hE+QeI 9QOzAgCmj9M19F3WLIF06Ub6cvi7sJVbjx3PKs0HHQOp7rjCRO2vh9laR+/GYrrVcW7D nAEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=NHYIEzd4; 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-kernel+bounces-201289-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201289-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-57a31b819afsi5488913a12.59.2024.06.04.12.30.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 12:30:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201289-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=NHYIEzd4; 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-kernel+bounces-201289-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201289-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 A3B9E1F224DB for ; Tue, 4 Jun 2024 19:30:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 51A4D14B97A; Tue, 4 Jun 2024 19:30:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="NHYIEzd4" 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 E95E8149E00; Tue, 4 Jun 2024 19:30: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=1717529416; cv=none; b=BTrSY0qM1Fc6FfvoipTd+8UHoqkZymbIBRjKmI5C0dJfTdLNdvqZKB0mjlp0MOZW2Xgn+H+GSnBMqrG/GKzMhuBFnCSO8gKnqKZB5/qO7HiWes3UZ6VjguL4z6OmZireg6FN9oxMCk6UnRwMU1I3nKrEMM4k9tS6G0olX2i7tJw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717529416; c=relaxed/simple; bh=ndt5DjQLSxNaMRiN5lWMogKV1y5Mo8iJXJhz3aNywNU=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=m6I0JCSFywjzslM1h2a99G8MT20dN5rV/k+j8S1Gx3hyMAO9CQY5TCbrm7nb1X8ZEplJxcT/AXzTN6FXaYg5Kx76rUqthsrwIYaWUZ98YNEuGTbA/YiTP6gpC8TgFldFIOXTlIOl+9T8Oq/m7bW/TP8S1r0lFBrDBv8NRr63i7A= 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=NHYIEzd4; 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=SjfoPtdjADSbT41zcd4TQ1qMWoklnCAhWIpkfEJKm1Q=; t=1717529413; x=1718739013; b=NHYIEzd4h3I05y9SHIkqwUaFy9wL1RY6nRwgO9qhjGoJ+BO t3M8Aut/gyFurhcII4Mt8BeKGpoXn+23NPH5h39ijQ6o9UyCZWDg3gpcOCqGZowklzPIgCboDwVgC SNH4ASHQtOy824JkeZ09TjFb2USBCXUmFB1xCETtykWO3Kv2kMfkWNsOXqfOK2MXNxB7U3+ljjz7L 2OxVz2Ig+rPOArLKKVkQap2OFJbA1tDUkfVC+kGWLfLoyDHUMZ15kuS3VbDMJ7Lc8L8x2rGQAbFVn LTzKndGgFR6hzfl/BgjPhUxAd2houkv1MeRQAhAmb4dki1gNW5WKseWGGkb8nr4Q==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1sEZr5-0000000CoV1-2UFL; Tue, 04 Jun 2024 21:30:00 +0200 Message-ID: Subject: Re: [PATCH v2] wifi: mac80211: Avoid address calculations via out of bounds array indexing From: Johannes Berg To: Kenton Groombridge Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Kees Cook Date: Tue, 04 Jun 2024 21:29:57 +0200 In-Reply-To: References: <20240517145420.8891-1-concord@gentoo.org> 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned On Tue, 2024-06-04 at 14:53 -0400, Kenton Groombridge wrote: > On 24/05/29 04:54PM, Johannes Berg wrote: > > On Fri, 2024-05-17 at 10:54 -0400, Kenton Groombridge wrote: > > > req->n_channels must be set before req->channels[] can be used. > > >=20 > >=20 > > I don't know why, but this patch breaks a number of hwsim test cases. > >=20 > > https://w1.fi/cgit/hostap/tree/tests/hwsim/ > >=20 > > johannes >=20 > Pardon my absence. >=20 > I'm also not sure why these tests are failing. Unless I'm missing > something, the runtime behavior of these code paths shouldn't have > changed significantly. >=20 Looking at your patch again, this seems wrong? > + local->hw_scan_req->req.channels[*n_chans++] =3D > req->channels[i]; >=20 This will increment n_chans rather than *n_chans, no? johannes