Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp2059920lqg; Mon, 4 Mar 2024 11:30:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXXFSiNfwliE6OGoLdZF2ckTiJ43wkObqXmtAwcb8vK+q+nobn5eCWmLQEiIKTC7xeZaRoS5nOKT3FtZ5n8y41T/qLhn4Dl2YSC7sHgmA== X-Google-Smtp-Source: AGHT+IGniKjLezD1qvxH4dtAylrBzMtseMYmQChzrrZNp6BLksppe8nAjrKQLm0xGiM4POqATFl5 X-Received: by 2002:a05:6a00:1888:b0:6e5:cb1:5836 with SMTP id x8-20020a056a00188800b006e50cb15836mr11772868pfh.4.1709580630959; Mon, 04 Mar 2024 11:30:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709580630; cv=pass; d=google.com; s=arc-20160816; b=GJpCqxXvs/pv3zzqu7LTwC8yVf47DCc65OTDm0mRy1Kn0QNl4tWZvw8hBDT+AswGJj sRfzrGTp2vZ37QtN8+zm6kJJoydlSmXzGvKLHgwv4RUw9ZYBw1vnoanATevTl9CxJ1C7 2/mHiLYOjvKbRz7GiWcErEURFvtfhGTliA8xlPHQp1GF3eChtanVgPvtDbWc9wkNmK/r UhV6VOPcJAaLvoM2mhxV61rjr+HV4XfgZgW728nyCZ9AZQGBlkVeZasTcGhxnH4oAF8G 08y0vgeWwuyQCcxu7pXFPcK24u0yZXSSRxCPqq1SET78nP7XAtM4xZYUhwEvrHwjgXQs WaxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:organization:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=eZiRoNZpJWWKK/cOdoxLY/19xwv2y7y2vYTfMraz1OY=; fh=gGDEdx2WtI1XYHksbtMpStP7I41E1eElG2awh2ayq2w=; b=SrsbFv9Ab2xlVjNeN1CdMs9VSpMTUvJBkRjrguvhIk1vqsDvA2Opl+Ts8k14pmx2/0 ODU4YZVzeDRGPqf890eoYj9balss+bscHm1/EhCO0zanZggNChg+IM0dQBDwD9+yuGpu J2dy6d65nbcJ089+B2IdBOpmwECrrmpZfBkgPAVKp/gaiB1rhNV2v6WXyzOuFUce+kfL kWCuQpTDKvn6e3Qkj5RfPJUCs8AmvMTx8Gbm9tO9bP21UJv60uNO/1DuF1ZWD+Z7TPQz m/pASjckIi2YJ6YB//4rhzkibAkurb1najZzmmPSvk6nlcb5W762NZ67uZPIpR0RNAgx PAeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WUM/5z2h"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-91181-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91181-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r10-20020aa79eca000000b006e4fe4da2e3si8461824pfq.239.2024.03.04.11.30.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 11:30:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91181-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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WUM/5z2h"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-91181-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91181-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 A1B4B28113D for ; Mon, 4 Mar 2024 19:30:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D349F79927; Mon, 4 Mar 2024 19:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WUM/5z2h" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 8F70D79DD6 for ; Mon, 4 Mar 2024 19:30:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709580615; cv=none; b=URxsY2zAOeAr3KinHIUKv+nsf7ROw6LblsX7gXZIynbsvy1gY9S6qK2nUf9qljk7DpwJkmMwLsXEu5F7Qv/tGd1aWRXgMTI1YXzzXuCD+jVbrUkHeRCtXqhWetdRqv3+QbpREBl6L3oV+mydEGnIiX2NvS3fUU4tcDr3ekdPAEA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709580615; c=relaxed/simple; bh=N0+dVA/LrZJxmJ2LqiDpPOLemlHNFaSbv/OgoIwc3rU=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=E2nQ9zTwB6cUBqbCxSDjA2tW9CXrrJqfp43coZIUGoC2gLR/6TF6reYKlbtm37CDvv0suJYJK67QwrCGXbudxYD7AiTK74O/C/exrCay+bZSyFmx68OiEThuQlVNVn7IZtbfUx2+pqO+hc7ED64jrP77iFjmd/aVLFdHRhD1Lmk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=WUM/5z2h; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709580612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eZiRoNZpJWWKK/cOdoxLY/19xwv2y7y2vYTfMraz1OY=; b=WUM/5z2hiMevmyvHtx/KJb4GWS+Yk6/OJE39Ung6QOt/w+tXHkM48ow3BbuoNWuTTgu80m 8yAzsW/wMOS6wchp33/x08xNIJDHfAG6da9suJFiUpLw74Fpk7avbrMEdP3rqXSFiq5mRn o7dVughFMlW6R41Nu+zoAvxMWO0sSZg= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-633-T1uQzw1pPLycaiypK-qdqA-1; Mon, 04 Mar 2024 14:30:11 -0500 X-MC-Unique: T1uQzw1pPLycaiypK-qdqA-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6903611eef7so73681146d6.1 for ; Mon, 04 Mar 2024 11:30:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709580610; x=1710185410; h=mime-version:user-agent:content-transfer-encoding:organization :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eZiRoNZpJWWKK/cOdoxLY/19xwv2y7y2vYTfMraz1OY=; b=ZODjFZVuJXCxcTHZ6XKhKfzYHGS0UqOOdwMwVe38Nxb8xm5akOBSJWwebQDODvpeiB ehvDvVd8SzxFScAAcqxEPN/jZitdjG8/gjwR2N93ANwwcPYmcd/x8cnk4gOJv+sq8AhJ BJzevsZbzpuxPSGHFRBOBWqnvS9Jk4NbkmZVBkX455bLledUVoDAq14hJameK73mn1Za YAV4DW37cCLwN7GBbDPEylOgnwIrMb9C1Zs0I0A/v/pFUsxX2yeG4Wiz3++ME+hm+SkO 9OXQYlsM7ao79WBklPd0SI9cpjOI5Der4j4bzHvtp73MHnMh6vEe8oby3Tr7I3mSsDnP XL9A== X-Forwarded-Encrypted: i=1; AJvYcCW9x5fWP7p0StW4JaDbEASBf4iSmHeUQIanKwV4OOcHOWWwF1nMaxU6mX3O5bHTxdaVUcA7hba4mT+VyzSYTydunKqNFG4eQLXe/Udv X-Gm-Message-State: AOJu0YyITXbN4ZFcCInVIFVC8dXYG9tFT9kOvBKbS8ImIkMcPunnaddJ QmDxEvlVnFAcQkBUfP2QiSCYAOwBzDpWSMG3MASWfkqRzyY0PPtnJ7MbZCqiA/BQFdQ8RaYRudl WX+wPycB7pdLMJOwK2xecVewmvPjkZKxWm4RLT424YRxxVk4PgtaUDwuKTGOAYw== X-Received: by 2002:a0c:e6a4:0:b0:690:4724:777c with SMTP id j4-20020a0ce6a4000000b006904724777cmr10059759qvn.35.1709580610577; Mon, 04 Mar 2024 11:30:10 -0800 (PST) X-Received: by 2002:a0c:e6a4:0:b0:690:4724:777c with SMTP id j4-20020a0ce6a4000000b006904724777cmr10059744qvn.35.1709580610325; Mon, 04 Mar 2024 11:30:10 -0800 (PST) Received: from ?IPv6:2600:4040:5c6c:a300::feb? ([2600:4040:5c6c:a300::feb]) by smtp.gmail.com with ESMTPSA id qj22-20020a056214321600b0068f73372424sm5418384qvb.90.2024.03.04.11.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 11:30:09 -0800 (PST) Message-ID: <14f1d3efc0bef057a51748db6fe95fcd22f3b34c.camel@redhat.com> Subject: Re: [PATCH 1/2] drm/nouveau: fix stale locked mutex in nouveau_gem_ioctl_pushbuf From: Lyude Paul To: Karol Herbst , linux-kernel@vger.kernel.org Cc: Danilo Krummrich , dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org Date: Mon, 04 Mar 2024 14:30:08 -0500 In-Reply-To: <20240304183157.1587152-1-kherbst@redhat.com> References: <20240304183157.1587152-1-kherbst@redhat.com> Organization: Red Hat Inc. Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reviewed-by: Lyude Paul On Mon, 2024-03-04 at 19:31 +0100, Karol Herbst wrote: > If VM_BIND is enabled on the client the legacy submission ioctl can't be > used, however if a client tries to do so regardless it will return an > error. In this case the clients mutex remained unlocked leading to a > deadlock inside nouveau_drm_postclose or any other nouveau ioctl call. >=20 > Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI") > Cc: Danilo Krummrich > Signed-off-by: Karol Herbst > --- > drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouv= eau/nouveau_gem.c > index 49c2bcbef1299..5a887d67dc0e8 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_gem.c > +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c > @@ -764,7 +764,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, voi= d *data, > return -ENOMEM; > =20 > if (unlikely(nouveau_cli_uvmm(cli))) > - return -ENOSYS; > + return nouveau_abi16_put(abi16, -ENOSYS); > =20 > list_for_each_entry(temp, &abi16->channels, head) { > if (temp->chan->chid =3D=3D req->channel) { --=20 Cheers, Lyude Paul (she/her) Software Engineer at Red Hat