From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) (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 7869514A619 for ; Wed, 29 Jul 2026 00:15:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785284118; cv=none; b=H9AOLUZHVO6zieS5oW+5bTc8VRZ3kKBZhAK1GzDo8bp+p9fhCgwYH0xZsWi8PohBLft4IWnrROmmTOGZq49DhbzdobUyP4sLOXoTu+0bHVZ7StEuKDE+NLmYw3xJ5F8+5aPhyw4vyxsCIBvvXtsWlMgATRD4pk4cGEEj03tZ8wU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785284118; c=relaxed/simple; bh=/8vnW9jfPt4vbnRGQ542LSTPCVdbphdkHrxNA/OTSeo=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To:Cc: Content-Type; b=dsQc6VSJIhGwWFtiNjk+Ko4TOyXGrLT2qNkdqOfHWfKm3ObpPgN1n3nGZqQQ/bHPc79xztPVErKJkXPpo7XIUNPWHggjoR1aseKhCCgwtVT6gkd/hxFf16W3seBiiKLdNRo1CJbWWldvzKXRVycyOKp/504NLFwWGJZ9xa7suoY= 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.199 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-f199.google.com with SMTP id 5614622812f47-4ab4f78b9f4so496252b6e.2 for ; Tue, 28 Jul 2026 17:15:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785284116; x=1785888916; 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=5nG+cxIZxWCKkmI5pJ3qLEXHKnHcqPA5am4ClkeNh1o=; b=k+7z4S/uW6lPzSQDcOQrxQxtGAWweK+hVtisgl6kpHHsiSlJd9QFiPG3DL/9oTdRfT 8oJKFKJukq49AvgGbRdfUPhvelvat7pQeRHALwsr9MQmoFRGQ91SKNf3Ej4JNEj/90UM OAJjaq+fYnBHtG6KQfOxh1kdvXkZc3/sIWRqivvPz/gQEOK7ccyxEUnGTqLleUtO4Mpo J9KQhJO+y9CtzxzhK+/LdJURaPrXIbH3gG11SB8+PcwiqhQVZ9sgF2vlYKu52diIidly /vavcZzFyErEiOt/YdNb7Sv4X5BdaqP5RzvCpER5ZY2hC67K17xlLtU+TOSSabfP3QvJ 9lrg== X-Forwarded-Encrypted: i=1; AHgh+Rrx/H34RocIUIH06KLTqtY2pbqA2uJ0VJNqsDlDAaWzGmxro8jQ/sx4Y7GG4JktQhT9ak8/35p+veRTQGY=@vger.kernel.org X-Gm-Message-State: AOJu0YwYQ66SzVZR6DfFgcHTX/KzAt29q0wV7VMDDJ/OixwTD3bH8eAQ ibQTyWf57VvOPQzv9qz69KclaUVNBbrc5pRemvMBUD3kYj3IrkbEIongHoJ5Ff8XTbSQkLZ6WZc /m8zDwo2tbedcUr/VZhlmkIqFkTGVOXYTJdnRYT1RZcwyFy8XfiQW4oin3SU= 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:e89:b0:495:a1db:bf9f with SMTP id 5614622812f47-4ad5b9329d8mr2560985b6e.43.1785284116403; Tue, 28 Jul 2026 17:15:16 -0700 (PDT) Date: Tue, 28 Jul 2026 17:15:16 -0700 In-Reply-To: <20260729001509.11164-1-kartikey406@gmail.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a694614.d9e86bb5.297b12.003f.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 >