Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2524265rdb; Sun, 3 Dec 2023 22:38:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1j3BzU4QU4xE7O6abDz4ItD5tzhzJhyk/dNSx4Q9GIvxRkWtyT43obWnaOJkQxK5idPQC X-Received: by 2002:a17:902:b087:b0:1d0:6ffd:836d with SMTP id p7-20020a170902b08700b001d06ffd836dmr857720plr.120.1701671929551; Sun, 03 Dec 2023 22:38:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701671929; cv=none; d=google.com; s=arc-20160816; b=jzMZe6hHOXTuLhqA0x5jes7pJxsBC478pEIN4uRKM26pXmVXEYFHocLuepC/rcb5gO 4FpmVMBiymxcXTi3ipNBu0l7SQo5WOFtKFrkDjArjD9GaaX0Zusbd0U7t7Je7PfqCEdr ViGtrtd6/g77scs7FiYTg2WtRPKuy/aAQIGW+YCrsWQgpaznoBLBdBFA2a/H7rDxCrE9 i78iBJTBVxnN2JDDS2xC76b2PzuB224H3dac1tJiZ+wndRH5LAqOiKJQmrC+r4KaCvgl N8Ayq4lmBNxAifvqv+Z6Dx1bzKRumZer2WV21Fafl420kqeuz0mQLBkxIEuMz1KUApMt 0uQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=YYkuRI2m7gXvcv1On4oJWW4OK0PwVwiAqFsMBy1aG3o=; fh=17qm1ZqbCvLj6uXkDOfGNSeil4qkJoloLcy8UI0A+cM=; b=d/oO5FPGb9cHaeyjtz3FYaXliWNzv+dscCJGQWT1a9+iErF0FJIvc/bbLD7cJsdi/p xcMEkurQLopBEVebwDqp06947uYO7lQq5HafNZ+LK/0HEXCfAF7si4+pa7/XR8j81Jba /aAHKnNfK0OYWeEJ767iqowOw6D0CIgGkBKKKMaQ0V/dEaZmJVcQWsMgt3reUqLfj9OZ jOaQR38smNp09lttop9d+pzOONjcN6aX22/ZgyoNLSEj+hz+EGD6aP2MnayyjLHBRizj NtUQcW2T68Ao+4foPReKWM6DfEz39KGVkT+J6dlF80+VUoVr0m598U9Yvyo2FiXPMQSs VYag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=h6a8PXsz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id l11-20020a17090270cb00b001cfc9a1915bsi5966503plt.234.2023.12.03.22.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 22:38:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=h6a8PXsz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 3B9588098434; Sun, 3 Dec 2023 22:38:47 -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 S229769AbjLDGiN (ORCPT + 99 others); Mon, 4 Dec 2023 01:38:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjLDGiM (ORCPT ); Mon, 4 Dec 2023 01:38:12 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE4CEAC for ; Sun, 3 Dec 2023 22:38:16 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a18f732dc83so693775766b.1 for ; Sun, 03 Dec 2023 22:38:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701671895; x=1702276695; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YYkuRI2m7gXvcv1On4oJWW4OK0PwVwiAqFsMBy1aG3o=; b=h6a8PXszrmg3L4ElqLwAoznyyl5RPzAE7wih55eePsRW6kosdZkO3+lU6VoDcVRTeY UGHNF7eH8HU77UZRWy+SiBOs6eeydc7e34RAjus/evP6jH8QM8Kgh5chvJyUoBtIt1pS qBzL/aloQaa0yt5NdFf2aSc0xCYUC762mG1tkCCplIrlaexd7xynhboq60aLxGXCgv5V z0n3gGQbwY5xbxl9fb1tAT0Fbu8LsVwibMBKg2pVbeLMMT9+KuMoLHzGENK2CcN4Oy1T xNc+u6uHWy2NBAIfa7bhsP+5MuNWFK3FeIVLWiDAY2sFnfGfMfMXcYbES/1sp7ZowOWK QY5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701671895; x=1702276695; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YYkuRI2m7gXvcv1On4oJWW4OK0PwVwiAqFsMBy1aG3o=; b=crZkVfAZYj9P++KScYF70Mxqfjcze3A2cr0th2YXo8b+mB2fAGjiuTeQrcs4tTeB9H vYndG8R+wpCBjECtMVO29H7qvNFW/N/n8AsUJ1yluuY2jRH9JVm1WvM/dul3M8lMpv7R PJjFnXBk4r5Zip6TE1Ex6dZDzyUGIzgS1t1T2UTT6Nk3vHvXf/IwKGWSXW1xuLbx4+Ar +fgB8N3Cyva7MT6YKOq14jnucQ7ABPUTfso+D3nsFkTTk+RajXDYhQlcrCS5RsXcbuxm 1MfvKiXWvejhU3LCh43rfoFxPzN8NzHRe1UcnYRnuVh5hip5XlBRTcNnPul+lwJw50il 21tw== X-Gm-Message-State: AOJu0YztcFGRpsZ1XInTXoDAeUzZ80PVi7vOFfLEMr/93ttGGCm9XNE7 hRPEuc7aUyzCyqjHWuzh7oo= X-Received: by 2002:a17:907:2443:b0:a19:a409:37d7 with SMTP id yw3-20020a170907244300b00a19a40937d7mr1350485ejb.48.1701671895028; Sun, 03 Dec 2023 22:38:15 -0800 (PST) Received: from [192.168.2.2] (dsl51B7D2F9.fixip.t-online.hu. [81.183.210.249]) by smtp.gmail.com with ESMTPSA id kg6-20020a17090776e600b009bf7a4d591csm4965910ejc.11.2023.12.03.22.38.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Dec 2023 22:38:14 -0800 (PST) Message-ID: Date: Mon, 4 Dec 2023 07:38:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] egalax_ts_serial: Fix potential buffer overflow To: Dmitry Torokhov Cc: linux-kernel@vger.kernel.org, oe-kbuild-all@lists.linux.dev, zboszormenyi@sicom.com, kernel test robot References: <202312021646.cwwvptuB-lkp@intel.com> <20231203090600.85890-1-zboszor@gmail.com> Content-Language: en-US From: =?UTF-8?B?QsO2c3rDtnJtw6lueWkgWm9sdMOhbg==?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed 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:38:47 -0800 (PST) 2023. 12. 03. 19:35 keltezéssel, Dmitry Torokhov írta: > Hi Zoltán, > > On Sun, Dec 03, 2023 at 10:06:00AM +0100, Zoltán Böszörményi wrote: >> @@ -42,7 +42,7 @@ struct egalax { >> struct serio *serio; >> int idx; >> u8 data[EGALAX_FORMAT_MAX_LENGTH]; >> - char phys[32]; >> + char phys[NAME_MAX]; > This simply wastes 200+ bytes for no good reason. It is perfectly fine > to truncate phys string (which does not happen in practice). Okay, I modified the phys[] array to just be 40 bytes. That's not that wasteful and still avoids the warning. I noticed that other TS drivers emit the same warning. > > If you feel strongly about it then maybe use devm_kasprintf() to > allocate the needed buffer. > > Thanks. >