From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 8B5F3353A7E for ; Tue, 11 Aug 2026 21:37:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786484280; cv=none; b=bspo0UrS/VN0PSffeRDnPNyR4Hoy1b9fnKT+dnIlYnlAVgxa8KOnSouxUym2DR8dcydv22OO6UXJ3cLaNmA/xixG50Xm3voKYl818Mkga/0M14ScCM1es4NsktQMNQGBKr2+o3VkEiKENcNANHpeQ5xW1ydL1Z2pcLj+m9lRdfY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786484280; c=relaxed/simple; bh=EENKOAEi1CFTMk1kxLlEmyAv3Cgs5woDZ6jeYsRg27k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H0+dZ6SKwXhoF72iDf1iaxCar9j4NX73ptj8zvj4lunDiwOhiQb3Uro+yixGPepquqhstBSuKVKzVWh5PU7T6FVuwKP0EtDEJbAbglfxeYIRBGFPhooMaZwfzhE+AFX4smZBagwW247KTPinEsm3QQLG/juXr1o5bbNMtQQTGbM= 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=iUCzvugb; arc=none smtp.client-ip=209.85.216.53 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="iUCzvugb" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-38dc4553f62so252001a91.0 for ; Tue, 11 Aug 2026 14:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1786484279; x=1787089079; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=OkNpzuLg/ZEm+U0gq0svKhvkhZF0MHipzZTh1fWVnbU=; b=iUCzvugb+cf9HHOlRRWC2X2qTdY/jzs3IlKvd2DLJIny1dkoTt8FFG+WoWIzsyaPKn viTekqfJcNrYsQAALu+2JE2hZO5lrvS6DtRYAcH3qJ3U8fz9KIIzFLe1+q9HpxeubUwu xVtradCFomZUxHQGFczoMNFJ5pm32GMPM9CY4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786484279; x=1787089079; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=OkNpzuLg/ZEm+U0gq0svKhvkhZF0MHipzZTh1fWVnbU=; b=WH8UhsuVISHYeOBHDMzzwu/7tJ+eBhGibinnrz6zwZTOWgmyJlvawQdn6S8hrs1vem bUR2uBFsK7cYRHrdKr57QWIWWWfoFGnDQhIaN/vQv49dOR6RRNCvgwZIkyjWsMVslJJA bLDJ8u3Lp8zkgtz8MfVqXNNyCnWyxa8zNs6NxEF8m5FIdB+padOzwEx8y7x5T9ZtRF// UvgAxQHJ+F5e/QEMOJCVBBUd0qO1aCG62fR5sEoan5QfmVZ5M0lHRfNBp5idOcz+mAUA xuIdY62Kt8SsC9qIz8X12RWN6Ez4oGfxmEKzmV229TmN26G1TWNnQ6YjCdkCIg724SLf 95sg== X-Forwarded-Encrypted: i=1; AHgh+Rp36Cr32xiwxi8kbdLhCdqhUTfbWIIqF6SulPOt9FykxyRd8Rx9fuHp40BfnCTP6L70yH1YbnlTTnXqxIU=@vger.kernel.org X-Gm-Message-State: AOJu0YyaBBIE9/7z5BojBYSM53AgPajXQgqOCHxViXYdBVuvO6YWG/er xZE4KZoknlne4xb+FUnCiMaHflJpzdvNub+GtRDjtU1bZ5Zw0whfykwtPUUrYv3z9g== X-Gm-Gg: AR+sD10XPWX+Q4xyFyDwlny1ZvUe4py1vetu3shsos+om47wHiNR+AQnM8EHSw2f1I+ jeqva8Y2aLTvPISepUuyfLN4PFHaI2v9VpIHKAj5R4x55CD6SWtubGCiNbdVqqwv6TRU8yJhK3F OTgmJi00L+kTuyLFkEzmlx6uKEulzxfGzZhugx8O12pyL6/+nFimp3JsytYYpQUyrWXHmdnG+tC w4RDu2oOLDJ5/eV5fnwmtLUil4bzDhqJJQOfh2cw2MUzgdTEeS2asRn5vZVGKICOK9+2qTBZ5V/ Ix/5XPWXcNINUd3pTIg6zxyYVt2XBNqLOGKHE+GxvRxUlESbfK5TBka0xEMXQPaPbyI6llRqt+e KSNCsxewxPfZBSdC0/cGdJeFf0eeF7fNV5+7En7GaIa1t9QjFPUsTwtVPQVaqtEZaAEHI+Gu3DL Es9TinYmKKJgBRIk1WrddbLM3SpwDzb2juD3KYurtWPn9twt5mQXBVvBmPcB3yA8u+B1yG5i7Ds JGbUCssoV+QN7wLfZnCCBktjPd/2z4sM9GxEw== X-Received: by 2002:a17:90b:384d:b0:381:a766:efcb with SMTP id 98e67ed59e1d1-393013c423dmr53082a91.4.1786484278807; Tue, 11 Aug 2026 14:37:58 -0700 (PDT) Received: from localhost ([2a00:79e0:2e7c:8:79fa:d268:80cb:4947]) by smtp.gmail.com with UTF8SMTPSA id 5a478bee46e88-31d39e5ebe8sm1112555eec.21.2026.08.11.14.37.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Aug 2026 14:37:57 -0700 (PDT) Date: Tue, 11 Aug 2026 14:37:56 -0700 From: Brian Norris To: Pengpeng Hou Cc: Jeff Chen , Jeff Chen , Francesco Dolcini , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Francesco Dolcini Subject: Re: [PATCH v4] wifi: mwifiex: validate event lengths before copying bodies Message-ID: References: <20260731141600.2-mwifiex-v4-pengpeng@iscas.ac.cn> 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: <20260731141600.2-mwifiex-v4-pengpeng@iscas.ac.cn> On Fri, Jul 31, 2026 at 10:20:02PM +0800, Pengpeng Hou wrote: > mwifiex event packets contain a four-byte event cause followed by the > event body. The USB and SDIO paths copy from data after that header using > the full packet length, so the source range extends four bytes beyond the > skb. The SDIO path also reads the event cause before validating the > packet and publishes oversized events without a copied body. > > Reject SDIO events that are shorter than the header or whose body exceeds > the event buffer. Discard them through the same free-and-break contract > used for unknown upload types. Retain USB's existing error path, apply the > same body-length upper bound there, and copy only the bytes after the event > header in both paths. > > Reviewed-by: Francesco Dolcini > Signed-off-by: Pengpeng Hou Acked-by: Brian Norris