Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1098606pxb; Fri, 26 Feb 2021 02:28:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzri2S7DXttJ+tTn9gi2Qy2VWX5pfKJSzNV4Z1zj96WSJnobYaU4fNMQlS+zE0PesML47J4 X-Received: by 2002:a17:907:6005:: with SMTP id fs5mr2276324ejc.184.1614335293967; Fri, 26 Feb 2021 02:28:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614335293; cv=none; d=google.com; s=arc-20160816; b=sFoy0Ij3rzwsCOvzPWbr78EWdUeK7SyLdfSmIH3+QUcy2ojVYlWvvJJgSBcqOQgovo 547IrXYJSZvtCoXUMRHuPAgffMOZELlDkgWlN5oOzYMyN2O9mOkRNHJo+ECqi0z02HIZ MmA1uNfjNL5CTDz9AvhMDKRvUwo9b5VtJqb2d90++GzeNxY/fjgwGKx267AzrZd9mr3j sFrsVpjYoGb1IEKAIh1fbxmmuyZ8vUF5zStaebCd63mrpaAcf2BpGWiIO5+d9aIc/k1E 3tCUDfHyaYob5zmj8W+DvdS5ShohZ47gPzAwVcdtyfeNF7lVh+Hr7kFvrEysrL4HuJT9 kACw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=GWxapydL5Hv7WpyDHAdOmUhYs2nLQBMtVYpkmlSW5HU=; b=ec1DhBoqKQt4Vj8ft6YxUXDLYNq64AeNvrIWyls8tmtJMhbtPsGjjHfGR7h1c2YWsK qrk6UgPXeKzQwZ2JEkp6S0X7yQNyZFd3c59gKFA+nC1RmiSxqdj5gTgbUgPZAyANwnFV gqNA1yFCSK9Ip7YslSIljs/wao1RpJ4kv1cOYPwcZujSAAuf5R3xzuwjHuPkDUIDxO4e h1FUcSmioNqciRX/aJwdjbSZH464Mw37E1ZPEojptuY/MgD6ScOdr38mrxeKHc+g/qjJ 6KRji6A3X1/zWCy0PYgJPTzEHRXn3igKsihxqmkwFdU6MSu5DBN7Ja++WZsR2/dKuN4b uwuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="jLUg/DSF"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si5215977eju.695.2021.02.26.02.27.34; Fri, 26 Feb 2021 02:28:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=@redhat.com header.s=mimecast20190719 header.b="jLUg/DSF"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230210AbhBZK0Z (ORCPT + 99 others); Fri, 26 Feb 2021 05:26:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23806 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230140AbhBZK0X (ORCPT ); Fri, 26 Feb 2021 05:26:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614335096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GWxapydL5Hv7WpyDHAdOmUhYs2nLQBMtVYpkmlSW5HU=; b=jLUg/DSFNZJJowFgazowec7rp/H/RWnixrXvzhql+kciTVLlwDs+kKVziBlbSaaxatlK5l 5qgLpvm1S/24ZFb+0shSIN8VDDMxzoYkh+/2wcYlzswLFYzJTWgOK3Qlgb6sv2w5lugYrv GrVXuf4hAayiT0JBxLx75bpS23xB6Lk= Received: from mail-yb1-f198.google.com (mail-yb1-f198.google.com [209.85.219.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-510-YomJRXfnPGmqI0-Yu-6Tqw-1; Fri, 26 Feb 2021 05:24:55 -0500 X-MC-Unique: YomJRXfnPGmqI0-Yu-6Tqw-1 Received: by mail-yb1-f198.google.com with SMTP id q77so9657181ybq.0 for ; Fri, 26 Feb 2021 02:24:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GWxapydL5Hv7WpyDHAdOmUhYs2nLQBMtVYpkmlSW5HU=; b=B2phfUB0WSGWAR38QC/A8l6QiBQ6572HxC0HcLKQoR++cJE6Lm6ZtRe0AFIxdCRBbk dIcbCnhS2SVogeivbpITA28p/jC/F21bUzBLnCmhMV2mBtJ5xbba3SHTZPcrvL3iD1Lj q8meX0McEVjpPWGWM22nQcS65xYUlbt2tHkf7I7hye+E6Oovhed5e5C5SjKAwchAtdK8 uyUWCjdhN2u6wTKPwgMD2nGIn+kzU9C0H7PJK2ETBIecmubfKZwoo3Qi9H+ue3K9xLaF LUST/Vo3B2p660fwPRFjoqoL75nkl+RTOGqzRzd0BqDAGZ4HX9aaU0da8uNELmWxkOob 9aFA== X-Gm-Message-State: AOAM530ymfjfCsEqOnNr171PK4lEjFvpQIGQpPA6WbETWTWJc3CYxl0k 0t2O28h4Duc9JU0q2H4jG9B1hzXHsPbpGJMHmvyHtngp+Z6Jd1jczGGwzSKNiNrkVVUcmOCaitU juqyPovzqnjMViWj4Lu6+MF5ronbzFGiFIjkICaVRi98= X-Received: by 2002:a25:250e:: with SMTP id l14mr3567100ybl.43.1614335094509; Fri, 26 Feb 2021 02:24:54 -0800 (PST) X-Received: by 2002:a25:250e:: with SMTP id l14mr3567072ybl.43.1614335094195; Fri, 26 Feb 2021 02:24:54 -0800 (PST) MIME-Version: 1.0 References: <87mtwfkr6u.fsf@tynnyri.adurom.net> <20210208082516.GB2593@lore-desk> <87im735593.fsf@codeaurora.org> <20210208112035.GD2593@lore-desk> <87a6se667c.fsf@codeaurora.org> In-Reply-To: <87a6se667c.fsf@codeaurora.org> From: Lorenzo Bianconi Date: Fri, 26 Feb 2021 11:24:43 +0100 Message-ID: Subject: Re: [PATCH wireless-drivers] mt76: dma: do not report truncated frames to mac80211 To: Kalle Valo Cc: Lorenzo Bianconi , linux-wireless , Jakub Kicinski , Felix Fietkau Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > > Lorenzo Bianconi writes: > > >> Lorenzo Bianconi writes: > >> > >> >> Lorenzo Bianconi writes: > >> >> > >> >> > If the fragment is discarded in mt76_add_fragment() since shared_info > >> >> > frag array is full, discard truncated frames and do not forward them to > >> >> > mac80211. > >> >> > > >> >> > Signed-off-by: Lorenzo Bianconi > >> >> > >> >> Should there be a Fixes line? I can add it. > >> > > >> > I am not sure it needs a Fixes tag. > >> > >> I think the commit log should have some kind of description about the > >> background of the issue, for example if this is a recent regression or > >> has been there forever etc. > > > > Agree. Can you please check the commit log below? > > > > " > > Commit 'b102f0c522cf6 ("mt76: fix array overflow on receiving too many > > fragments for a packet")' fixes a possible OOB access but it introduces a > > memory leak since the pending frame is not released to page_frag_cache if > > the frag array of skb_shared_info is full. > > Commit '93a1d4791c10 ("mt76: dma: fix a possible memory leak in > > mt76_add_fragment()")' fixes the issue but does not free the truncated skb that > > is forwarded to mac80211 layer. Fix the leftover issue discarding even truncated > > skbs. > > " > > Looks good, but I think the recommended style for commit ids is not to > use ' chararacter. So I would change it to this: > > ---------------------------------------------------------------------- > Commit b102f0c522cf6 ("mt76: fix array overflow on receiving too many > fragments for a packet") fixes a possible OOB access but it introduces a > memory leak since the pending frame is not released to page_frag_cache > if the frag array of skb_shared_info is full. Commit 93a1d4791c10 > ("mt76: dma: fix a possible memory leak in mt76_add_fragment()") fixes > the issue but does not free the truncated skb that is forwarded to > mac80211 layer. Fix the leftover issue discarding even truncated skbs. > ---------------------------------------------------------------------- > > Should I add that to the commit log and queue the patch to be applied > after the merge window opens? > > -- > https://patchwork.kernel.org/project/linux-wireless/list/ > > https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches > Hi Kalle, any news about this patch? Regards, Lorenzo