Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1240405ybl; Fri, 13 Dec 2019 11:55:03 -0800 (PST) X-Google-Smtp-Source: APXvYqzcEJIw6pGPeyQqPE+vDe2w7+I+LWV807BzA40bVPPJdi/kGJjj2p8OcB1x4JG/iQBi0gGa X-Received: by 2002:a9d:65cf:: with SMTP id z15mr17122860oth.238.1576266903588; Fri, 13 Dec 2019 11:55:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576266903; cv=none; d=google.com; s=arc-20160816; b=mZ8ISUBeZ3PwkoytXejcTTMgP76tModyHcnDG7/aqHzJ93SAGVWloEvvgDMQDmCRWg nFc1GLNUxFgWubL0be08e84VFPEidqMvDWb3C+Nhemue/EF0EZPno+5ryW/IJ32rM8nr jcWnhqnmMk7AGLWyWI2mFXG40DLMkiKQESCZTqxaylKhyWUOpjAedgDGpyAV+L2LgIaP qLOMoh00p/GoG6VTicsBWEfIGKFQTvyaR8RF1PTfnJ9QWNNCRddZKtwZGkVYk1e6a6zn pPsKKHZccUBDYxu5DBHzO146yGwSPwYF0o7ie32X5lI8YlOiIRbFuwyjz+lo/PEUYOzO ilNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:date:from:dkim-signature; bh=UDUGuPy0SzNQtaLWS/B5DyJXF4eqKf2oErS2khMyg4Y=; b=ch2b1bpO7wZP0j7HSnFeIeFrnP0UTNjjCcL6eN4Tld6NzOp8B/+Hz8qRhPs5wn0fMv VayS06Fi/9YO3Jo3W2ZHyHSbN+wtLo9+hpRceboFkUKRhRMeLrF4jma6AjzB2yR2TgfQ qKNUO1kqoFCsy7MWSZkngYc4AwHJ8ugxnGaJIYDYJVMDXqcHx08f685m37tFaH9si2JN /uNRxY9Nrro+nV88mfj2e96yxZdnkeyELBigpZYkHEGalrA7qzJeFmeaZuYKgzJo27+f QFLqAUv1f7VU68cRswuRqGQKpXExj4o/pwtSN2rvSlgGyyMZRAlo9SKleEsLZyUlqRPu S+FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maine.edu header.s=google header.b=aDdLn77F; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si6157853otq.156.2019.12.13.11.54.51; Fri, 13 Dec 2019 11:55:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@maine.edu header.s=google header.b=aDdLn77F; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728943AbfLMTxw (ORCPT + 99 others); Fri, 13 Dec 2019 14:53:52 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:35261 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728900AbfLMTxw (ORCPT ); Fri, 13 Dec 2019 14:53:52 -0500 Received: by mail-qk1-f193.google.com with SMTP id z76so218812qka.2 for ; Fri, 13 Dec 2019 11:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maine.edu; s=google; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=UDUGuPy0SzNQtaLWS/B5DyJXF4eqKf2oErS2khMyg4Y=; b=aDdLn77F4ZSNiHcIyuN9tH5vtM9rtFMe/mkQfzUVRPPOC5mOfxX/l8Rd4ai7xnb14T 54qeT6LQLY1m+thu/An8GPv7ds/kfhZwcyG7BkZDXYwWN6AeQiPOJRnXdpT/GdVmwZtA PAtDqicdbbejRnxZBr6LL1D4fAr1/EEXNeriU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=UDUGuPy0SzNQtaLWS/B5DyJXF4eqKf2oErS2khMyg4Y=; b=U39g1ktP6+GC5D5IOVtnn8iKc691ovItXVj9SDhg3daXvqdQzTmT5TH/qjMio0Eo+k xBK+O0mTZbPpeADthwQgRwZ4c9Pz4d1mKEH9aS+goQ2C6JanN1lsSmMkM1GA4e6bdp3b Un3GxWsh5rMP5w8yfl6juTmJySUDfK3dyiHGm8mZDT/AbfNjHWau7+qWOLPJrxLwinxT SLArmOO8ADUkMtMsS0pcqXBMLAuTm96G/Xlole78FaRxYy0PnsiZ5Nk4YiTMsqzDxkbe P6pdEZ6YA3Y1A5dIFJ4XRrLZfs7GlckDL5ZVl9grJSI4ah5CZ95cv9gunv3qCiESDTk0 3JBg== X-Gm-Message-State: APjAAAWEUTa4EVQh9rQW/JsD5/dam+DNYgSKq52iBqvx3+KhFGPTlS4p 94YXZcMr74X2u8gh2L1NfX8G4g== X-Received: by 2002:a05:620a:1112:: with SMTP id o18mr14883267qkk.126.1576266831174; Fri, 13 Dec 2019 11:53:51 -0800 (PST) Received: from macbook-air (weaver.eece.maine.edu. [130.111.218.23]) by smtp.gmail.com with ESMTPSA id t11sm3065461qkm.92.2019.12.13.11.53.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2019 11:53:49 -0800 (PST) From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Fri, 13 Dec 2019 14:53:48 -0500 (EST) X-X-Sender: vince@macbook-air To: Dave Hansen cc: Jani Nikula , Vince Weaver , linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Joonas Lahtinen , Rodrigo Vivi Subject: Re: [perf] perf_fuzzer triggers NULL pointer derefernce in i915 driver In-Reply-To: Message-ID: References: <87tv641z20.fsf@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Dec 2019, Dave Hansen wrote: > On 12/12/19 11:09 PM, Jani Nikula wrote: > > On Thu, 12 Dec 2019, Vince Weaver wrote: > >> with current git the perf_fuzzer was able to trigger this NULL pointer > >> de-reference in the i915 driver. > > Please file a bug. > > > > https://gitlab.freedesktop.org/drm/intel/wikis/How-to-file-i915-bugs > > I'm seeing the same thing. It's annoyingly and immediately reproducible > for me: > > https://gitlab.freedesktop.org/drm/intel/issues/826 > > Let me know if you want anything fancier done like a bisect. Looking > back through my kernel logs, it appears to also have happened with > 5.4.0-rc4. This patch was sent out in response to my report (but not as a direct reply). >From chris@chris-wilson.co.uk Thu Dec 12 10:42:36 2019 >Date: Thu, 12 Dec 2019 15:42:24 +0000 >From: Chris Wilson >To: intel-gfx@lists.freedesktop.org >Cc: Chris Wilson , Vince Weaver , Matthew Auld >Subject: [PATCH] drm/i915: Set fence_work.ops before dma_fence_init Since dma_fence_init may call ops (because of a meaningless trace_dma_fence), we need to set the worker ops prior to that call. Reported-by: Vince Weaver Fixes: 8e458fe2ee05 ("drm/i915: Generalise the clflush dma-worker") Signed-off-by: Chris Wilson Cc: Matthew Auld Cc: Vince Weaver --- drivers/gpu/drm/i915/i915_sw_fence_work.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_sw_fence_work.c b/drivers/gpu/drm/i915/i915_sw_fence_work.c index 07552cd544f2..8538ee7a521d 100644 --- a/drivers/gpu/drm/i915/i915_sw_fence_work.c +++ b/drivers/gpu/drm/i915/i915_sw_fence_work.c @@ -78,12 +78,11 @@ static const struct dma_fence_ops fence_ops = { void dma_fence_work_init(struct dma_fence_work *f, const struct dma_fence_work_ops *ops) { + f->ops = ops; spin_lock_init(&f->lock); dma_fence_init(&f->dma, &fence_ops, &f->lock, 0, 0); i915_sw_fence_init(&f->chain, fence_notify); INIT_WORK(&f->work, fence_work); - - f->ops = ops; } int dma_fence_work_chain(struct dma_fence_work *f, struct dma_fence *signal) -- 2.24.0