Received: by 10.213.65.68 with SMTP id h4csp366432imn; Fri, 23 Mar 2018 06:24:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELv+h3BC2GCJjBHnh1iUDau/8putHoNDr6MWbDGiItQ2I6wgMhvs/ULfQZPAQ2cTHIZSMVam X-Received: by 10.99.61.204 with SMTP id k195mr21108699pga.312.1521811480922; Fri, 23 Mar 2018 06:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521811480; cv=none; d=google.com; s=arc-20160816; b=l3/PBq8x+Rb4KjBqn7FehdzXu2JqnUghurmiz/3BTHfFO4IcQXuXkH+00zRrucXYNh cXbZnES+uPg9t8FRgFRmrYCe5lldlQ53o1JMAQmCtHQJcogv2x09I2dUYwul/VLyyeNV YZC2vp95hkEjnSAf9YcyRFl7jzeiCnK85Ia2pleFBwdFs3KUC0R0XDSWfdx4+IGU50/y vfCV/ZJk7uijBHSeIZPUYyA7v7Yqjrtuv6GP163/pFd4BcVpLDqmVWtGzpL6sajy95u9 B0pOu8mZj+T3xzpgUzRV5EgT+8ISKEAOrdJiOWAaeC/FmgXDdEgnvii0y7aCJB6PyUYp dIWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=MVw5PXfmDIoHZNmejyQo3l3dKlAeDK5YSz1WxFhnXf8=; b=a5jOynarkhGPknzimqYNTsvlFKLS4iuQZaGtiwFk8rSDObF0hyMlzB5Epll5A4yj9x SHID3KmQ2Bx1aMsB6jvndkTtM//dzNh14yqvy9+YAD/QpanzS54KDZS3b0NcH3OjhYy8 gHCq3OeryBAUY0XCbyBWVlSgmpXb4Euc2r8XZ+UexAkJEI+o1jpx5XFJPf4e4tkOcoLU /bT/cMF4OzCZzaxOGXemXX1NevPKXAag0+kw6mcDOSB1Xkl70v/LedkJsHkqH2CYAICi A5ggd/85E/BM5DRvwYujAX36T0g3gdeVhgsLwjEKhzjjgpuoVkQ60E0nYDBMX7SUGgft O+2g== ARC-Authentication-Results: i=1; mx.google.com; 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 s3si6688324pfi.32.2018.03.23.06.24.25; Fri, 23 Mar 2018 06:24:40 -0700 (PDT) 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; 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 S1752400AbeCWNXQ (ORCPT + 99 others); Fri, 23 Mar 2018 09:23:16 -0400 Received: from mga11.intel.com ([192.55.52.93]:3235 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752289AbeCWNXP (ORCPT ); Fri, 23 Mar 2018 09:23:15 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Mar 2018 06:23:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,350,1517904000"; d="scan'208";a="26937403" Received: from tzanussi-mobl.amr.corp.intel.com (HELO [10.254.112.150]) ([10.254.112.150]) by fmsmga008.fm.intel.com with ESMTP; 23 Mar 2018 06:23:14 -0700 Message-ID: <1521811393.27781.2.camel@tzanussi-mobl.amr.corp.intel.com> Subject: Re: [PATCH] tracing: Fix a potential NULL dereference From: Tom Zanussi To: Dan Carpenter Cc: Steven Rostedt , Ingo Molnar , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Date: Fri, 23 Mar 2018 08:23:13 -0500 In-Reply-To: <20180323113735.GC28518@mwanda> References: <20180323113735.GC28518@mwanda> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dan, On Fri, 2018-03-23 at 14:37 +0300, Dan Carpenter wrote: > We forgot to set the error code on this path so we return ERR_PTR(0) > which is NULL. It results in a NULL dereference in the caller. > > Fixes: 100719dcef44 ("tracing: Add simple expression support to hist triggers") > Signed-off-by: Dan Carpenter > > diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c > index 4f027642ceef..a02bc09d765a 100644 > --- a/kernel/trace/trace_events_hist.c > +++ b/kernel/trace/trace_events_hist.c > @@ -2776,6 +2776,7 @@ static struct hist_field *parse_expr(struct hist_trigger_data *hist_data, > expr->fn = hist_field_plus; > break; > default: > + ret = -EINVAL; > goto free; > } > Acked-by: Tom Zanussi Thanks for catching this! Tom