From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) (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 53DA948A8B2 for ; Fri, 21 Aug 2026 11:42:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787312568; cv=none; b=FbISFNDCFAKxlWErSyU/43BAsNt2HVd99Dh9SYtS05vRGbo9+chSQyvHD510FdEHZlSqSb4aTlPF2waCX4b6b8GBrRvSDgflOiODV9vTxTyRlMjSfvLE4mPCSnG7y8a4NFiPHlbdltimTL/pERyK4BsbfXeKy2kqLcIsxzKtdGY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787312568; c=relaxed/simple; bh=j/0qij6eQxk93YEZr8p1+imYpDWuoWz7OD7F7rIIqCU=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To:Cc: Content-Type; b=WI4BdoLhUwCrobPJrQVQgyd9h3tZF0+NbbOzPeuE4okmO7ieIs6N6KGpcEj8rYEZtlqF0p8QrdpTPOAuZ7+jMvnoOySFqpsyRr/jYtQIiTEQ80JOkew5+VKdO+9DOdJjmjAZkBjccNw6165TwNG0o7tbRdSA4wmyFFH7P/eZoDY= 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.167.197 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-oi1-f197.google.com with SMTP id 5614622812f47-48e5de5a23cso1256442b6e.0 for ; Fri, 21 Aug 2026 04:42:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787312566; x=1787917366; h=content-type:cc:to:from:subject:message-id:in-reply-to:date :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=z2JGRwBhJoI9xUZwqJ94ZMxtZ1BvlTr6NlHSH2Z+0Vg=; b=DuAS1jyj3i8pNwCp5lvyAk0bD01Kz0tfeK49uGR8VVQ8G439Px9DlGmrslW0JjBAYe 7XnxX411TlRcictMzU3ovK/WY8jKnFWtFsceR0bXaXikexkVVS2th5TAXPMSdVawra7D Iq2tpOqkZjMyTHZaxMl1aZwa4+6gaON2BZT+kG/RTzRA3izAMyqPjnp9rBnuli9vP+Zh CzvOw7ty8urdnJc7K+922GEtI+z6qssxH2pMNk0879TAq2hF5IP/cW3vcLymqtRmDdCG ETx0m2JnGzFs/6x2Z7S7CaxDihGkyDCF5pFfZI0ckIPByhbxS2MBezQxh8CenRb6Va5M qzJQ== X-Forwarded-Encrypted: i=1; AHgh+Ro5cKrwcJCxyI8nRe1fXWDeYSTe3fuIgjys1KZgVmH3wPWiS4FhvQ9M/Gd3R7Rd8yb/Dp7jjgCuUr8JV9g=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6kMKMhndwJsA3TR45WoPT7vEcwctT2uHlCT5JsTwrFjaAgpSa 1ZBTtXBmqWP0cZEE+POZJ0ZgnHhev9Dgod37DhR1Ltud8X68hVg+di4eS+t3ZE6uLluP9T2Qt7a r7otLK4X8FVbUVcaBzHRPTJgraEFR2iWYfz84yuJK/taInqW27M72jZYz+jw= 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:1688:b0:4a3:ff0a:e407 with SMTP id 5614622812f47-4b2ef45c63cmr4838205b6e.15.1787312566334; Fri, 21 Aug 2026 04:42:46 -0700 (PDT) Date: Fri, 21 Aug 2026 04:42:46 -0700 In-Reply-To: <20260821114238.11840-1-kartikey406@gmail.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a8839b6.91706f20.16b6e3.02a6.GAE@google.com> Subject: Re: [PATCH] usb: gadget: u_audio: reject srate request for unconfigured direction From: syzbot To: kartikey406@gmail.com Cc: kartikey406@gmail.com, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" > #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master This crash does not have a reproducer. I cannot test it. > > > u_audio_get_playback_srate() unconditionally locks and reads > uac->p_prm.lock/srate, but g_audio_setup() only initializes > p_prm.lock when p_chmask is set. On a UAC2 instance configured > without a playback direction, this results in acquiring a > never spin_lock_init()'d lock when a GET_CUR sample rate > request targets playback, triggering a lockdep "trying to > register non-static key" warning. > > Reject the request with -EOPNOTSUPP when p_chmask is not set, > before touching prm->lock. > > Reported-by: syzbot+e1d0e66badecc32d45eb@syzkaller.appspotmail.com > Closes: http://syzkaller.appspot.com/bug?extid=e1d0e66badecc32d45eb > Signed-off-by: Deepanshu Kartikey > --- > drivers/usb/gadget/function/u_audio.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/usb/gadget/function/u_audio.c b/drivers/usb/gadget/function/u_audio.c > index e53f2927b539..ff811ea1e25a 100644 > --- a/drivers/usb/gadget/function/u_audio.c > +++ b/drivers/usb/gadget/function/u_audio.c > @@ -575,6 +575,9 @@ int u_audio_get_playback_srate(struct g_audio *audio_dev, u32 *val) > struct uac_rtd_params *prm; > unsigned long flags; > > + if (!audio_dev->params.p_chmask) > + return -EOPNOTSUPP; > + > prm = &uac->p_prm; > spin_lock_irqsave(&prm->lock, flags); > *val = prm->srate; > -- > 2.43.0 >