From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5112B51588D; Wed, 30 Sep 2026 17:29:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790789361; cv=none; b=r0QlI9jHHHF0DrFZA0miT7gO4YP5qonvHMdLdrSLKgRsEPI5Um+Zs5Owhz5JdbP/9UZosQiGQxfO2IrdHPsa5ysQsUrprVu0kMVhu153pSYh9nWDDvEklj1Q2mdvVMLW9J7oe0lw6VWcHk/OtNfRWjf+jLqB8SmxUo1GwGY5HoA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790789361; c=relaxed/simple; bh=jwva6Am5dCq0mpYZ+wyB4/G/XYtU3LPCljqEBAxmfjk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J+MaLBdvm4ABaNo1B+pjNX+nN9Sshie3WZQ11EpbHre/XAwSKQT1vTdYzWeD6Q6/GKFOhW6nxHxvdsT3BxsyJtAKrjE4l42cG0+HeSer5ZsnjEazDB5JbWl/5LhopTaMLv7q4icik1hPlA3sPBe5ehPv7ux2MMKSyh7TmwaskE0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TiZ7VKCK; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="TiZ7VKCK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABD6B1F000FF; Wed, 30 Sep 2026 17:29:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790789360; bh=Ku/fG4n3ttvvDh5xnzuNA175Wpu9a/nptJKLmB6vk7M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TiZ7VKCKs/VmFY08TYQJEIdwRzb+SvaBMUa5e+j3qKlt2ZYzeJ9Bj1OCfm0TajuIi IvUuLz9V6DDH/p3tAk+f/hFmAMz1yUUDNHvCKWKp9ca4EcqWvrF6addHBZTPz2e5l3 yvWzn1EfEHxBf2i9Uz+z/IkYPOC6KZBNiu3HOdrE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Chaithanya Lagisetty , Hangbin Liu , David Heidelberg , Sasha Levin Subject: [PATCH 6.12 406/877] selftests: nci: Fix uninitialized family ID on missing attribute Date: Wed, 30 Sep 2026 17:21:57 +0200 Message-ID: <20260930152423.455464279@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152414.738996857@linuxfoundation.org> References: <20260930152414.738996857@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chaithanya Lagisetty [ Upstream commit eda518d2cdb6074a0bcdfa06af291616bcb5c421 ] get_family_id() walks the generic netlink CTRL_CMD_GETFAMILY reply looking for the CTRL_ATTR_FAMILY_ID attribute and returns the parsed value in the local variable "id". If the reply does not carry that attribute, the parsing loop never assigns "id" and the function returns an indeterminate stack value, which the caller stores in self->fid and uses for subsequent netlink requests. Initialize "id" to 0 so a missing attribute yields a deterministic (invalid) family ID instead of a garbage value. Fixes: f595cf1242f3 ("selftests: Add nci suite") Signed-off-by: Chaithanya Lagisetty Reviewed-by: Hangbin Liu Link: https://patch.msgid.link/20260901070618.3299012-1-nagachaithanya9911@gmail.com Signed-off-by: David Heidelberg Signed-off-by: Sasha Levin --- tools/testing/selftests/nci/nci_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nci/nci_dev.c b/tools/testing/selftests/nci/nci_dev.c index 2fae9ea352c87..2a96ca0a9fb1b 100644 --- a/tools/testing/selftests/nci/nci_dev.c +++ b/tools/testing/selftests/nci/nci_dev.c @@ -182,7 +182,7 @@ static int get_family_id(int sd, __u32 pid, __u32 *event_group) } ans; struct nlattr *na; int resp_len; - __u16 id; + __u16 id = 0; int len; int rc; -- 2.53.0