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 1304D489897 for ; Fri, 21 Aug 2026 11:44:36 +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=1787312678; cv=none; b=BUup3iGOxSZVLzvYRyYYh46erRkDNmN6NJR4AU/7hip42tKg/VH8dxmWWG7T+tj6esrzVWa5GACYrYnLmviLnxzmgbQWYd0AAgoJX+ySWsGBCLCrkJq1C54bX1A15m5zuHquAOJ2Heuz+XgAj8zWWlSpyYfwu2B1nKmf9sbwzFE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787312678; c=relaxed/simple; bh=xU7mvFJ7FWLvwrBmvBHdh0RwuBASTIxrRIZlsRnsdfI=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To:Cc: Content-Type; b=r0u+ya64W92LEpVcrOX/Sk4CXvYyx6RbU5sPvOY2WFlMQ6n/tCh/hw2Fes501dzve/mKMKOYeq+W1Wp9YkpA9DUNEvrNTYy+C9lPmFGeiTrJM5THOSdO7Jg5o+jLUMFYTWO4LWo4CZyHKQoHk0QPUkMamDUsfl8TneF1LLlz9MU= 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-45a07949855so1469301fac.2 for ; Fri, 21 Aug 2026 04:44:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787312676; x=1787917476; 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=lDR+VtVWpPIe2zBPYtLN1cfYfpxB7ldyMb9W4dCXef0=; b=Qqd1omyfSwtE/yuPmhFLnooii8+fvvQdU4WNpZsg8+yWNYW753weN4ZDD9J3ojo9zE ilBavIXcEhv7+gP2Gc21cXEFw1vkd16rRe2ARveMtxPGdTWu5GBX/We0f3qha0XJ5wKT jg6rAa9zpYoC8FRLKz9zstl1Q/sKBTFhHowTPnA92WU2cyCxu8gOFanSMeSEV7vai4BW i2D+cmTdPerAd//3wX6K7r88tnHf4yIU8ywLgvRnb7o/OHZENmntGzFKJCPHIX1HkzeW jJsWHhru6cE86fwfMud176aOqHSa8FFOEFLrHaMy/8zWKn+hJYljmVP699oq0xtS56Jo wdFw== X-Forwarded-Encrypted: i=1; AHgh+Ro7TqI5/LsXaQBIg5hEk9d6PfwCC56XeNqr9dsAmft6rcJk+fB5XSNbJr6kI4/Fdrp0gYL88XDRwGgut4U=@vger.kernel.org X-Gm-Message-State: AOJu0Yx+VEEQ+UsG88QXSmnSov2GgbXnkhCCGItYH9CrPvqzOqIDzChI 3FFu9Cd2kt4P4im3aXN/0ebDQma2zaIl96BqSq9Zc1/qTIO2l2ix8TigvQ53L9YcRhaV9Yig5bH TDi4BGKpOv+UAozGx2AuqYAILMf1NjBPs+0TBtx4dCbcRxosjML35/aGLXCo= 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:6820:150b:b0:6a1:3e91:dcac with SMTP id 006d021491bc7-6b159433d65mr6072910eaf.31.1787312676041; Fri, 21 Aug 2026 04:44:36 -0700 (PDT) Date: Fri, 21 Aug 2026 04:44:36 -0700 In-Reply-To: <20260821114427.11896-1-kartikey406@gmail.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a883a24.dbb3a75c.13dd47.0014.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 >