From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f69.google.com (mail-oa1-f69.google.com [209.85.160.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F10293ECBEB for ; Tue, 7 Jul 2026 12:54:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783428843; cv=none; b=dbO+IJtIJpzlnWug+d6qL6EyCqidKGWACsTRe0cBxhQQpTDZCXIX6HSJOjI1gjOP7FPoumo1F6uhFo+udV0tEHNdGqI/fA/VZVmNuggKPuy4v6ORvBWolgWwbS3Pt10tI4kvmaQaCbu7rHDI1nAvJj4DXlrekuKv3eUfCFt1K94= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783428843; c=relaxed/simple; bh=QZXuA+MAEg4TP5BuD6FSu/ldU7iD1+d0BiIUNWdbZQo=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=e9+fX4aIjWWqAU51i6wT274ILuuMs7UYTeDo+ZdYT7EYbLG2j6la+1PeTpJdd6OmtiFQfGQOIhz3zWN1UQQem3wTeVU1D5wAGVX2wkHtaGfGxCyZxHiF7gczNlt4GWtpuSX4gO4jEyWSZfaSZ9p6owdlosYKjtIpB3HOLfAVFE8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.160.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oa1-f69.google.com with SMTP id 586e51a60fabf-43b6de00772so1993690fac.2 for ; Tue, 07 Jul 2026 05:54:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783428841; x=1784033641; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pSFxO8FL+zC4r4rcBaCD1F9d4rlrtSPih5sI9zB6abI=; b=rf3WM7OP3ZEO/LTDMk/t09WXiFwkcd7sGRETj9NrpYCBxgg6V+vGVFLFFfh3EyvvHI uLZTconnIWp9cuYZAebqYG6vL7qB1mBIYzAogyoPtIaLyQnsc/4WA12EYftM18yvcLld Uq4ktJTRyjk7RJJ0+RbOTD8tzkVZJbAqw2Fo8fEVuINhkde7dFbL6+Yk9Brv5Rt/qeVP oQw6oXiFEYaXWaSFkkZwpq0u5XbYrqpdp1XRBLfemNfDIA/Xc+WE3TukEas+sYPEej/z CCODXqFaDaOkrzuaI+03wBmOkfR4a+CGmifMKTstqEdjp/jnwUwwHxowov02ZMIvZhJ2 MOmQ== X-Gm-Message-State: AOJu0Yw1mHh+Ta3G5fW46o600xsVEqq0o4b8inn9yGskp0+SW/ToLO2m 4VMc0fI79+j8ac3mgMpSZowp046zC8FsNGadGwcT6bObJOOyjJClPG4FWgxZFSEEK3dLKkvflC4 locCr4iZLQMfE4y9VTQk8AkEOnKvCFnzgmyrKHAXRvjS1DdOy+4SkufMqEyM= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6808:3a0f:b0:49a:72a:4e61 with SMTP id 5614622812f47-49fdef13ec0mr3685392b6e.42.1783428841032; Tue, 07 Jul 2026 05:54:01 -0700 (PDT) Date: Tue, 07 Jul 2026 05:54:01 -0700 In-Reply-To: <6a489e31.b42ede87.8bd1.0009.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a4cf6e9.c76b52dc.34afef.000a.GAE@google.com> Subject: Forwarded: [PATCH] carl9170: fix locking in carl9170_get_queued_skb From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] carl9170: fix locking in carl9170_get_queued_skb Author: malayarout91@gmail.com Please test the following patch. #syz test The carl9170_get_queued_skb function uses spin_lock_bh/spin_unlock_bh, but it's called from carl9170_usb_rx_irq_complete, which is a USB URB completion handler running in interrupt context. The call path is: carl9170_usb_rx_irq_complete (IRQ context) -> carl9170_handle_command_response -> carl9170_tx_process_status -> __carl9170_tx_process_status -> carl9170_get_queued_skb Using spin_unlock_bh in hardirq context triggers a lockdep warning because it tries to enable bottom halves while hardware interrupts are disabled, violating locking rules. Fix this by replacing spin_lock_bh/spin_unlock_bh with spin_lock_irqsave/spin_unlock_irqrestore to properly handle the interrupt context. Reported-by: syzbot+381102a7292a374fe8a7@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=381102a7292a374fe8a7 Fixes: a84fab3cbfdc ("carl9170: 802.11 rx/tx processing and usb backend") Signed-off-by: Malaya Kumar Rout --- drivers/net/wireless/ath/carl9170/tx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c index 59caf1e4b158..b5a028abe4c6 100644 --- a/drivers/net/wireless/ath/carl9170/tx.c +++ b/drivers/net/wireless/ath/carl9170/tx.c @@ -514,8 +514,9 @@ static struct sk_buff *carl9170_get_queued_skb(struct ar9170 *ar, u8 cookie, struct sk_buff_head *queue) { struct sk_buff *skb; + unsigned long flags; - spin_lock_bh(&queue->lock); + spin_lock_irqsave(&queue->lock, flags); skb_queue_walk(queue, skb) { struct _carl9170_tx_superframe *txc = (void *) skb->data; @@ -523,12 +524,12 @@ static struct sk_buff *carl9170_get_queued_skb(struct ar9170 *ar, u8 cookie, continue; __skb_unlink(skb, queue); - spin_unlock_bh(&queue->lock); + spin_unlock_irqrestore(&queue->lock, flags); carl9170_release_dev_space(ar, skb); return skb; } - spin_unlock_bh(&queue->lock); + spin_unlock_irqrestore(&queue->lock, flags); return NULL; } -- 2.54.0