Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1088942rwl; Fri, 24 Mar 2023 06:14:19 -0700 (PDT) Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KNRX96Bf X-Google-Smtp-Source: AKy350bQb+0grnPIv2Jhd9TX0XrZX2s3cza8Xjfv3mEWSxI8hChiqmHsX8Jv1HS5FcIk31qx9RJX X-Received: by 2002:a17:90a:31c6:b0:237:d867:2260 with SMTP id j6-20020a17090a31c600b00237d8672260mr8916825pjf.4.1679663659265; Fri, 24 Mar 2023 06:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679663659; cv=none; d=google.com; s=arc-20160816; b=RpHVfzQHRC0kVQLHcUENMCJMUx1g3sZoQ1Lmp/gAZfDh7F7Nx7QD3BiHd5WrwMGdDJ jHTkbXdNxRrIEvQDPrNgBm6IkR1QZ5T/1u34GvMktC19YteTbisrIC+q3D0JxeFDplAu 8h5MEzLDiSNxX+umH4iNcSMyLXfAM6kFoDxz4wx8Ifu0kS+6bFZRJ1w7I46MYpP+8bf4 k6xVAtHuiEspqBZI4L9IHhzLUju9jkI3/9ceKJmzsatrVW8rG3n0cHxHt2BseDNMhahf 9ho9z+DOWjlbeu+GCJPwvNSSxeVs5SnDfgPkaJiUhUJleDieRJxw4fYPIlMhe5XDwmos gXbw== 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=CVsnDItOtCV5KeWP5m1hFEyLNdIoaUElGcubiZyQHCY=; b=Abx+umn8NDhhUiW48DhNkfdeLeD05hbWhh+eNLFZjAG+LUMjStRBPpPxKi1MLfbpQT zABC3ZiScnMv6AQNryQzLZ9lnsh8XzdWAJb53oVFVDJVShiB3UVT51LxcPv427ysXcWg SpeCUKuaaOADAtF6lRAR7M8FfBs+4fFqw/MbnTa9HybFLM1TI5m2387KbGLqNOlV7duJ 9Qcm4yfh7QoIqmbVGvLI2JoIDqkdh7fUzm79o19TNxy4fyb19x6bKtQvlF42d9NrITaC 1Sac4MYf7ehc8bS/cjN/WvZFoNX9MLv0UuZHpUBA1FhEzW3w7VAQWoBAjYHeDJwZ0ljY uUpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KNRX96Bf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a17090a1d0700b002342e691837si4239037pjd.21.2023.03.24.06.13.58; Fri, 24 Mar 2023 06:14:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KNRX96Bf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231797AbjCXNKU (ORCPT + 99 others); Fri, 24 Mar 2023 09:10:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229794AbjCXNKT (ORCPT ); Fri, 24 Mar 2023 09:10:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9481795; Fri, 24 Mar 2023 06:10:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 23AA662ACB; Fri, 24 Mar 2023 13:10:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 979ACC433D2; Fri, 24 Mar 2023 13:10:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679663417; bh=F0HFFIS62//+IDqQarAuRmb4u+Etmm9kj8vJ4jyMrVY=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=KNRX96BfZOHJpemk4BPtqYbiYzfz+E+F9ajdXWKCVSrwZ1qiXrUHjUAtXY/3Sz6LG l+oTBqGBSK/OCpWMDAqtpage16IZT4lncVS+nwyBETT4ZaFHNf41Jn+SIASll3mMcI iZ31FtHtpdQdDTsumsQAyZe3g6nDIj5lUeAd85fLrLfcbGgA2HnFsGOoMYeKi8BBxl 7vzXiwXUGGBlu0OIX9QCQnmLSrvfB4374pnvkb38AkBDmsv9IiDn2ViP/YRGMOM3Ve V46+hG/38UeCyBQvmP2YyRXLgHyRjF5GF4a2JExT+lqPUL3xujI8GA+Kg3eEvTJ1CL LAA1xvx3vaU2A== Date: Fri, 24 Mar 2023 14:10:13 +0100 (CET) From: Jiri Kosina To: Todd Brandt cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, todd.e.brandt@linux.intel.com, srinivas.pandruvada@linux.intel.com, jic23@kernel.org, p.jungkamp@gmx.net, stable@vger.kernel.org Subject: Re: [PATCH v4] HID:hid-sensor-custom: Fix buffer overrun in device name In-Reply-To: <20230314181256.15283-1-todd.e.brandt@intel.com> Message-ID: References: <20230314181256.15283-1-todd.e.brandt@intel.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Mar 2023, Todd Brandt wrote: > On some platforms there are some platform devices created with > invalid names. For example: "HID-SENSOR-INT-020b?.39.auto" instead > of "HID-SENSOR-INT-020b.39.auto" > > This string include some invalid characters, hence it will fail to > properly load the driver which will handle this custom sensor. Also > it is a problem for some user space tools, which parses the device > names from ftrace and dmesg. > > This is because the string, real_usage, is not NULL terminated and > printed with %s to form device name. > > To address this, initialize the real_usage string with 0s. > > Reported-and-tested-by: Todd Brandt > Link: https://bugzilla.kernel.org/show_bug.cgi?id=217169 > Fixes: 98c062e82451 ("HID: hid-sensor-custom: Allow more custom iio sensors") > Cc: stable@vger.kernel.org > Suggested-by: Philipp Jungkamp > Signed-off-by: Philipp Jungkamp > Signed-off-by: Todd Brandt > Reviewed-by: Andi Shyti > Reviewed-by: Jonathan Cameron > --- > Changes in v4: > - add the Fixes line > - add patch version change list > Changes in v3: > - update the changelog > - add proper reviewed/signed/suggested links > Changes in v2: > - update the changelog Applied to for-6.3/upstream-fixes, thanks. -- Jiri Kosina SUSE Labs