netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Samuel Mendoza-Jonas <sam@mendozajonas.com>, netdev@vger.kernel.org
Cc: "David S . Miller" <davem@davemloft.net>,
	linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org
Subject: Re: [PATCH net-next] net/ncsi: Avoid GFP_KERNEL in response handler
Date: Thu, 31 May 2018 04:50:21 -0400	[thread overview]
Message-ID: <69fcb143-00a2-2ddf-e2d4-c692b650f292@gmail.com> (raw)
In-Reply-To: <20180531070254.28878-1-sam@mendozajonas.com>



On 05/31/2018 03:02 AM, Samuel Mendoza-Jonas wrote:
> ncsi_rsp_handler_gc() allocates the filter arrays using GFP_KERNEL in
> softirq context, causing the below backtrace. This allocation is only a
> few dozen bytes during probing so allocate with GFP_ATOMIC instead.
> 

Hi Samuel

You forgot to add

Fixes: 062b3e1b6d4f ("net/ncsi: Refactor MAC, VLAN filters")

size = (rsp->uc_cnt + rsp->mc_cnt + rsp->mixed_cnt) * ETH_ALEN;

-> seems to be able to reach more than few dozen bytes...

Also, what prevents ncsi_rsp_handler_gc() to be called multiples times ?

nc->mac_filter.addrs & nc->vlan_filter.vids would be re-allocated and memory would leak.

  reply	other threads:[~2018-05-31  8:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31  7:02 [PATCH net-next] net/ncsi: Avoid GFP_KERNEL in response handler Samuel Mendoza-Jonas
2018-05-31  8:50 ` Eric Dumazet [this message]
2018-06-01  0:33   ` Samuel Mendoza-Jonas
2018-06-03 14:42 ` David Miller

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=69fcb143-00a2-2ddf-e2d4-c692b650f292@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=sam@mendozajonas.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).