Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp418703pxy; Wed, 5 May 2021 05:34:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIThEHC2iJ0V6fZ0Ww3zDOV8uRUDOyPp6wjvA0vE6NAyymh3YYLWYj0F7SRvu+m09k6ePV X-Received: by 2002:aa7:9731:0:b029:28e:46dd:97c7 with SMTP id k17-20020aa797310000b029028e46dd97c7mr20883908pfg.27.1620218062973; Wed, 05 May 2021 05:34:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620218062; cv=none; d=google.com; s=arc-20160816; b=SmTXQb3xqaJCfWehR8cybvBpCLq02FVGCm1GxlRQQvghkaNxgPwCrEESG09JibxYBD XWB3/57vFslLyRtrV1qt6i7caZIohAwTjs/11HlYXKVTik5gnSk8DBEmcUYfmHD9rTuB 2LfLKjBvnx70I7tySkz7bnrRqr2wCtIaKa+TGhId8eCbhFff/62DVDFZhMbr7hbkDjv3 xiRMgPvSaENf172WYvpQ4ohbJEDOC8K64EBv9eKz/3pz5zK+cxGbZO/8Zz+UVdyJSSSj jksYdIix0Pn/3PjGvLa3cuUsAxW2sc3QOuoCFs7WYr3HP/6vt1g32PSE0bRz/I2FOJFp cnug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=vZnhYwSrFozuV7K4DQs2Q+s75RpCqflsypJOO17xf/c=; b=tpnkYxeu3UnaTHPaaTm0qHVbMBHpe0NxashkOPPjoUOTzQO5W96GrWmyl9z/boCr6R EEpcP3dMAJ6tSKwDk1MG2wPJlfRZTfBVm3w7tzzkFRvtyYDjZxG1OaTZzswwt9Qvt3W1 wPlyVUG7GeIXK/7aoycUBYdl63R0N1GGb0yBH+OIegJQSk6vyMKW5Tv62Bo3vzUwMAuh iUYd4zmR2310B83oGm1s9kY9QUWgD6RUQ6qlFDikWjks3XNcS5DQcbYzaWpdXJcC4dMM l64CcfiMfXO0EIkCcBgyYSkveQiA/gtwjQ9zqcbDLIYJJaIhlCzHjoJTsfwBSiT1rjMt vNsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RZoEErko; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c24si4267773pgj.407.2021.05.05.05.34.10; Wed, 05 May 2021 05:34:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RZoEErko; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233361AbhEEMeD (ORCPT + 99 others); Wed, 5 May 2021 08:34:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:42570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbhEEMeC (ORCPT ); Wed, 5 May 2021 08:34:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8AB31610FB; Wed, 5 May 2021 12:33:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620217986; bh=WRPI8uSvBQAHJQ3atlPtvokxA0AWzk1rFNxT0nzJCFU=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=RZoEErko5le4MAz5NTu/Tb35/ZzyOi447kBNz0XY8Ijv85gotH4g5yU9Wk8Qyz+bi bBtBFzJITyZeQaQAmRqE32BUFBUj6cvodUU5kgASSKFWYEJF4kzGryzapIO64q18cL H0HwhKpU+j+lqpNSRpMWgH9vvbPgkO2B7+nv3uj5LlUJp16ZfkpEMhY6Q5LdNmC0oB zfPcltkGRjKG1PDqpIisxr17g6WrzJ4hyVTOEMw3GKObXKMerjwgt40uYERiDT4JhR aNU9tVOxwOvNWRQIJxOraGC8R7YngeFfcNnJkQnYycVKk9inWl6cjpz8rLrUKebasm vJsgFX0IhOtug== Date: Wed, 5 May 2021 14:33:02 +0200 (CEST) From: Jiri Kosina To: Michael Zaidman cc: dan.carpenter@oracle.com, benjamin.tissoires@redhat.com, wsa@kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-i2c@vger.kernel.org Subject: Re: [PATCH] HID: ft260: check data size in ft260_smbus_write() In-Reply-To: <20210413151200.2174-1-michael.zaidman@gmail.com> Message-ID: References: <20210413151200.2174-1-michael.zaidman@gmail.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Apr 2021, Michael Zaidman wrote: > Fixes: 98189a0adfa0 ("HID: ft260: add usb hid to i2c host bridge driver") > > The SMbus block transaction limits the number of bytes transferred to 32, > but nothing prevents a user from specifying via ioctl a larger data size > than the ft260 can handle in a single transfer. > > i2cdev_ioctl_smbus() > --> i2c_smbus_xfer > --> __i2c_smbus_xfer > --> ft260_smbus_xfer > --> ft260_smbus_write > > This patch adds data size checking in the ft260_smbus_write(). > > Signed-off-by: Michael Zaidman > Reported-by: Dan Carpenter I have moved the 'Fixes:' tag to place where it belongs, and applied. Thanks, -- Jiri Kosina SUSE Labs