Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1336905rdh; Mon, 25 Sep 2023 09:34:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFbcRa1P7hABvt15Lj9g/hiqT6WCIb8jCjECX9aSbMh/lHjhg3KnbefbiE17krQp2uM0Rg5 X-Received: by 2002:a17:902:704c:b0:1bd:bbc3:c87b with SMTP id h12-20020a170902704c00b001bdbbc3c87bmr6024108plt.41.1695659639619; Mon, 25 Sep 2023 09:33:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695659639; cv=none; d=google.com; s=arc-20160816; b=O8OKk4h5tYGiY2iIRduj8dnio7LGuHELC7vXzIBba+qtVt5081mwG2pDJF1aQEgSmz xysVPmR9HfnWEv/G93RtfwbFnbfm+qqsynlnDUrs2KKcO4JCCUisH7EpKATqd0dllqVJ fruUHEHN9XIybIOxE3KUNiKibtgNQB4eyWu/FLdzSuuwcsV6B/nEQYWENYDqmn4rw5eU UPDLZx6lG6ASzHOkOadSDBaWOCBg3rj2N485URGtbcs68e05mA1HnbVNx682HIEb9jNk /ocm1/hGTfH5gnY1fbq+GTT15HMce1RkUH2ZW76kHyWeiGRo9MIxaB5GilcbCvM384ZT gngQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=vi/lqKSH7vWIOM5JBZ970rzVnd8nSDODyvyXImWgKYw=; fh=TK4nNAo6GOqN4I1/gD7W8CNuEQlNA+lylul2ofUo+Xs=; b=Q4HZ8MDWuCTki1Dj5gGCD8d7DPCEs0AoVLadlN1pSREDSMk3d9ConnvhK8QcjTWoAz lsOyckwHvEFNVRuREm7jIMfyNZ8F+1dRZKzKOyL8MEgo6vgVn9y162df1vOeXm1E3deG yD60wt6IFp+mgylHRO4PbBIpNsQTvGcXa8NCTmJRagN/e9Z9+dOZ7QZfK3KBDP5b2Mgj 8XFNCqvaT/xs+CsiswSkscHFyHM//F5adGNt6xSsggSSVI/VhA04GY3pF68psAfBsXm3 VhQ0W9i4CK9D5dkPklwF9ny84m52HJXLCupTi0cyR86sSnDfcXr3UOY9qqibCliF1vsJ ehAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f3bWwCjG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id le11-20020a170902fb0b00b001b9f55d28a2si9623384plb.205.2023.09.25.09.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 09:33:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f3bWwCjG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4D3C3812A947; Mon, 25 Sep 2023 05:19:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231448AbjIYMTK (ORCPT + 99 others); Mon, 25 Sep 2023 08:19:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231395AbjIYMTJ (ORCPT ); Mon, 25 Sep 2023 08:19:09 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51BDD11D; Mon, 25 Sep 2023 05:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695644342; x=1727180342; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=apuZ6KIw6/15l+S9Oovo3skg9jLDHcGg6Hd8Ts4y2co=; b=f3bWwCjGPi+VS/sIOXmxXihxsAS3oVbznC1tmR9/vmQwW5U8m6AbEJO6 Oia9kMBK0lfEuGu9cRXUU0aeJdYiTUfRSj5PzqnAm9Zy7mhTNlsIqwVZn o1oAxINhUJ5A0ir59KwFfN1gB1bwZO/V88G+6IN9S61H1Z3GydJlvt4eE XA6nGtgAihShkmMI/uPbbwMrOE7SIfhrPaL0AQ2WjrwFDz150OwivS4eE Gx5hcbtmHa9XfRW5rFrxU6vhUntHfBHl6NoUZOkL4E5YHnYksaFN0YoVU ltH2PTqe9VRjShGHjTtbFJ0OciJvdrA7QNd84yry2wCii6MIdp/rxZzKT A==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="383996204" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="383996204" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2023 05:19:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="748329392" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="748329392" Received: from stamengx-mobl1.ger.corp.intel.com ([10.249.32.149]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2023 05:18:58 -0700 Date: Mon, 25 Sep 2023 15:18:56 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: "Fernando Eckhardt Valle (FIPT)" cc: Hans de Goede , Mark Pearson , "corbet@lwn.net" , "hmh@hmh.eng.br" , "markgross@kernel.org" , "linux-doc@vger.kernel.org" , LKML , "ibm-acpi-devel@lists.sourceforge.net" , "platform-driver-x86@vger.kernel.org" Subject: Re: [PATCH v4] platform/x86: thinkpad_acpi: sysfs interface to auxmac In-Reply-To: Message-ID: References: <20230921143622.72387-1-fevalle@ipt.br> <946285e6-6064-4084-a1a7-f5ba7dea3e7d@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 05:19:10 -0700 (PDT) On Fri, 22 Sep 2023, Fernando Eckhardt Valle (FIPT) wrote: > Thanks for the feedback again! > > > Okay, I wasn't expecting this change as this relies on the nul termination > > by strscpy() since the original buffer does not have one but the # > > character there. But I guess it isn't harmful either. > Yes, precisely because strscpy() put the 'nul terminator' I thought it > would be ok. In the tests I did, everything always worked fine too. It was a bit unorthodox way to take advantage of the way strscpy() works but like I said, doesn't look harmful. > > AUXMAC_START is an offset ??? It should be AUXMAC_LEN. > > I thought that since the string 'disabled' has length 8, then I would > use AUXMAC_START which is defined as 9 , because that way strscpy would > copy the 8 characters of 'disabled' + the nul terminator. Wouldn't that > be correct? Or would it be better to use AUXMAC_LEN which is defined to > 12? strscpy() is takes the size of the destination: * @size: Size of destination buffer ...so please use AUXMAC_LEN. In anycase, "disabled" as the source is itself nul-terminated so strscpy() won't copy beyond its length. -- i.