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 6AB1A3370EC for ; Tue, 28 Jul 2026 15:59:19 +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=1785254361; cv=none; b=IHJ0AKJu1dRtzWStdMs7+unWF0yBCzv4j3d+G2vbjehQTvNbH4L7V6wJJFYc9IYvaeU/ZMU8q7ZoAKobPgpzq5EM1pld3g9E9Bxg4i+vZXedSaRpydzYlSOq/DA4/fNJggemH9Q72qA/bk52S+IIRb6SXiHu2/WmhERztY3qEWw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785254361; c=relaxed/simple; bh=oVKFuXjKiWWYZMKMdw66xspdCGD3x7R0jk9O6DqoUlc=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=MJCs5lWzTI7PRr/4+VpDDTwBwOIIDMS4P+Rnd7Ty8qO6wUwpQIdS1uzwTdlmRwcH3u/bVLphpggzQhfX8Mhcon7kRlXPIYoH+9FNzx1VeQZJ132sfKp3Y9sZlZD1RL9KmPtNai6E6ehMP187DaMU1pq6USJj7F4QjvtKXfyFcWM= 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-4a45b3f0bdfso5520880b6e.1 for ; Tue, 28 Jul 2026 08:59:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785254358; x=1785859158; h=content-type: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=prL+zUuaKJAW+2yzvp/udhcL3soDA7W+12sAg5Znzak=; b=tJQP1HzhxWWMh6tXwlG6bKpIq4fVDVjGXtycDRpbDxJQ6fWAhEFJQmEYZgCz3BgWuh 5qcsxK+W46h37Wdl1PTG9xXhA61HvK3ryoSChKEBOfoRmMjHVzA2J7ozqxNPomOa2mTD d7EjhHmPb/wbpGY0UNvadyzsAy4XYq4idWliZVRtTiNKD5+gzSbvx6Zhku/NEAq/9xRx 3f3FkHnp6qFBk4LqA0P1l5EysKs7EgP8q0xaE/zBLv1uEs/7gEsmbHl0yW0OgpaIkDx8 rMJj5t31LG/EBdNQvSRee+MHRWNPHtp1BBz0by1YtE0k3az2jpTmjUojoBzdBxsUhBgf /1Tw== X-Gm-Message-State: AOJu0YxV1KbkUpm5ATAnXvhcSTAAYjE+2wJuYZioQcx+nx3Mmx/JYYrh mJ1Y9FGLpLpEMT+WYjf1y0bCDobMABGY/DuY+WGcYEcIjMJy3U77KRp945tG/UD6d8CER/CxDJV bL5MFMYVHYznh65U25WLF0R0fHy1CfSph96TrGjTFqvYg9CjuXKl+Sleypfg= 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:1441:b0:489:6bef:326a with SMTP id 5614622812f47-4ad5bc20e5amr1602246b6e.38.1785254358283; Tue, 28 Jul 2026 08:59:18 -0700 (PDT) Date: Tue, 28 Jul 2026 08:59:18 -0700 In-Reply-To: <6a68b182.4c659fcc.19cd90.0020.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a68d1d6.e3659fcc.2a40b8.0015.GAE@google.com> Subject: Forwarded: [PATCH] usb: gadget: f_midi2: Fix null dereference From: syzbot To: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: [PATCH] usb: gadget: f_midi2: Fix null dereference Author: michail.tatas@gmail.com #syz test f_midi2_bind only binds if if (... != SNDRV_UMP_DIR_OUTPUT) ... if (... != SNDRV_UMP_DIR_INPUT) ... When f_midi2_set_alt gets called, it uncoditionally calls f_midi2_stop_eps which triggers a null dereference in f_midi2_free_ep_reqs Add guard to catch dereference in f_midi2_free_ep_reqs like f_midi2_drop_reqs already has Signed-off-by: Michail Tatas --- drivers/usb/gadget/function/f_midi2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/gadget/function/f_midi2.c b/drivers/usb/gadget/function/f_midi2.c index 19fdac024343..b84f2c220b2e 100644 --- a/drivers/usb/gadget/function/f_midi2.c +++ b/drivers/usb/gadget/function/f_midi2.c @@ -1163,6 +1163,9 @@ static void f_midi2_free_ep_reqs(struct f_midi2_usb_ep *usb_ep) struct f_midi2 *midi2 = usb_ep->card; int i; + if (!usb_ep->usb_ep || !usb_ep->num_reqs) + return; + for (i = 0; i < midi2->info.num_reqs; i++) { if (!usb_ep->reqs[i].req) continue; -- 2.43.0