Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2061736rwl; Thu, 13 Apr 2023 00:46:02 -0700 (PDT) X-Google-Smtp-Source: AKy350alF+OyJh+EqnT+/Nm3TKGYJBcbCn5S9yrBGxlBwN7SdJFG6lQZxPEwmhoUwgmG6gPOME+P X-Received: by 2002:a17:906:2694:b0:925:1d1d:6825 with SMTP id t20-20020a170906269400b009251d1d6825mr1571346ejc.42.1681371962071; Thu, 13 Apr 2023 00:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681371962; cv=none; d=google.com; s=arc-20160816; b=E4YMXXeQSuboK6c+w4uIYiywUHANWJhFVphIsWhn/nXfJQfJZNI2zBuTWKbq2U/4HO XOuMfZtWtQRa3wehDB9dwrpXzK+KaVeyDBbfEk5CL8xun0+tWEQT+SzUAur53yo4LEDH nEjsaa7rWNJgbbIysqbFmjcOowKSnip1OUxmcUnowK6AKXj2utwIj2ViS/JTTA6T9qFc 88b2PFRopDsz1kslY81dmCDCTRpxBg/gnW1CPh+JqNvUmRWA1HU8OzzH9vj+f9XmDMHP Jdt5MqTcLPwOxmEgR0dzR9Uo99PizzKg6TDdmGFw9WMOYfl9d62Uzkh5CnhvfAXVx+jQ 7WyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xNLr6Xu2Be1BHv83kxReJyuFS+EUlu8w46ePnkCXWkw=; b=T756bADsfMjMDOWHLQ+wz0nvWFpLswYMV8D8e+RRBJjvJ9WN0263NiHpVO2HVbY0PK VhqeoU1FTgWw/6rnZEpWfT+8S0WfxppCWsXvOF7jmGFNVhQxr9NhwseXOTGwbeLhzC34 T0SeAIFV0MKk56g2D9kSiksGYCKtRONCcE3WG3uzki8cqMLQIAHYdmsqGX8/HjqxaOMS edwEZzwF2u/13pNg2RK05c2eYHHLQcsF9t3w0YV5ecLWwVSNRb9/K8Yde+jkBetZ1Zcm AZ7L0DWjkNKo5lpsIj426Ho59Bge7eX55POliC/WvtTaD7+m+MpoeiPzPARfdq44pEDe CpuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ag60Xpzb; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gk4-20020a17090790c400b00945552ee129si1213916ejb.616.2023.04.13.00.45.43; Thu, 13 Apr 2023 00:46:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@intel.com header.s=Intel header.b=Ag60Xpzb; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230017AbjDMHpQ (ORCPT + 61 others); Thu, 13 Apr 2023 03:45:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbjDMHpO (ORCPT ); Thu, 13 Apr 2023 03:45:14 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F97283FF for ; Thu, 13 Apr 2023 00:45:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681371911; x=1712907911; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kq3HXqD5fExKDlXAvCQVE/+fPL5rctbLUqA+QeKS77M=; b=Ag60XpzbtC+b+XOvt8SgxwmZ6Aw17ePVwa5XRk/wMGE+ve9/xCoq3PW7 2oiRM/d+WR4YEEJxWKLnibeRQpjjRJvvOreyauzOdnh3581GcnHo9Jdw3 +BCs9odk1PhaYlbx2tdraIzfaIIphtcpgaPX8Op1AM29961wk0FTL7+qP 5QzD0uWgbZ//gGEW5V8PP3qif0xCi8vDk0DrL3is1qp7lQ7e2APjbhP+Q 9V64FNS/ZcnQ9z5lbQFsD94ebTc5oDGQP/toqiG2V4MbrrvP896s7sUga CIR63tW4OGdEMlmbvBjZ76DyYVQgxcY6q11qrVqlNjjItAV8RRqlP0LtE g==; X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="323735921" X-IronPort-AV: E=Sophos;i="5.98,341,1673942400"; d="scan'208";a="323735921" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2023 00:45:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="833034674" X-IronPort-AV: E=Sophos;i="5.98,341,1673942400"; d="scan'208";a="833034674" Received: from apeled2-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.lan) ([10.251.184.75]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2023 00:45:09 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 01/15] wifi: iwlwifi: debug: fix crash in __iwl_err() Date: Thu, 13 Apr 2023 10:44:01 +0300 Message-Id: <20230413102635.e27134c6bcd4.Ib3894cd2ba7a5ad5e75912a7634f146ceaa569e2@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230413074415.1054160-1-gregory.greenman@intel.com> References: <20230413074415.1054160-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED 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-wireless@vger.kernel.org From: Johannes Berg In __iwl_err(), if we rate-limit the message away, then vaf.va is still NULL-initialized by the time we get to the tracing code, which then crashes. When it doesn't get rate-limited out, it's still wrong to reuse the old args2 that was already printed, which is why we bother making a copy in the first place. Assign vaf.va properly to fix this. Fixes: e5f1cc98cc1b ("iwlwifi: allow rate-limited error messages") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/iwl-debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-debug.c b/drivers/net/wireless/intel/iwlwifi/iwl-debug.c index ae4c2a3d63d5..3a3c13a41fc6 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-debug.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-debug.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* - * Copyright (C) 2005-2011, 2021 Intel Corporation + * Copyright (C) 2005-2011, 2021-2022 Intel Corporation */ #include #include @@ -57,6 +57,7 @@ void __iwl_err(struct device *dev, enum iwl_err_mode mode, const char *fmt, ...) default: break; } + vaf.va = &args; trace_iwlwifi_err(&vaf); va_end(args); } -- 2.38.1