Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4582114pxj; Wed, 12 May 2021 08:38:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhTV4phJku7pD0w39TzGX3JUOruQLmj+kv5+6ZvV/KeOaWFb5zIxVZoXzAeqqjXmOkO7ij X-Received: by 2002:a05:6402:378:: with SMTP id s24mr9450825edw.164.1620833904903; Wed, 12 May 2021 08:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620833904; cv=none; d=google.com; s=arc-20160816; b=hfGOeXXv+yKw7TLRBymIVogwrYrd75yQq7Md8U5faeVCpkH6Bn7/4UhKi7edjnQzpf NWZV7BseNJD72VYc6Am7qJKHQphndbb64vkBukCXufbav8WaPL8FDpmvyDTy+Dx0uAg6 ARb0aEVW2L4ZdWSrH4hKzNS+iBJ6H20Pq8kGfC90z7iYjm+jEYnmQvax0I4ch4xxlUwF R7WUg+b2SOobbiSs+7dyLBOdnJmTkjx5rGQ+TcZ2fRhMnH6r8DBeg2rUs4sZuViqReim o48z44E6wdEV1fM4QLT45rKAlq2PnAlIHfx9Wb/4azScORLo077R3tNONs+8S1uoLRJ4 NlNA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fV2uYRJGy17JoOKmE3Y+MslJHI0DRYPLto4Sb0Ca8bU=; b=s9koX1ru0mK6WYnGs0nNI0fSTh8gJFlGV0QL93pTCkCvz/Den8GMEOsxHjvxlBXGzJ j9ah+yXhgk0PKPNsDLGCbx47v0BXrjtMGWGs8eY1xHeONpOyQSy+TEKoduJH2hsSQh2s PSuk5Ys37UmPWGVzqBh27QDQg/XuiJ4nVVBDYizcX9MlqJT0XjnA4D9NEuj7Ce8FvCK0 g+zLBwI0bvCiANb82fHwGw5qf6L/nelbIuo4663oOneiIn48fgUTu9JTbP17EQcFMN6J Dhhr3NlTGWtzp4FYY/BAM4NHsAZZgo9C+ZybaHEl5Kv2nc00PcX9VNbmuwAA9J6HWdWN lWQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ibsZMS6Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si23150edk.420.2021.05.12.08.38.01; Wed, 12 May 2021 08:38:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ibsZMS6Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236114AbhELPhE (ORCPT + 99 others); Wed, 12 May 2021 11:37:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:50230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233880AbhELPPU (ORCPT ); Wed, 12 May 2021 11:15:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 02CBD61457; Wed, 12 May 2021 15:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620831892; bh=9rxD0KXRvMQeIDDku1o8NgLrHq3G4M/dCwx147CEUWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ibsZMS6ZvbOut5wAZLqdrWDuA7eL5EydroDEKt1abVFa+btW689DcMCWMkr2amB8s iYZ2e6HNehrJ67RrBrSPb996bmGCJkNVhM7aBk+84YNmcdnuZZQa9NBPclnX89L7jB pCiBoCfNWlpfRoPeRf9n6jRfUYTV9NA20wrerl1Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Fietkau Subject: [PATCH 5.10 057/530] mt76: fix potential DMA mapping leak Date: Wed, 12 May 2021 16:42:47 +0200 Message-Id: <20210512144821.605251052@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Felix Fietkau commit b4403cee6400c5f679e9c4a82b91d61aa961eccf upstream. With buf uninitialized in mt76_dma_tx_queue_skb_raw, its field skip_unmap could potentially inherit a non-zero value from stack garbage. If this happens, it will cause DMA mappings for MCU command frames to not be unmapped after completion Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915") Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/mediatek/mt76/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -318,7 +318,7 @@ mt76_dma_tx_queue_skb_raw(struct mt76_de struct sk_buff *skb, u32 tx_info) { struct mt76_queue *q = dev->q_tx[qid]; - struct mt76_queue_buf buf; + struct mt76_queue_buf buf = {}; dma_addr_t addr; if (q->queued + 1 >= q->ndesc - 1)