Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1862538pxm; Thu, 24 Feb 2022 10:46:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxiQMQC6Po698ffxYa2kxAQg6JA9Q2soe6dXzfNSzaY5pLkw0vdCOtoxlOG9ZeH4/MAosyg X-Received: by 2002:a17:906:1613:b0:6cf:1161:eab6 with SMTP id m19-20020a170906161300b006cf1161eab6mr3332132ejd.315.1645728409046; Thu, 24 Feb 2022 10:46:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645728409; cv=none; d=google.com; s=arc-20160816; b=fu+XlmCllw+TRl6z2cUj5JJ+dVadAMc1jt+IYrAKny+5vEmnDW3UyVMG0T8wGdbkPp F4H3PQzF4HPItqEkT4jfU0MOZuKHRezFsd6vh+g+SQPwDjZzfgFqAadVzPVl+NHLcRY8 uHvjgzcH+8Sm4pEsSPWBVubA0bxC6pMxvo9VZl27df/dOf2I/nFKpvvZGxgrXqdSMz2p o0AElA/5cmRsW67SHEhAV0JEwsAP81C51e1rMo2cBuG1f/cA2nwhy779rUqZPAkHf9S7 cx+g+pf022m1uu0pEY71Zc8hHz1h2ez9XeObo5g6bBaTVFaOvlWmfjuwICKTHhnfAKAZ +xNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=7EZePsv1nYBZAMvWvngP/ycTXbT2T/ovAvJ6sr4Y4Ig=; b=Ik8ywpALW3G7T25tf4ivvw0YmdpUlNRGRKOl0TssZc9kWqh/MLTyHHd0UmwDaxlSX2 i6WqxTui/08Ph53fIMEdDkkiRaYlz1li1xWXvt0JnEunUbQOBq5pSlhode6RmtmsASfm Nii7et8mSsQ9iyad5tLylKAG7y2rmRVk5pyUAWMefUyjt5zVG7euAAEqv+7K0UY/rBCc 9i+mxY2omDWDEBc+Zb/9fGJmtIHOE2q61Ezod28VYl9q6a+P4Aet0l1X3EcgUyiwJe1b daMp8X7tY5k7V3I0EREf+Bd6gL0y3Wy8AmrNtlLXqu9bcNvrKNvpiCxQDusOcvwk2e+L UONA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gnuweeb.org header.s=default header.b=D7aZtVyL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnuweeb.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a50f1c6000000b00410d72fb9basi298024edl.48.2022.02.24.10.46.25; Thu, 24 Feb 2022 10:46:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gnuweeb.org header.s=default header.b=D7aZtVyL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnuweeb.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232263AbiBXR4s (ORCPT + 99 others); Thu, 24 Feb 2022 12:56:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232481AbiBXR4m (ORCPT ); Thu, 24 Feb 2022 12:56:42 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDDA3279469; Thu, 24 Feb 2022 09:56:11 -0800 (PST) Received: from [192.168.88.87] (unknown [36.78.50.60]) by gnuweeb.org (Postfix) with ESMTPSA id 5107C7E2A3; Thu, 24 Feb 2022 17:56:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1645725371; bh=7y0qBUn+4Mr6bFU20/TGub2HSOx+UgE/hIlmL27DAVc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=D7aZtVyLlCng7VVCYtJk2rzO6vsimwfxamI03avJnlQmAyFkNPTTJvxRG/Jg4tl2j 5kpRJDZD/gyCBx4UAGS2cJcv8MDcy4kUXgdLKzLClwG429hsY2UFpZdVVzeUPepMQK INoaznkuuMgo01rQR2SB2xknWIZXiTNtbEDJXCq1KhUMNil0//085azpQLy/txcx6U L/91ntrOD5KGFdQYd6JErvSfH71zayGAoklWMSA7Qnv/VSqfKxK5n7+uF3sc1NEiG3 +PBfs1ansVMY3NUFhUiz2zYBPhLkV7FF/oOL8Wlkqgj4uGSOntQvG73n2+YnhRhNcJ Hak+Nrgofj+EQ== Message-ID: <5188759c-fd7a-4dbb-0f56-db74200603a8@gnuweeb.org> Date: Fri, 25 Feb 2022 00:56:02 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] ASoC: SOF: Intel: Fix NULL ptr dereference when ENOMEM Content-Language: en-US To: Mark Brown Cc: Daniel Baluta , Jaroslav Kysela , Kai Vehmanen , Keyon Jie , Liam Girdwood , Peter Ujfalusi , Pierre-Louis Bossart , Rander Wang , Ranjani Sridharan , Takashi Iwai , stable@vger.kernel.org, sound-open-firmware@alsa-project.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org References: <20220224145124.15985-1-ammarfaizi2@gnuweeb.org> From: Ammar Faizi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/25/22 12:26 AM, Mark Brown wrote: > On Thu, Feb 24, 2022 at 09:51:24PM +0700, Ammar Faizi wrote: >> From: Ammar Faizi >> >> Do not call snd_dma_free_pages() when snd_dma_alloc_pages() returns >> -ENOMEM because it leads to a NULL pointer dereference bug. >> >> The dmesg says: >> >> <6>[109482.497835][T138537] usb 1-2: Manufacturer: SIGMACHIP >> <6>[109482.502506][T138537] input: SIGMACHIP USB Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:1C4F:0002.000D/input/input34 >> <6>[109482.558976][T138537] hid-generic 0003:1C4F:0002.000D: input,hidraw1: USB HID v1.10 Keyboard [SIGMACHIP USB Keyboard] on usb-0000:00:14.0-2/input0 >> <6>[109482.561653][T138537] input: SIGMACHIP USB Keyboard Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:1C4F:0002.000E/input/input35 > > Please think hard before including complete backtraces in upstream > reports, they are very large and contain almost no useful information > relative to their size so often obscure the relevant content in your > message. If part of the backtrace is usefully illustrative (it often is > for search engines if nothing else) then it's usually better to pull out > the relevant sections. I will strip the irrelevant information in the v2. -- Ammar Faizi