Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3801803ybe; Mon, 16 Sep 2019 01:16:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmMd56qn6PIuWlR4+P6rsSZvjKr1D7svBJ5lyu0/IkVZZucPljETb8pBM/4oWgJ8oU29SK X-Received: by 2002:a50:9b0c:: with SMTP id o12mr630614edi.303.1568621784617; Mon, 16 Sep 2019 01:16:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568621784; cv=none; d=google.com; s=arc-20160816; b=xvUhA24P0z3nEynvrI7rAqyZwyDJV/amaGy0QfsZhGPJrqBlSN8AstTiDmTT59YLa8 zhgxp5+yPvtTyEa+Jj+g+26TritoOEfsjaxHBigNtlF2J8LXDxD71vgN+eNcHpQ2lLqz u3MVTUSfly1zJZ7nNA/Byc/DUjBn0r4BTbVHgeeUDOu+pXMXdbve/F0Wq9pVu3/00bWb Cm4LxrgCyAW68BUVT1O9lNkZUckJB8xRPlOhA620N+hh33fxxlV1sLCrLGKd33y+Qay/ ET6QkrGtIULIOecafIWeCAxeq2g/NTW8z7t6EIajHownQW5GjDLoYtzsdV6+O07d2CLZ gLSQ== 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 :message-id:date:references:organization:in-reply-to:subject:cc:to :from; bh=MzcsjHJg55Pbx6AtTH8eCARtjhWAdbbymJkaeQ7ggzY=; b=JRyXNWT7rVpe5wezC2AxmM8cGUW1Y2EhEZzD9dCzemQcl1OtDcT3XjU8eH+Syw3K2f Fau5i86Gb/C3Yj+NbJv9J3hebmjnLbD6feGpQ5DDMr1ECQKSDuNTXpOsUFmgsXxNSByv qb+idxkM8nquedS398nSgyQL8M3X29YGZYWrNuQihnhOJY54QFLo4H+pJRmaSBWX33i+ PkVRp92U6pbv83P3Fy6u+JE0sjvKsBrBz7RV3hl/TPaV4azoO2Dk6FzyZ3KymHZfyEUR lFoEerfvN4i97bRcUSl7fo3nqRWuzkb8HI0CvSpGoKhV3ba6uINKm3NADWbHDvIYMC80 IK9Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z33si20745964edz.314.2019.09.16.01.16.00; Mon, 16 Sep 2019 01:16:24 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727054AbfIPHaT convert rfc822-to-8bit (ORCPT + 99 others); Mon, 16 Sep 2019 03:30:19 -0400 Received: from mga04.intel.com ([192.55.52.120]:31550 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726084AbfIPHaT (ORCPT ); Mon, 16 Sep 2019 03:30:19 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Sep 2019 00:30:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,510,1559545200"; d="scan'208";a="201545238" Received: from lfgiles-mobl.ger.corp.intel.com (HELO localhost) ([10.252.40.121]) by fmsmga001.fm.intel.com with ESMTP; 16 Sep 2019 00:30:12 -0700 From: Jani Nikula To: Dan Carpenter , kbuild@01.org Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, Chris Wilson , intel-gfx@lists.freedesktop.org, Ville =?utf-8?B?U3lyasOkbMOk?= Subject: Re: drivers/gpu/drm/i915/display/intel_display.c:3934 skl_plane_stride() error: testing array offset 'color_plane' after use. In-Reply-To: <20190914040858.GT20699@kadam> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20190914040858.GT20699@kadam> Date: Mon, 16 Sep 2019 10:31:35 +0300 Message-ID: <87lfuou27c.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 14 Sep 2019, Dan Carpenter wrote: > tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git master > head: a7f89616b7376495424f682b6086e0c391a89a1d > commit: df0566a641f959108c152be748a0a58794280e0e drm/i915: move modesetting core code under display/ > date: 3 months ago > > If you fix the issue, kindly add following tag > Reported-by: kbuild test robot > Reported-by: Dan Carpenter > > New smatch warnings: > drivers/gpu/drm/i915/display/intel_display.c:3934 skl_plane_stride() error: testing array offset 'color_plane' after use. > drivers/gpu/drm/i915/display/intel_display.c:16328 intel_sanitize_encoder() error: we previously assumed 'crtc' could be null (see line 16318) Odd, what changed to provoke the warnings now? Or is the smatch test new? Anyway, Cc: Ville & intel-gfx. BR, Jani. > > git remote add linus https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git > git remote update linus > git checkout df0566a641f959108c152be748a0a58794280e0e > vim +/color_plane +3934 drivers/gpu/drm/i915/display/intel_display.c > > b3cf5c06ca5001 drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2018-09-25 3926 > df79cf44191029 drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2018-09-11 3927 u32 skl_plane_stride(const struct intel_plane_state *plane_state, > 5d2a19507cb665 drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2018-09-07 3928 int color_plane) > d21967740f4b7d drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2016-01-28 3929 { > df79cf44191029 drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2018-09-11 3930 const struct drm_framebuffer *fb = plane_state->base.fb; > df79cf44191029 drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2018-09-11 3931 unsigned int rotation = plane_state->base.rotation; > 5d2a19507cb665 drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2018-09-07 3932 u32 stride = plane_state->color_plane[color_plane].stride; > ^^^^^^^^^^^ > Out of bounds read? > > 1b500535c513ac drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2017-03-07 3933 > 5d2a19507cb665 drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2018-09-07 @3934 if (color_plane >= fb->format->num_planes) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Tested too late. > > 1b500535c513ac drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2017-03-07 3935 return 0; > 1b500535c513ac drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2017-03-07 3936 > b3cf5c06ca5001 drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2018-09-25 3937 return stride / skl_plane_stride_mult(fb, color_plane, rotation); > d21967740f4b7d drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2016-01-28 3938 } > d21967740f4b7d drivers/gpu/drm/i915/intel_display.c Ville Syrjälä 2016-01-28 3939 > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation -- Jani Nikula, Intel Open Source Graphics Center