From patchwork Mon Sep 25 15:18:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 13397979 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FE06CE7A95 for ; Mon, 25 Sep 2023 15:19:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232482AbjIYPTM (ORCPT ); Mon, 25 Sep 2023 11:19:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230076AbjIYPTM (ORCPT ); Mon, 25 Sep 2023 11:19:12 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB38DA3 for ; Mon, 25 Sep 2023 08:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=/6TYy6I6K8Bq0h95Y7pqoBhUzgfdAQ2JhZ0FVJF4FQo=; t=1695655145; x=1696864745; b=WL49cve8UC67UQLQfGw49mlvPYw7g0wPrC5HHyUrhX/QHWcylWuFX0iQewVDs/1FXEvi6+Bf16U I+RldtbDQqgajz87IrFg68E0rrEkV5/0BqN8q5pPXyOUuRyLhGlADQHlpdMJgjP0nhrCpIe7JM2U3 Q8PY5j8z95bTBlFDt02RRKEOMetKZ3FStYCUa9UdC6+uKf+kHviHD6SngGy943tRCAld3i+mGYyH0 q0OmZJwXEQvle3YOpuCyPIG3o9JzIsin/xhRfkF5ZhBSlghkXU5Hu3vxmRGFq1c3Ke7JLtVmTvX74 7NNO8T1GFpBUrWa3Gns79O1H8ZI8wvUcIaHA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1qknMU-003kP0-11; Mon, 25 Sep 2023 17:19:02 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Benjamin Berg Subject: [PATCH] wifi: cfg80211: avoid leaking stack data into trace Date: Mon, 25 Sep 2023 17:18:56 +0200 Message-ID: <20230925171855.a9271ef53b05.I8180bae663984c91a3e036b87f36a640ba409817@changeid> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Benjamin Berg If the structure is not initialized then boolean types might be copied into the tracing data without being initialised. This causes data from the stack to leak into the trace and also triggers a UBSAN failure which can easily be avoided here. Signed-off-by: Benjamin Berg Signed-off-by: Johannes Berg --- net/wireless/nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 87b21c0c0f25..a680a00b16e1 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -8458,7 +8458,7 @@ static int nl80211_update_mesh_config(struct sk_buff *skb, struct cfg80211_registered_device *rdev = info->user_ptr[0]; struct net_device *dev = info->user_ptr[1]; struct wireless_dev *wdev = dev->ieee80211_ptr; - struct mesh_config cfg; + struct mesh_config cfg = {}; u32 mask; int err;