lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 17 May 2019 11:33:41 +0200
From:   Pavel Machek <pavel@...x.de>
To:     Claudiu Manoil <claudiu.manoil@....com>
Cc:     Pavel Machek <pavel@...x.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Sasha Levin <sashal@...nel.org>,
        "alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>
Subject: Re: [PATCH 4.19 042/113] ocelot: Dont sleep in atomic context
 (irqs_disabled())

Hi!

> >On Wed 2019-05-15 12:55:33, Greg Kroah-Hartman wrote:
> >> [ Upstream commit a8fd48b50deaa20808bbf0f6685f6f1acba6a64c ]
> >>
> >> Preemption disabled at:
> >>  [<ffff000008cabd54>] dev_set_rx_mode+0x1c/0x38
> >>  Call trace:
> >>  [<ffff00000808a5c0>] dump_backtrace+0x0/0x3d0
> >>  [<ffff00000808a9a4>] show_stack+0x14/0x20
> >>  [<ffff000008e6c0c0>] dump_stack+0xac/0xe4
> >>  [<ffff0000080fe76c>] ___might_sleep+0x164/0x238
> >>  [<ffff0000080fe890>] __might_sleep+0x50/0x88
> >>  [<ffff0000082261e4>] kmem_cache_alloc+0x17c/0x1d0
> >>  [<ffff000000ea0ae8>] ocelot_set_rx_mode+0x108/0x188
> >[mscc_ocelot_common]
> >>  [<ffff000008cabcf0>] __dev_set_rx_mode+0x58/0xa0
> >>  [<ffff000008cabd5c>] dev_set_rx_mode+0x24/0x38
> >>
> >> Fixes: a556c76adc05 ("net: mscc: Add initial Ocelot switch support")
> >
> >Is it right fix? Warning is gone, but now allocation is more likely to
> >fail, causing mc_add() to fail under memory pressure.
> >
> 
> So far this contributes to fixing a kernel hang issue, seen occasionally
> when the switch interfaces were brought up.
> Other than that I would look into improving this code.
> It looks suboptimal at least.  Do we really need to allocate whole
> struct netdev_hw_addr elements? Can the allocation size be reduced?
> What about pre-allocating enough room for ha elements outside the
> atomic context (set_rx_mode() in this case)?

Pre-allocating the elements sounds like a obvious solution, yes.

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ