Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2299500rdb; Sun, 3 Dec 2023 10:35:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFIXiUE11cW1GaFkvE9NdsIVPMGLsDNUWIh6E85KvatbFqvNZapk5XUxeMaFUYQw+2YYZRK X-Received: by 2002:a05:6358:6f86:b0:16d:bb7b:c0a7 with SMTP id s6-20020a0563586f8600b0016dbb7bc0a7mr3184279rwn.10.1701628532577; Sun, 03 Dec 2023 10:35:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701628532; cv=none; d=google.com; s=arc-20160816; b=ckLOT4CyaZoOj8xLpvlz7xLiX3BpuJ9Tc4LzlGHUrJ8QOXoa/n7X1xKY+VMy71zXoU Erkvb5lLHgCrXCAN3S54gWTx4yoMCDn+Fgl+l86Y8FtkIIJ3yzd0udxgDGtk28UD1Gc3 fydRCcOzWkk9a65T/flF1bwgyDTwVPCB5PLYBRL0AA7vK2n5VuPKxw0PCdYrE2Z1PWm3 9Qr7FHGJZR4/wO0p3tu3S3EWvfjwsOX8Ok/4EEP0ourrLDjEXKLR+rL3t1NRh0/YK46U QoOvlp+aHFeV6/ZC2r1i7umDHgTBTkx2smaCc4cwK8W3u7zvj4TKG0jTh68XPJ/A012Y gHvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XofiGJnHsU0gR6jHZzAR0X0zZqTCu60EVqYYZjegzVc=; fh=3rcHSiJeOj/jpNCKn3D//VHJHkk10Q5ceQbkQ2o/b6Y=; b=tS91/0OTHPK69fWm9BeDRsQQJPtpAbtpUNfZyLJXzSKGF+nQ0fXZrefn/AlXAkU8ws ctbbz+uP4n/akBQBRGUElSUZEDUsIvQPbCwkdQXyFQRujRk0AmWz5YXGagJFJ5giCri/ UCMf4q06P3Wwkq9Leroz7ZdseTnWmKnwXO9jPMjcovpuuo2mKOzVGu7Ww3R8VKZwZgql SkzR6TGBZkrc7i8NSqVn5iLxyMaAJh4l0jVghE6ITIQ7Rqn8V5K0XBYWKjC4GNRGpnp0 SxMkzx48BJJXsJ65eQFqS6ncrtH62pzmJ0UpC9ZmUbzK7CtT1P3xigvtiS4h22s93OfU DiiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mXRxeQOZ; 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 bg8-20020a056a02010800b005bdc949fee3si6833678pgb.880.2023.12.03.10.35.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 10:35:32 -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=mXRxeQOZ; 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 20E60806583D; Sun, 3 Dec 2023 10:35:30 -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 S233840AbjLCSfQ (ORCPT + 99 others); Sun, 3 Dec 2023 13:35:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjLCSfO (ORCPT ); Sun, 3 Dec 2023 13:35:14 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35CCDDA for ; Sun, 3 Dec 2023 10:35:19 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1d04d286bc0so11437895ad.3 for ; Sun, 03 Dec 2023 10:35:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701628518; x=1702233318; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=XofiGJnHsU0gR6jHZzAR0X0zZqTCu60EVqYYZjegzVc=; b=mXRxeQOZHbsK2lz4PsG09Ie4PuMcemFF81Iq319KptVmkq+Ra7SU/W54Rrys1rmW45 ADjlZWOHbMKCvMdhSUYj+xjoYhyQd0GInDtpcf8puacQ9QfYo2hxqN38uX+uIZ0TmLo1 Sub/AjOaVbZ+a3z+AHNDk3i4stMVV26wl5+wWLF2tVfor0XtD9dKIvH6ZVxAdGflwXkC +7/Bl11zFb7E1C8Jli5Hg/P8zGYZjS6PB78Z+iToNjlr71N9cpPLrI+oah0cLGQafrz/ jT7WUijvE0lFh/u1wv7C02lVP+sUuIyR8iCgv7u4YR2zgh8bCQPmuJd+IAdrPZvGgSAh e4+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701628518; x=1702233318; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XofiGJnHsU0gR6jHZzAR0X0zZqTCu60EVqYYZjegzVc=; b=GAEQmff9BX1XlBJnqPiFFjqddJFUTdFWfLKHLSNR6bm9kBXKZ4VA8dZ9QLKvD/3be9 m9G0vCrEEjGaLDC7ENpE/Ia+CGC+Bw51bSoikw/iEKNkUZnTP3YkMHjmrBOr3HcmChOO PLuChjnHbPYAxgOJhPnQUtag37Z2H/PkOhjcU3jry+ByMiLXsDMuL4NMQ6UDd5MPnVQy ILVl7+UlcGDcTNmJMSotkSWQ0KS//2xwIn+slTb424f13M0IvMTD8LifuEJZ9VXZEcGv rKKKGG/qbjzLnJ+3BZ1onN7PYWLFHz3p6B+iq+b8mKTNYZo99NwkIKWwcO6o9T8de5Ja x/EA== X-Gm-Message-State: AOJu0YxsQJSOeJJSolbPwKw7hiGWTbdv0Q4Ah+f2RBEa2c+XETRdzMk0 tj//8Q0cQSoPGvthdLqCEeEgSpoFYtw= X-Received: by 2002:a17:903:2285:b0:1d0:71db:d427 with SMTP id b5-20020a170903228500b001d071dbd427mr761317plh.134.1701628518472; Sun, 03 Dec 2023 10:35:18 -0800 (PST) Received: from google.com ([205.220.129.26]) by smtp.gmail.com with ESMTPSA id l19-20020a170902f69300b001cfa91a0570sm6935117plg.155.2023.12.03.10.35.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 10:35:18 -0800 (PST) Date: Sun, 3 Dec 2023 18:35:00 +0000 From: Dmitry Torokhov To: =?iso-8859-1?B?Wm9sdOFuIEL2c3r2cm3pbnlp?= Cc: linux-kernel@vger.kernel.org, oe-kbuild-all@lists.linux.dev, zboszormenyi@sicom.com, kernel test robot Subject: Re: [PATCH] egalax_ts_serial: Fix potential buffer overflow Message-ID: References: <202312021646.cwwvptuB-lkp@intel.com> <20231203090600.85890-1-zboszor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231203090600.85890-1-zboszor@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 10:35:30 -0800 (PST) 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). If you feel strongly about it then maybe use devm_kasprintf() to allocate the needed buffer. Thanks. -- Dmitry