From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796038537; b=wx0SG4xiZjSqhEzQ6p4UfrhnxQC50shS/ASUcxYBlQq4lXrrUC035csxdyNzTHOTNOiC /AmfoigdH8PhYoDGkztCJ98a7D3buKgWo03DUI+NAEZQo6kvsKqWFy1i711bsAtBi/2yL ed76aBJUoxYV+RL24uJyZudLbUK9H4Db1Q6l4yIBrXCrHE5sAEWPexDvMwPLX8KmJwCEY UBrH3un25i90DoJhqn34PVSdpuNylgn73QCnD3EcWLX4Ijel+aRl0mLCZIFnOQtIhZ6J0 rDNDlofuCy20jzBoQRffxU7L1PEkM9pNNmFK6Nrr6JcDq1Usmu1kJO4kuzDAIIHqqQA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796038537; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=mQxc4Oj6W/dwha4BP98FqW0wrxSd/hqLA5MUUCtWvMs=; b=q6yCqOyEpl/FDmdI0lpb+h4p2nEuK016fzaD8aYaSXdKpOJAKJ67P3yWcagfHNadjLjO t86XcJKjfTzcp9vckWKl6vnqeFJtNUlGqnUItlLTK1lZ1laUVw24boM+fSUpfLiM2oALH WawsIx/KciiRLXBl5EP8NQTarpAaez9GVEpc+sULyrm/O0aHhpEUUDSnQhQcm28xWvwm7 bzWwi3VmHx8nwa8dhj5VBl6rfW03vdn5L/xVsMz2YkIda9KYybU496NQGaJYCPWT3VBIi 1vuOLBouG7ZflGCal6KZZ9VL81uhhbmrv7VHP36+eMaTctC0gAx0+fkClTSkhsZ1BsQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NN4F9rVB; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3C22606A333 for ; Mon, 30 Nov 2026 11:35:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NN4F9rVB Received: by smtp.kernel.org (Postfix) with ESMTPSA id 310561F00896; Mon, 30 Nov 2026 11:35:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796038536; bh=mQxc4Oj6W/dwha4BP98FqW0wrxSd/hqLA5MUUCtWvMs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=NN4F9rVBXmuBtahddBtONzInVwRuEDykXXCi9V0kbGyfU/jpVQ2yKVLDUTDtGdFtx tlH/VFSLtV+ZKslgldNrC3MRhGqCvwVAb1xE8FNy9SkXmROlNmAUJJ2HLEF4eTeF0I PRIzQjqqBgNJ8bwMXJHDQQr9aMT+0TQb33eFL1VQZdTbLOOcjz8u2Zdb+1uKNFw56U pbLj23jCaTA08k/Yo4aEpeHpxDoAC9oXbs2PKyOUSom7KFY3xOGAnn8nKOyVsm82Py XnOzZ5ZRULZcFHny4byDLtkt3x3tziYeCTdF54GIm0FpnAwPOmO0qMIrFEpTmE3ocm RtMX84ujjwJ7g== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2] USB: iowarrior: use kzalloc() for the interrupt-in buffer Reply-To: sashiko-reviews@lists.linux.dev To: "Maoyi Xie" Cc: linux-usb@vger.kernel.org In-Reply-To: <20261130113237.2371847-1-maoyixie.tju@gmail.com> References: <20261130113237.2371847-1-maoyixie.tju@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 11:35:35 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > iowarrior_callback() copies report_size bytes of the interrupt-in > buffer into the read queue. It never looks at urb->actual_length. The > buffer comes from kmalloc(). After a short report the bytes past > actual_length can be uninitialized. iowarrior_read() copies them to > user space. >=20 > Allocate the buffer with kzalloc(). A short report is passed on as > before. It can still carry bytes of an earlier report. >=20 > Found with a CodeQL-based static analysis tool that we are developing. > Reproduced in a userspace harness and with an emulated device on > dummy_hcd. Not tested on hardware. >=20 > Fixes: 946b960d13c1 ("USB: add driver for iowarrior devices.") > Suggested-by: Greg Kroah-Hartman > Cc: stable@vger.kernel.org > Signed-off-by: Maoyi Xie Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130113237.2371= 847-1-maoyixie.tju@gmail.com?part=3D1