Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp121915lqb; Fri, 15 Mar 2024 18:23:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVX1Wigw3NgyrNISfZADJoK10guOlGU3FRWNyS5cLq4ajKG2YMFLlNKqP7XzboVvHEQnkDiSS+BsX5cEPm1QQWfqZRQpYSOvP53st/5lQ== X-Google-Smtp-Source: AGHT+IH8WU2Czrz21XgZjSAuEqKZ1WCTVgA80z2g03dAQhx/I9jHfmsW9wu7s0fRq3yf5FzWLjKh X-Received: by 2002:a17:903:98c:b0:1de:f0bc:37d3 with SMTP id mb12-20020a170903098c00b001def0bc37d3mr3469250plb.27.1710552211840; Fri, 15 Mar 2024 18:23:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710552211; cv=pass; d=google.com; s=arc-20160816; b=vffQCgIeLoZWx8i+oVPltPx+RXuOiwcdmFXQMgqWfjw4lpqp9GGW3cxaCabvewjUC0 IdmHV48WvXTZkRfoc/H34sabYmpo6m332ZjDxMdhE7FxICWApQ1oyB+q5vmZO0IXkzaX iCn6u7CLl9cg7/RgMrBgE2ONZ/1luqkh7gM78/CjIbWpPUjrn5VT02gEC9k5G+z6Q0aw 7v7HtEtcWpKF1FMiETGJ6gc6m7jdvQa9qGFrBw5PbRGu1J6Kzyk8v/4WyKbSm8ucf9TT TXD/NrpQT+6Y98O6fWcG5NU4dtSfZ3OutvvwWlWq8GVwU5Ez77c9O4i3zsQuH1Rhq0Nz DLqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ZbutT3AnehdamjGc1MKryyVQ8/wv0/bupGwFFFQX0n8=; fh=xVUZvOLjzNDpTPHdcDi9sSMokJL7XuFiMoTSPn3Y5QA=; b=khiohEyl8my97Ffq6kMS7N7SaPMtl0xx86/vTBBUXcPwVriepJUIi1m3orwwnkZakx dVa/XD7oZsYSwWUhqnc2yuZaynmvbRN8HN+RkUYRUGpW0mJ5Xdcdg1G65oj/Nojw/kjN VCd2llhUgI5OMRPuCpaoosYuFO8rVHBOYSh/NkSOVIjnSobnNS+wOy6rGYwPa+/6Ys9S lxGv5gCUfcIgJXCWKnEUEUYNGupeITN+GCqhot44Hfa1h2j4Iwkxjwht19l6m2R0XBiT l3QmTtWhEEDsEcsKYvpyG2ASTmyjljujze7u0b2VnRGl7eMTMvBHM0nfuzIQ7V7sA15l xbUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-105027-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105027-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k15-20020a170902c40f00b001db9c2b41a5si4627307plk.373.2024.03.15.18.23.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 18:23:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105027-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-105027-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105027-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6D945282F85 for ; Sat, 16 Mar 2024 01:23:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53B1F1849; Sat, 16 Mar 2024 01:23:26 +0000 (UTC) Received: from mail115-100.sinamail.sina.com.cn (mail115-100.sinamail.sina.com.cn [218.30.115.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB0451373 for ; Sat, 16 Mar 2024 01:23:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.115.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710552205; cv=none; b=aStNEZfT3WQd6yamfCV/QgKg+TdgzTHNmQPLyok6NwHOiKx0rsw9QSMMze6iyOsXKWkEhtkUEMLn1AeKt2yVjQUoXIamalB9pAkC2pS9tuEi0I2hK1GByaKbI72GAsGozaiBC9/yzWAEI7LeaFemyGG1DEJUib++I4OQinJRfAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710552205; c=relaxed/simple; bh=yJpIzGjSzx4EnM6a3UH/YzVy+e80nL6JbcRYnjsgSog=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bOU0egRBNFAFhlm7/nZo+0e6StE/D/mYdrzSW7UOeArk8xIHJgrARYLhqIQ1Y/WgXf1o5c9O0LYgmSLtvfCGPWLtSTnV4uhTiX9vizQFmLNMFCFjZ+X3P7xdIDRIoyEGamLdC+L1uftcOJa07hWgK9PHHNt22fZd6P1ImHh3YCg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; arc=none smtp.client-ip=218.30.115.100 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([116.24.10.31]) by sina.com (172.16.235.24) with ESMTP id 65F4F47F000043A7; Sat, 16 Mar 2024 09:23:15 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 82308945089324 X-SMAIL-UIID: 73979B1DA2B44EBB943993FDE9E76899-20240316-092315-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [sound?] possible deadlock in snd_pcm_period_elapsed (4) Date: Sat, 16 Mar 2024 09:23:02 +0800 Message-Id: <20240316012302.1634-1-hdanton@sina.com> In-Reply-To: <0000000000002a81490613b2affb@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master --- x/sound/core/timer.c +++ y/sound/core/timer.c @@ -409,8 +409,9 @@ static void snd_timer_close_locked(struc struct snd_timer *timer = timeri->timer; if (timer) { - guard(spinlock)(&timer->lock); + spin_lock_irq(&timer->lock); timeri->flags |= SNDRV_TIMER_IFLG_DEAD; + spin_unlock_irq(&timer->lock); } if (!list_empty(&timeri->open_list)) { --- x/drivers/virtio/virtio_ring.c +++ y/drivers/virtio/virtio_ring.c @@ -316,7 +316,13 @@ static void *vring_alloc_queue(struct vi return dma_alloc_coherent(dma_dev, size, dma_handle, flag); } else { - void *queue = alloc_pages_exact(PAGE_ALIGN(size), flag); + void *queue; + unsigned long sz = PAGE_ALIGN(size); + unsigned int order = 0; + + while ((PAGE_SIZE << order) < sz) + order++; + queue = (void *) __get_free_pages(flag, order); if (queue) { phys_addr_t phys_addr = virt_to_phys(queue); @@ -334,7 +340,7 @@ static void *vring_alloc_queue(struct vi * unrepresentable address. */ if (WARN_ON_ONCE(*dma_handle != phys_addr)) { - free_pages_exact(queue, PAGE_ALIGN(size)); + free_pages((unsigned long) queue, order); return NULL; } } @@ -348,8 +354,14 @@ static void vring_free_queue(struct virt { if (vring_use_dma_api(vdev)) dma_free_coherent(dma_dev, size, queue, dma_handle); - else - free_pages_exact(queue, PAGE_ALIGN(size)); + else { + unsigned long sz = PAGE_ALIGN(size); + unsigned int order = 0; + + while ((PAGE_SIZE << order) < sz) + order++; + free_pages((unsigned long) queue, order); + } } /* --