linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: void0red <void0red@gmail.com>
Cc: angelogioacchino.delregno@collabora.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, kvalo@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-wireless@vger.kernel.org, lorenzo@kernel.org,
	matthias.bgg@gmail.com, nbd@nbd.name, netdev@vger.kernel.org,
	pabeni@redhat.com, ryder.lee@mediatek.com,
	sean.wang@mediatek.com, shayne.chen@mediatek.com
Subject: Re: [PATCH v2] wifi: mt76: add a check of vzalloc in mt7615_coredump_work
Date: Mon, 27 Feb 2023 15:06:58 +0100	[thread overview]
Message-ID: <Y/y5Asxw3T3m4jCw@lore-desk> (raw)
In-Reply-To: <20230227135241.947052-1-void0red@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1082 bytes --]

> From: Kang Chen <void0red@gmail.com>
> 
> vzalloc may fails, dump might be null and will cause
> illegal address access later.
> 
> Fixes: d2bf7959d9c0 ("mt76: mt7663: introduce coredump support")
> Signed-off-by: Kang Chen <void0red@gmail.com>
> ---
> v2 -> v1: add Fixes tag
> 
>  drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
> index a95602473..73d84c301 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
> @@ -2367,6 +2367,9 @@ void mt7615_coredump_work(struct work_struct *work)
>  	}
>  
>  	dump = vzalloc(MT76_CONNAC_COREDUMP_SZ);
> +	if (!dump)
> +		return;
> +
>  	data = dump;
>  
>  	while (true) {
> -- 
> 2.34.1
> 

revieweing the code I guess the right approach would be the one used in
mt7921_coredump_work():
- free pending skbs
- not run dev_coredumpv()

What do you think?

Regards,
Lorenzo

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-02-27 14:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 11:57 [PATCH] wifi: mt76: add a check of vzalloc in mt7615_coredump_work Kang Chen
2023-02-27 13:33 ` Lorenzo Bianconi
2023-02-27 13:52   ` [PATCH v2] " void0red
2023-02-27 14:06     ` Lorenzo Bianconi [this message]
2023-02-27 14:28       ` Kang Chen
2023-02-27 14:48       ` [PATCH v3] wifi: mt76: handle failure " void0red
2023-03-06 11:00         ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y/y5Asxw3T3m4jCw@lore-desk \
    --to=lorenzo.bianconi@redhat.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ryder.lee@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shayne.chen@mediatek.com \
    --cc=void0red@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).