Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1587102rdb; Mon, 2 Oct 2023 14:31:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdhiqQh6i0VPmfjy00bZTfzW/Po/awum+Ta5SRJv4nsXnLatjzbNYPhhPvz4JbdPGQu8EV X-Received: by 2002:a9d:7353:0:b0:6bc:63c9:7946 with SMTP id l19-20020a9d7353000000b006bc63c97946mr13197649otk.14.1696282288825; Mon, 02 Oct 2023 14:31:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696282288; cv=none; d=google.com; s=arc-20160816; b=Q0Bz4s/XKZclJUn2ERSy/MCBkYBykUiZ1tbevzFyotvRqREnNEZU861ztawAzrzulj 5eSuVWHeUJ8o8jqaCHM5t3uFKyA153ol4waaZuDjAkGkD8nrFL5wWw/Cg6zG5QQuZZZO C/5D3pC+MY3LFMWWEZhcUfB8cTUhDkeViEvu09Me8ZcweKmXpoWUwkuu5hLJCiOXOovf Ua44xFDdqxObMN+bjoLPkIt9zjgY6i9jxDQP6Yu9auHqT8+ZH+pvQmFSarIZ6ny4B3BD ti+0lc/FjqMt0JlL69Mi4F4HpZSpFV4wGDav5yYhaD+wDKUf8B3zJ2o+p03iUb8sBxzf sabQ== 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=La/UwHFylhQyoPfcV52I3wBlCsi+eSfmdgjVtGCywVw=; fh=WlwpJM2gto9A2r0Ba7+71gM+xDOLVRYYCajkPxBJS8c=; b=eg6ZsHcfS7B2zUnslqmh8Oxr+LV9rk2ekbj51HdXAbWq3AYb7whaql7Fkb5NjlZzKn NERGUziRq/fOe+o1z1J3reJxQBifB6h43xee7dy0VsRXEuGXZTC+uK58z2MmGU2988Vv MOAdplHXsPZwsDUabsG35J7sc42dd03qz4jErWKtXunae49v/SWqT82I1hoBLndj947J iBAzAvgNvPAwLcVCLgj7mO0Kx7jXu/Oi5gJmLHNRe2R+cTmlN2/1boGSbAPI6yP4v3er 5cnXtIWJsoXfr5RvTYIaJ3pHSpsAuf9pPiyLNvfzpjYx4DT0DFVAFvWsuPFEZNBcfkH7 hIcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VVQt3w9t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l3-20020a654c43000000b00577e00c5ffasi28797970pgr.867.2023.10.02.14.31.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 14:31:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VVQt3w9t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 2109D8043EC8; Mon, 2 Oct 2023 02:47:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236233AbjJBJqr (ORCPT + 99 others); Mon, 2 Oct 2023 05:46:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236174AbjJBJqn (ORCPT ); Mon, 2 Oct 2023 05:46:43 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E67F91; Mon, 2 Oct 2023 02:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696240000; x=1727776000; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=yecl4KQ6cTg1O9LGgRMfjZXbOywvYlyUsjIAYh4QoG4=; b=VVQt3w9tzmYOuQn1xA3lCEjrmt7xnLJTd/VBO9/E+ufowLVH2yvpFK0d fsI/t1XsZ53mDW4Crba5HaQBNv9gOO7xMG8qmEzP2MbuxwIljskaDSx9R G3cHSKuhBvNj5/nhKtKDISexr4cfD9hasZsPC3LcUs2wE1DIYcE64a3UY 4/PfnEQSJi/MDV4V8qMynBprvZfGTrqb4YkCvIziLQBOFL67GMxH3DY2N XwbePEd1UhgzN92EnmK7b+k2GOnVuBqOemHwFnYVJP0TGGAyt+cZlLE7f wZ/7QoAIRMSxrjFMuy6B4njcYccwEglLPbX4KzV4hKBTgSv6E1oE7Hynh Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10850"; a="372960252" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="372960252" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 02:46:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="1467822" Received: from roliveir-mobl1.ger.corp.intel.com ([10.251.222.16]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 02:45:58 -0700 Date: Mon, 2 Oct 2023 12:46:35 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Reinette Chatre cc: linux-kselftest@vger.kernel.org, Shuah Khan , =?ISO-8859-15?Q?Maciej_Wiecz=F3r-Retman?= , Shaopeng Tan , LKML , stable@vger.kernel.org Subject: Re: [PATCH v3 1/7] selftests/resctrl: Fix uninitialized .sa_flags In-Reply-To: <0df7f82d-de3b-3e51-ffc1-5aa4e23db62a@intel.com> Message-ID: <545ef67c-4ca2-9a2-381a-991fda391e8e@linux.intel.com> References: <20230929112039.7488-1-ilpo.jarvinen@linux.intel.com> <20230929112039.7488-2-ilpo.jarvinen@linux.intel.com> <0df7f82d-de3b-3e51-ffc1-5aa4e23db62a@intel.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-889719702-1696239999=:2459" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 02 Oct 2023 02:47:04 -0700 (PDT) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-889719702-1696239999=:2459 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Fri, 29 Sep 2023, Reinette Chatre wrote: > Hi Ilpo, > > On 9/29/2023 4:20 AM, Ilpo Järvinen wrote: > > signal_handler_unregister() calls sigaction() with uninitializing > > sa_flags in the struct sigaction. > > > > Make sure sa_flags is always initialized in signal_handler_unregister() > > by initializing the struct sigaction when declaring it. > > > > Fixes: 73c55fa5ab55 (selftests/resctrl: Commonize the signal handler register/unregister for all tests) > > Please place the title line in quotes (checkpatch warning). Thanks. I hadn't realize the quotes vanished without an error when I removed the escape from " char in gitconfig alias (I have just migrated to use alias instead of a custom tool). > > Suggested-by: Reinette Chatre > > Signed-off-by: Ilpo Järvinen > > Cc: > > --- > > tools/testing/selftests/resctrl/resctrl_val.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c > > index 51963a6f2186..1e8b90077218 100644 > > --- a/tools/testing/selftests/resctrl/resctrl_val.c > > +++ b/tools/testing/selftests/resctrl/resctrl_val.c > > @@ -504,7 +504,7 @@ int signal_handler_register(void) > > */ > > void signal_handler_unregister(void) > > { > > - struct sigaction sigact; > > + struct sigaction sigact = {}; > > > > sigact.sa_handler = SIG_DFL; > > sigemptyset(&sigact.sa_mask); > > Could you please add this initialization to signal_handler_register() > also? I understand that the particular issue of sa_flags is not > relevant to that function but there are other uninitialized fields. > I think initializing the struct makes the code more robust without > needing to reason/understand glibc behavior. Okay, I'll do that and add a note into the changelog that then correctness is obvious from the code itself. -- i. --8323329-889719702-1696239999=:2459--