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]
Message-ID: <CAKgT0UeB-cQ_QAmwqLD+QsHOSy27XoayoL1qss_eBkAtvQk=pw@mail.gmail.com>
Date:	Fri, 10 Jun 2016 14:35:39 -0700
From:	Alexander Duyck <alexander.duyck@...il.com>
To:	Hannes Frederic Sowa <hannes@...essinduktion.org>
Cc:	Netdev <netdev@...r.kernel.org>, Jesse Gross <jesse@...nel.org>,
	Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
	Jesse Brandeburg <jesse.brandeburg@...el.com>,
	Shannon Nelson <shannon.nelson@...el.com>,
	Carolyn Wyborny <carolyn.wyborny@...el.com>,
	Don Skidmore <donald.c.skidmore@...el.com>,
	Bruce Allan <bruce.w.allan@...el.com>,
	John Ronciak <john.ronciak@...el.com>,
	Mitch Williams <mitch.a.williams@...el.com>
Subject: Re: [PATCH net-next 4/7] ixgbe: protect vxlan_get_rx_port in
 ixgbe_service_task with rtnl_lock

On Mon, Apr 18, 2016 at 12:19 PM, Hannes Frederic Sowa
<hannes@...essinduktion.org> wrote:
> vxlan_get_rx_port requires rtnl_lock to be held.
>
> Cc: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
> Cc: Jesse Brandeburg <jesse.brandeburg@...el.com>
> Cc: Shannon Nelson <shannon.nelson@...el.com>
> Cc: Carolyn Wyborny <carolyn.wyborny@...el.com>
> Cc: Don Skidmore <donald.c.skidmore@...el.com>
> Cc: Bruce Allan <bruce.w.allan@...el.com>
> Cc: John Ronciak <john.ronciak@...el.com>
> Cc: Mitch Williams <mitch.a.williams@...el.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@...essinduktion.org>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index 2976df77bf14f5..b2f2cf40f06a87 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -7192,10 +7192,12 @@ static void ixgbe_service_task(struct work_struct *work)
>                 return;
>         }
>  #ifdef CONFIG_IXGBE_VXLAN
> +       rtnl_lock();
>         if (adapter->flags2 & IXGBE_FLAG2_VXLAN_REREG_NEEDED) {
>                 adapter->flags2 &= ~IXGBE_FLAG2_VXLAN_REREG_NEEDED;
>                 vxlan_get_rx_port(adapter->netdev);
>         }
> +       rtnl_unlock();
>  #endif /* CONFIG_IXGBE_VXLAN */
>         ixgbe_reset_subtask(adapter);
>         ixgbe_phy_interrupt_subtask(adapter);
> --
> 2.5.5
>

Would it be possible to only take the lock inside of the conditional
statement?  There isn't really any need to be holding the rtnl_lock to
check the adapter flag.

- Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ