From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f71.google.com (mail-oa1-f71.google.com [209.85.160.71]) (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 2B3E0632 for ; Wed, 29 Jul 2026 00:18:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785284338; cv=none; b=QYgLBcBfZZRczdr39SR3/b/ernOGSywSpUE3pkJ+fDPe6x4Kk5ezWfFgbu666FpYnrH0ADqhU+pQmZy2g6/SZ+DRIAKskV64FX7AYau79N7oKgEiDq768T5wvF31SlgkuHNU4OVpjAV6bx4Pjfxud+OSjLZdcywcWIYGQ4rrfyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785284338; c=relaxed/simple; bh=j7k4BAJyIMEVHe8Pkg6hABdQXP9KhTNREFwt+MQCx3M=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To:Cc: Content-Type; b=Dq4sqEoIJuvlpD6WMDsBrxDdzht0SJdlUKDUHzEaCdNB4IwHDsiYMuuJnnD9VR8mL4Ly5V5Y1I0L7kC1JQsso9mDEsDW6qU0fqsHiCpWO1Uh9tRDI5pr8Y/H+tpN97Rw153v6sYgGodk0q5Bv66+/RgSzesy4PkEe5eaJ9zzfGE= 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.71 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-f71.google.com with SMTP id 586e51a60fabf-43cd2d12617so435821fac.3 for ; Tue, 28 Jul 2026 17:18:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785284336; x=1785889136; 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=29hrVvZtmYN5vU70Pse4rVos3TcggP/VmBnUQ4bKmvU=; b=R8fgdzbzf5ePolX7Mf7P+lnyLOWyo4XSuXWGGouTaH+lB0Jn29kEMhXCAsbDqQi9Mo RRtB8+YrfpRC5bjJgtwB7iirdwO0UzhXpaDi8Q5oykgjVocU8Qs/8SEgMcOzFSTtzZj9 s3+2mOdVM1vUrPrmkkkgxyCCIoO+C12/kRbe9pIrII0avshBwnS6YR3EzSuqbZtaEyx+ P2eHlcTuAdOKE9qvJw07iqF5v3+7wZYYjdchQsTaKEzsz+TeLiB7z1sJwy7yfS3atyr6 +v0S/nAd+NyZo+1v6j7IfCaX/eFOlIOVP5XSjdfHKv/nh4fXEMyABXwBH6HJae+rsSaP NUOg== X-Forwarded-Encrypted: i=1; AHgh+RrMXxPzhAtGMdLm7jQ1ptljEAner4ncCC+FneeYHcZvO9cMUQxq2ZOU6CxdVkfM8djdDcV/n/0PsYXj2BM=@vger.kernel.org X-Gm-Message-State: AOJu0YxCsEJD7GBoNEh6fDj8/oAGp+oRXp1KNCqsABu2qV8+XKs5RIwc ujiIPA9xhJDURt8s/hIJtdx87iqjBARkEsRFa2sMjeqOXmCplAk0fgFkqV//yZcCEZk6y11c1tw l+s2Zfa1auTfmok/K6zZGywCh0kNvme7FiltVSXWxtUB0jqRLvCengcrxgVk= 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:c3e9:b0:487:6206:54f1 with SMTP id 5614622812f47-4ad5ba33361mr2614210b6e.39.1785284335939; Tue, 28 Jul 2026 17:18:55 -0700 (PDT) Date: Tue, 28 Jul 2026 17:18:55 -0700 In-Reply-To: <20260729001845.11372-1-kartikey406@gmail.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a6946ef.e3659fcc.2a40b8.0023.GAE@google.com> Subject: Re: [PATCH] ALSA: ump: Fix double-free of ump->out_cvts on legacy rawmidi attach failure 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. > > If snd_rawmidi_new() fails inside snd_ump_attach_legacy_rawmidi(), the > error path frees ump->out_cvts but leaves the pointer dangling. Since > ump->out_cvts is a field of the long-lived struct snd_ump_endpoint > (not the rawmidi device that failed to be created), it gets freed a > second time later during normal endpoint teardown, in > snd_ump_endpoint_free(), invoked via snd_rawmidi_free()'s > private_free callback when the sound card is released. This results > in a KASAN double-free/invalid-free. > > Clear ump->out_cvts to NULL after freeing it on the error path, so > the later unconditional kfree() in snd_ump_endpoint_free() becomes a > harmless no-op. > > Reported-by: syzbot+b6cab840e6a85641c7ad@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=b6cab840e6a85641c7ad > Signed-off-by: Deepanshu Kartikey > --- > sound/core/ump.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/sound/core/ump.c b/sound/core/ump.c > index 70520c7ca293..632c13baf21e 100644 > --- a/sound/core/ump.c > +++ b/sound/core/ump.c > @@ -1365,6 +1365,7 @@ int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump, > &rmidi); > if (err < 0) { > kfree(ump->out_cvts); > + ump->out_cvts = NULL; > return err; > } > > -- > 2.43.0 >