Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2524898rdb; Sun, 3 Dec 2023 22:41:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtsN+Hc/1sM9IgLe4suQ0hDm594hMtycjbc343Thx4LZRsuUNSnd0Nk0H48xa0DsKz1vAr X-Received: by 2002:a05:6a21:7886:b0:18b:8136:f2d3 with SMTP id bf6-20020a056a21788600b0018b8136f2d3mr4500472pzc.24.1701672067682; Sun, 03 Dec 2023 22:41:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701672067; cv=none; d=google.com; s=arc-20160816; b=ORpY2p9NIfmrm9gCnw3m645a7H3tEka42UbsNKFoG30yWOShdw6UVZXYWU8rmZZiBR hIf54Cox9Z4bbSTO0tT0t/R4NRMaNw79Zp5mo+LzEqcD6kG66fuHPgsQzucmiU4rtRca VArb0U5cyCSc5lhyX27FRLPjbjhI4brsCZjaCgE0BRyM/P66PViFEgAsT0+aCIJipSKg a4oUtUcvPqon1IPt6ME/695NF3MlHvVhax12N2MioMKcVn5i2RDj1QYBD/0cNbjSuTXC +Mh6v3kaEVpgu3L8hgU2dlKtAl1GzIJAxWPwvp0/y53fAohPoIOnReszpi24jjgfMNaU 3lBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LDfeXHBgAfFsS3kz+9ALH+0KcxsECsx+6opLECVdRcU=; fh=aVoiwE1RC6+gdYUqb2olg1G9esYELiH+fvNCiFJj6AM=; b=PW/6HGc2RkphPIP6CjND8p5tn8vgrSovAMT8Nbcs7o/egjnwRQQMfvEVHOQaWvJ3Za e44grOjuFYDlSUJ+1KdD2ZpIIdcFrrHiM3fbA0IXFJPBLzD9+u543XFaYb1CUbGy9bQz qqtM72QzyTDrMepzKgXRWQTquRJX5NGXf19XnpK2M+RUaz57WzenB1P/KAxJBVbs3SSD WYlyGGsrocHfW2y9IQw4FUz4CHQw3TUf1fAKo884+I4cOisb5IX67pc2bQ6izes6d5/d rdq9p4awSR80bkoGECxEefE4vdEYGg17wWWWwoVwa7MmOjZW3UHrcjPrQ+6xkP2RVWag wbZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kT0XINOm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id j4-20020a056a00174400b006cde2b3ccffsi2164883pfc.32.2023.12.03.22.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 22:41:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kT0XINOm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BB5D58060462; Sun, 3 Dec 2023 22:41:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229869AbjLDGkr (ORCPT + 99 others); Mon, 4 Dec 2023 01:40:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjLDGkq (ORCPT ); Mon, 4 Dec 2023 01:40:46 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D859FA for ; Sun, 3 Dec 2023 22:40:52 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-54cae99a48aso1659712a12.0 for ; Sun, 03 Dec 2023 22:40:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701672050; x=1702276850; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LDfeXHBgAfFsS3kz+9ALH+0KcxsECsx+6opLECVdRcU=; b=kT0XINOmvgBDksKEXL3ZbnH6i4Mo7ZuB5LPyvoK8qZj14lim91ACJ38XQLLMAKJJd5 AgT69VEugM5QZtqYK3cV0NvCTpeV0gTZqldj3TBRIDue1frC0xcRDhmqK2ceNwHP8YFK +heonD+why8J5XTHPBhgHqw59zX/tJCd6f861kTeXcIQZLllad74SDtkorYaxSmf/08A ltWD5E6IH4FgXkeDAHDptSSXT7Q6EpV6bDS6L16it3xa/fKDUx653bWTY96d8pgvlPWt y8Q/uwume5rwmlSaNDjI7i+G6AM6COKmHRJYUQn01ACZaOEdRAM9b5kaob9JMlulSG2Z lonQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701672050; x=1702276850; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LDfeXHBgAfFsS3kz+9ALH+0KcxsECsx+6opLECVdRcU=; b=IR0os6Nd0ntD89hq+9+SFeP4KY+sjIRAWfXtRVN0Pt3wv9t6hUS8WAuZJAKYVweU60 VrEF9w6p1eulkHinx6m0H26aaIhoDmDuD/qYcDy0Ou6Akc78qKs5ejDmP8qRJfBtYc6k cY9RHvKhy6YPCitcroC3RF22kOQqnF1nJsykcylvkH/R/98F7EL1pW+wF3yvZGItrW8m CXTWUcAYf/tdolNQCPqAxZl/LTqGPrEa1+SYazET3n5AuWOIWW5eveWNQvXpIdqCd5Fu lxn//sdQ3VhAUoNDbH7DdOGVyQ0g5pKf4mPbybegbIu8rVWM+8StP0rUBSOrkbxTQgUh nk6A== X-Gm-Message-State: AOJu0YzdwczAVGnSVgtEx+qU3XX/YT1W+A518WizIJM117NcVjYoeLCw 1ics5zntJWtgm0mn5yZZYF0= X-Received: by 2002:aa7:da04:0:b0:54b:38f:7263 with SMTP id r4-20020aa7da04000000b0054b038f7263mr5237868eds.8.1701672050227; Sun, 03 Dec 2023 22:40:50 -0800 (PST) Received: from localhost.lan (dsl51B7D2F9.fixip.t-online.hu. [81.183.210.249]) by smtp.gmail.com with ESMTPSA id eh4-20020a0564020f8400b0054c9b0bd576sm1998754edb.26.2023.12.03.22.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 22:40:50 -0800 (PST) From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= To: Dmitry Torokhov , linux-kernel@vger.kernel.org Cc: oe-kbuild-all@lists.linux.dev, kernel test robot , zboszormenyi@sicom.com, =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= Subject: [PATCH v2] egalax_ts_serial: Fix potential buffer overflow Date: Mon, 4 Dec 2023 07:40:47 +0100 Message-ID: <20231204064047.158514-1-zboszor@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 03 Dec 2023 22:41:04 -0800 (PST) Increase phys[] array size to 40 bytes to avoid this warning: CC [M] drivers/input/touchscreen/egalax_ts_serial.o drivers/input/touchscreen/egalax_ts_serial.c: In function ‘egalax_connect’: drivers/input/touchscreen/egalax_ts_serial.c:112:21: warning: ‘/input0’ directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=] 112 | "%s/input0", serio->phys); | ^~~~~~~ drivers/input/touchscreen/egalax_ts_serial.c:111:9: note: ‘snprintf’ output between 8 and 39 bytes into a destination of size 32 111 | snprintf(egalax->phys, sizeof(egalax->phys), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 112 | "%s/input0", serio->phys); | ~~~~~~~~~~~~~~~~~~~~~~~~~ Update my old (defunct) email addresses in passing. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311171716.uIQY5rT4-lkp@intel.com/ Signed-off-by: Zoltán Böszörményi --- CREDITS | 3 ++- drivers/input/touchscreen/egalax_ts_serial.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CREDITS b/CREDITS index f33a33fd2371..5efccb40d577 100644 --- a/CREDITS +++ b/CREDITS @@ -470,8 +470,9 @@ S: Montreal, Quebec S: Canada N: Zoltán Böszörményi -E: zboszor@mail.externet.hu +E: zboszor@gmail.com D: MTRR emulation with Cyrix style ARR registers, Athlon MTRR support +D: eGalax serial touchscreen support N: John Boyd E: boyd@cis.ohio-state.edu diff --git a/drivers/input/touchscreen/egalax_ts_serial.c b/drivers/input/touchscreen/egalax_ts_serial.c index 375922d3a6d1..390b3a670bfa 100644 --- a/drivers/input/touchscreen/egalax_ts_serial.c +++ b/drivers/input/touchscreen/egalax_ts_serial.c @@ -2,7 +2,7 @@ /* * EETI Egalax serial touchscreen driver * - * Copyright (c) 2015 Zoltán Böszörményi + * Copyright (c) 2015 Zoltán Böszörményi * * based on the * @@ -42,7 +42,7 @@ struct egalax { struct serio *serio; int idx; u8 data[EGALAX_FORMAT_MAX_LENGTH]; - char phys[32]; + char phys[40]; }; static void egalax_process_data(struct egalax *egalax) @@ -185,6 +185,6 @@ static struct serio_driver egalax_drv = { }; module_serio_driver(egalax_drv); -MODULE_AUTHOR("Zoltán Böszörményi "); +MODULE_AUTHOR("Zoltán Böszörményi "); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL v2"); -- 2.43.0