From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 026EE1459FA; Thu, 13 Jun 2024 12:23:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718281425; cv=none; b=oHTiOLDkNxr9/EK81GrWBDRnweOTGjYce6vwDJ+XVMUWzEJXb4C6IpDOl0OKOUzpKoRQiXman+EXukW6pYz7MFAePd3VmDQY8Fk3S5pcBnxtTIEuJASs54i+CH0BQgnI+AS1dTZ2/YLw053z8lksiKK1Hs/86oCg5eSR00GV1Uw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718281425; c=relaxed/simple; bh=FpVwy4ghgGWEBaxFmbF8Q4XwGMJ3Ka4g+StwI71WuMY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=D8BIowCddOWw3PddteB0fLBQ61HtLHA6oQyfeHl9qkZYoqRRi3U3UVEvA9RF2uMIS7il7lrxGJPQ4xs6b+Re6g61QO2JoEmIQvUEbbqP2l52GB4/VVQr5EEHQ3pTkFSVt6gxUNMjqRZ6mOuqOPL28O/V7fLGjz8HFCDLrDWonXU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NZKnpljf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NZKnpljf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E713C2BBFC; Thu, 13 Jun 2024 12:23:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718281424; bh=FpVwy4ghgGWEBaxFmbF8Q4XwGMJ3Ka4g+StwI71WuMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NZKnpljf2Whu/CwzJdjpvWHeUIHUadwLaQeMXPmE/hqAXjmJE49yz9jmwlBVBk25r X1q3iW+Mw/4F7dkzNwXW1W8ORm78buBryVznEPlfZbsZVFIvpDLTn1J2a2mmmZPXXu H8LF+wYR/Y/Ktfsgga4MSDmp5OIwbn8Ejpw3upKU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot , Tetsuo Handa , =?UTF-8?q?Christian=20K=C3=B6nig?= , Sasha Levin Subject: [PATCH 5.10 250/317] dma-buf/sw-sync: dont enable IRQ from sync_print_obj() Date: Thu, 13 Jun 2024 13:34:28 +0200 Message-ID: <20240613113257.221395293@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113247.525431100@linuxfoundation.org> References: <20240613113247.525431100@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tetsuo Handa [ Upstream commit b794918961516f667b0c745aebdfebbb8a98df39 ] Since commit a6aa8fca4d79 ("dma-buf/sw-sync: Reduce irqsave/irqrestore from known context") by error replaced spin_unlock_irqrestore() with spin_unlock_irq() for both sync_debugfs_show() and sync_print_obj() despite sync_print_obj() is called from sync_debugfs_show(), lockdep complains inconsistent lock state warning. Use plain spin_{lock,unlock}() for sync_print_obj(), for sync_debugfs_show() is already using spin_{lock,unlock}_irq(). Reported-by: syzbot Closes: https://syzkaller.appspot.com/bug?extid=a225ee3df7e7f9372dbe Fixes: a6aa8fca4d79 ("dma-buf/sw-sync: Reduce irqsave/irqrestore from known context") Signed-off-by: Tetsuo Handa Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/c2e46020-aaa6-4e06-bf73-f05823f913f0@I-love.SAKURA.ne.jp Signed-off-by: Christian König Signed-off-by: Sasha Levin --- drivers/dma-buf/sync_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c index 101394f16930f..237bce21d1e72 100644 --- a/drivers/dma-buf/sync_debug.c +++ b/drivers/dma-buf/sync_debug.c @@ -110,12 +110,12 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj) seq_printf(s, "%s: %d\n", obj->name, obj->value); - spin_lock_irq(&obj->lock); + spin_lock(&obj->lock); /* Caller already disabled IRQ. */ list_for_each(pos, &obj->pt_list) { struct sync_pt *pt = container_of(pos, struct sync_pt, link); sync_print_fence(s, &pt->base, false); } - spin_unlock_irq(&obj->lock); + spin_unlock(&obj->lock); } static void sync_print_sync_file(struct seq_file *s, -- 2.43.0