Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp390282rdh; Tue, 13 Feb 2024 23:02:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWGJRDAxUj/XzqP15YJjFiokouuzdLF2KsGzkDAbT3h4Ai2N/IquxBnzS4h4Y8YgBL/WWHFKnAWFQ+OqcQXKW3WGSfACcfU/iI1RFdijw== X-Google-Smtp-Source: AGHT+IHPxtK+P3wkAXDYNumbbqhN0rp8WQeIu4sWInz3WZYB03GMQ3CAFR1TPF1EjwvP6694BCcp X-Received: by 2002:a05:6358:3e8c:b0:17a:ec74:b574 with SMTP id d12-20020a0563583e8c00b0017aec74b574mr1862002rwm.10.1707894139549; Tue, 13 Feb 2024 23:02:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707894139; cv=pass; d=google.com; s=arc-20160816; b=CQBXBSb8FuFyYLC3ETXpIGIuGd/1geHVi6rzfhnRhS4BPyGkhxo1MW1sWylcGtjWe8 +AZhLRAiN4q4+PhaIRyqCNOtUM8SACbuk/Ex31mCKPvWQ+H5ncJTa1gdnUm0LcmHVPmR 17cKpvFZLD0IfQXN04BXLeWhghrtkNnPaUXEv2U2A+TQBFQ9+KWkNvepH8kwU8Q4Z1Or vNxRA2hLXTYVqnpnBupYv57RFuriR4l84V1Nrxozc679L2d9CBTqN3sOavN1Mh9lhy93 lrYtRdqw68ntIL46jSm3GVjN1qyrkDqE9OOSnbcpxI5gHiCBIuExXxz9Ga1+R0Qgtrc7 YIHQ== 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=3jQhJ+dB1Xu0msoLeODQaPI9bly8S0ggq3DCom1L2Og=; fh=aNX4DLvp3PP0CnvAdGLZIsy4+c5veoJpbyFPP74QwG4=; b=t6R6vrY8IVQxBevJfEIgAPIwgIXwGgPj7vpz56M6J9PFT9UOAb+tr12MyQbQiOzvOn 3O4f0F9PU2YTBrJzAyi1/3ua/nbgSyqdAjcROPU3yzGnrTAls1pR23zFuon4xdM5bGyY pGPQkD9dZhJLjPM4Um+lujQp02aXoaMo86xVuCpoYfcgyVX5n7zpdLM/HSBOGp6bX3/C mFgJG70pH7IZRgjf43hPUfLhKohAFPM0VDK2Z8+TvJARZrGhchr8xcbVyeY7Wb7y/oeI fqrAD8ereJZ4DLaJK33RSsEj2FEp0jvyLpCDu0RpvkZQBHEhhtWjXDDGZby6IyI+nxG0 DlXw==; 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-64815-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64815-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCXAUmSMMCzFLeZ1CHVYsi5szxXFX1c0tv2G4iTByplCWm6xnkbOWRV5WHyod7Uee+IVd7/1d9uohzEyAQcDy5lQ1BKkJL35jRv7SABt/Q== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l5-20020a656805000000b005d8b49c9b43si3365611pgt.693.2024.02.13.23.02.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 23:02:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64815-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-64815-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64815-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 28E21283CA9 for ; Wed, 14 Feb 2024 07:02:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5BD8111B9; Wed, 14 Feb 2024 07:02:12 +0000 (UTC) Received: from r3-17.sinamail.sina.com.cn (r3-17.sinamail.sina.com.cn [202.108.3.17]) (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 F317311199 for ; Wed, 14 Feb 2024 07:02:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.108.3.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707894132; cv=none; b=KRFp3M9/JPQdQTzQNFHqSuQlu/JZEVvabltHD4oKRML58wMaSQUycj3adyODQ0b/tcuq6P+kE0yG6Ou/bsHkpSkyChqBwpREfpNS9MmNTXEdKylbpQRH48LrCcYyN0DwBRtZr8dt8VA69dqYKuLQoe97PyHKrV27vimehLjSXVw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707894132; c=relaxed/simple; bh=He7xFnKcfSqJp/WOWklUsFXNcJA4+NjJ+j1XqjPxHMI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Yx2ys4nPAF0TVHcElwy8CQFWJ3sHJbBUM0Eex4aro6IT1t0gaMkiDE/mfK9E9BqpQLq3sw9K7oU3HplRc1v7b+6A+qg0Pc9ezAJK3XoUWHKItgptcyQZsg+uIl0xeTwGSx0dUFdmEJ0vsCDsc0yngzileq+J4BpG089oNEdTmS4= 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=202.108.3.17 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)([114.249.59.61]) by sina.com (10.182.253.22) with ESMTP id 65CC656300002C93; Wed, 14 Feb 2024 15:01:57 +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: 5365116816084 X-SMAIL-UIID: A1C2978FD1754EC383A97214542DE265-20240214-150157-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [dri?] KASAN: slab-use-after-free Read in drm_atomic_helper_wait_for_vblanks (2) Date: Wed, 14 Feb 2024 15:01:44 +0800 Message-ID: <20240214070145.360-1-hdanton@sina.com> In-Reply-To: <000000000000ec4c32061143ec95@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 On Tue, 13 Feb 2024 06:08:15 -0800 > HEAD commit: c664e16bb1ba Merge tag 'docs-6.8-fixes2' of git://git.lwn... > git tree: upstream > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11fcdba2180000 #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master --- x/drivers/gpu/drm/drm_client_modeset.c +++ y/drivers/gpu/drm/drm_client_modeset.c @@ -987,6 +987,7 @@ static int drm_client_modeset_commit_ato struct drm_mode_set *mode_set; int ret; +retry: drm_modeset_acquire_init(&ctx, 0); state = drm_atomic_state_alloc(dev); @@ -996,7 +997,6 @@ static int drm_client_modeset_commit_ato } state->acquire_ctx = &ctx; -retry: drm_for_each_plane(plane, dev) { struct drm_plane_state *plane_state; @@ -1051,21 +1051,15 @@ retry: ret = drm_atomic_commit(state); out_state: - if (ret == -EDEADLK) - goto backoff; - drm_atomic_state_put(state); out_ctx: drm_modeset_drop_locks(&ctx); drm_modeset_acquire_fini(&ctx); - return ret; - -backoff: - drm_atomic_state_clear(state); - drm_modeset_backoff(&ctx); + if (ret == -EDEADLK) + goto retry; - goto retry; + return ret; } static int drm_client_modeset_commit_legacy(struct drm_client_dev *client) --