From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.28.101 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796127802; b=kLQfaaORvLSAuqCaLudPWo9NkfhMdPHxXrtmRI/PJdmhUqpuVuTkql5VfDOrklrMpxeQ FAWiDLFt2hFmrYQr1EpUky+olYpdP92pfFGEm9AcADDMpj1oCxOSRz1cPBup7owWEc1fi OUcnxypdB0iOds75L+nO7P/nvMf9xWKUQYaDSMlxN1OeAGbCTPXU1Ceyn8AC15pnhEYwG FJ2BPKLEKSDswBPfUH5amf2GOuBTkzCb3ZfUHamVD6wn93xNwM9eN9ozxDi2zK8mQol20 KlSN3qCgVt4aNyR2FNC+5fmFqAYZ5OO7r8sk+E71i0e/wfQStwn5XSxD9oPRtecm60w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796127802; h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=UFjFIf75j9eHl7C9lzHm9SN5HpcuH6SiFXVKnCAl0rk=; b=dsqe71FXbwLeCsgIxvIif/AXrmR55wuf8qIhWCEBBCbUZjHBAxxV5dgOkfZ/0Ac6X3a8 CPPKQpxr6ARSz5C1DZ9V61z0+AMvn1slfZl56DVot9LfWLqVIOKebXx74NC++o9M1b/B8 pRebrc9knd/rc7EXuiy098+9jO1/7hGPnuY8IDak2qdzX7OerVl5hgKN69ejOo/lJlopF 4fHUdUSfmrNBYVGn6Dt0VrykYkqg6AD4bfmM3P+hmsrjlNqp8jtiyFocTBeqM6xx0ehmJ zfwaR2k8IP/U5L14vMpj1UZiP6tWBRBxIU7OeUKugvMh0tM3vV5DNRD7X33td/lXFaA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=xiaopeng.com; spf=pass smtp.mailfrom=xiaopeng.com; dkim=pass header.d=xiaopeng.com header.i=@xiaopeng.com header.a=rsa-sha256 header.s=default header.b=pZv7rlwE; arc=none smtp.remote-ip=115.124.28.101 Received: from out28-101.mail.aliyun.com (out28-101.mail.aliyun.com [115.124.28.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AACA606A331; Tue, 1 Dec 2026 12:23:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3AACA606A331 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=xiaopeng.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xiaopeng.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xiaopeng.com header.i=@xiaopeng.com header.a=rsa-sha256 header.s=default header.b=pZv7rlwE DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=xiaopeng.com; s=default; t=1796127795; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=UFjFIf75j9eHl7C9lzHm9SN5HpcuH6SiFXVKnCAl0rk=; b=pZv7rlwE8u0tZVnso7AM+r+BvwHN7ro8ZXyYAgUVRs0JKWWnTDiukMlWFfGtpReVvy8tF1SiaPnRczFhcoQ9qk7VnJJlOYrk1DMRqQbxux0c3tEMRYBTqs1qzJSEGTj6ol9HnhLEfOKhxB/Y6ycXipbvyRw8ESauIzEL9cdrMCs= X-Alimail-AntiSpam:AC=CONTINUE;BC=0.1258391|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.0313157-0.00160326-0.967081;FP=7923226779519231082|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033045038069;MF=zhugl3@xiaopeng.com;NM=1;PH=DS;RN=5;RT=5;SR=0;TI=SMTPD_---.kEBT73M_1796127794; Received: from DESKTOP-UL5U09E.xiaopeng.local(mailfrom:zhugl3@xiaopeng.com fp:SMTPD_---.kEBT73M_1796127794 cluster:ay29) by smtp.aliyun-inc.com; Tue, 01 Dec 2026 20:23:15 +0800 From: Guanglei Zhu To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, liuc63@xiaopeng.com, stable@vger.kernel.org Subject: [PATCH v3 0/4] Input: adi - more bounds checks in the gameport packet path Date: Tue, 1 Dec 2026 20:23:10 +0800 Message-ID: <20261201122314.361354-1-zhugl3@xiaopeng.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261103084135.426629-3-zhugl3@xiaopeng.com> References: <20261103084135.426629-3-zhugl3@xiaopeng.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is v3 of the two-stream merge fix. v2 rejected a merge that did not fit the buffer; the review asked for four more things, folded in here as a small series: 1/4 rejects a merge whose length field is zero as well, and computes the start offset once instead of recomputing it in the loop. 2/4 fixes the length guard in adi_read_packet(), which tests the counter before the pre-increment. 3/4 rejects ID packets whose axis split or button count would wrap, and stores the byte fields as u8 (pad as s8) so the values do not depend on the signedness of char. 4/4 checks the decoded axis, hat and button counts against the size of the device's axis and key tables before they are walked. Each patch was replayed against master in user space with ASan; the results are in the note under the tear line of the patch. Guanglei Zhu (4): Input: adi - reject stream merges that do not fit the buffer Input: adi - fix the packet length guard in adi_read_packet() Input: adi - reject ID packets with wrapped axis or button counts Input: adi - check the decoded counts against the device tables drivers/input/joystick/adi.c | 104 ++++++++++++++++++++++++++++------- 1 file changed, 83 insertions(+), 21 deletions(-) -- 2.43.0