From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755060AbcFGKeN (ORCPT ); Tue, 7 Jun 2016 06:34:13 -0400 Received: from mail.ispras.ru ([83.149.199.45]:56070 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753980AbcFGKeM (ORCPT ); Tue, 7 Jun 2016 06:34:12 -0400 Message-ID: <57569424.9040906@ispras.ru> Date: Tue, 07 Jun 2016 13:30:12 +0400 From: Pavel Andrianov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Kalle Valo CC: libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, vaishali.thakkar@oracle.com, LDV list Subject: [ldv-project] [net] libertas: potential race condition Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! There is a potential race condition in drivers/net/wireless/libertas/libertas.ko. In the function lbs_hard_start_xmit(..), line 159, a socket buffer is written to priv->current_skb with a spin_lock protection. In the function lbs_mac_event_disconnected(..), lines 50-51, the field current_skb is cleaned. There is no protection used. The corresponding handlers are activated at the same time in lbs_start_card(..) and then may be executed simultaneously. Note, there are two structures lbs_netdev_ops and mesh_netdev_ops, which have the target handler lbs_hard_start_xmit. Is it a real race or I have missed something? -- Pavel Andrianov Linux Verification Center, ISPRAS web: http://linuxtesting.org e-mail: andrianov@ispras.ru