All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: David Airlie <airlied@linux.ie>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	LKML <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] drm_modes: signed integer overflow
Date: Thu, 22 Oct 2020 13:14:23 +0300	[thread overview]
Message-ID: <20201022101423.GI6112@intel.com> (raw)
In-Reply-To: <47527cdb-2eda-b5a3-d77c-3855b91a0b61@infradead.org>

On Wed, Oct 21, 2020 at 08:13:43PM -0700, Randy Dunlap wrote:
> Hi,
> 
> With linux-next 20201021, when booting up, I am seeing this:
> 
> [    0.560896] UBSAN: signed-integer-overflow in ../drivers/gpu/drm/drm_modes.c:765:20
> [    0.560903] 2376000 * 1000 cannot be represented in type 'int'

Dang. Didn't realize these new crazy >8k modes have dotclocks reaching
almost 6 GHz, which would overflow even u32. I guess we'll switch to
64bit maths. Now I wonder how many other places can hit this overflow
in practice...

> [    0.560909] CPU: 3 PID: 7 Comm: kworker/u16:0 Not tainted 5.9.0-next-20201021 #2
> [    0.560914] Hardware name: TOSHIBA PORTEGE R835/Portable PC, BIOS Version 4.10   01/08/2013
> [    0.560924] Workqueue: events_unbound async_run_entry_fn
> 
> [    0.560930] Call Trace:
> [    0.560938]  dump_stack+0x5e/0x74
> [    0.560943]  ubsan_epilogue+0x9/0x45
> [    0.560948]  handle_overflow+0x8b/0x98
> [    0.560953]  ? set_track+0x3f/0xad
> [    0.560958]  __ubsan_handle_mul_overflow+0xe/0x10
> [    0.560964]  drm_mode_vrefresh+0x4a/0xbc
> [    0.560970] initcall i915_init+0x0/0x6a returned 0 after 116076 usecs
> [    0.560974] calling  cn_proc_init+0x0/0x36 @ 1
> [    0.560978]  cea_mode_alternate_clock+0x11/0x62
> [    0.560985]  drm_match_cea_mode+0xc7/0x1e7
> [    0.560987] initcall cn_proc_init+0x0/0x36 returned 0 after 3 usecs
> [    0.560990] calling  topology_sysfs_init+0x0/0x2d @ 1
> [    0.561000]  drm_mode_validate_ycbcr420+0xd/0x48
> [    0.561005]  drm_helper_probe_single_connector_modes+0x6db/0x7da
> [    0.561012]  drm_client_modeset_probe+0x225/0x143f
> [    0.561018]  ? bitmap_fold+0x8a/0x8a
> [    0.561023]  ? update_cfs_rq_load_avg+0x192/0x1a2
> [    0.561029]  __drm_fb_helper_initial_config_and_unlock+0x3f/0x5b7
> [    0.561035]  ? get_sd_balance_interval+0x1c/0x40
> [    0.561040]  drm_fb_helper_initial_config+0x48/0x4f
> [    0.561047]  intel_fbdev_initial_config+0x13/0x23
> [    0.561052]  async_run_entry_fn+0x89/0x15c
> [    0.561058]  process_one_work+0x15c/0x1f3
> [    0.561064]  worker_thread+0x1ac/0x25d
> [    0.561069]  ? process_scheduled_works+0x2e/0x2e
> [    0.561074]  kthread+0x10e/0x116
> [    0.561078]  ? kthread_parkme+0x1c/0x1c
> [    0.561083]  ret_from_fork+0x22/0x30
> [    0.561087] ================================================================================
> 
> -- 
> ~Randy
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: David Airlie <airlied@linux.ie>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	LKML <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] drm_modes: signed integer overflow
Date: Thu, 22 Oct 2020 13:14:23 +0300	[thread overview]
Message-ID: <20201022101423.GI6112@intel.com> (raw)
In-Reply-To: <47527cdb-2eda-b5a3-d77c-3855b91a0b61@infradead.org>

On Wed, Oct 21, 2020 at 08:13:43PM -0700, Randy Dunlap wrote:
> Hi,
> 
> With linux-next 20201021, when booting up, I am seeing this:
> 
> [    0.560896] UBSAN: signed-integer-overflow in ../drivers/gpu/drm/drm_modes.c:765:20
> [    0.560903] 2376000 * 1000 cannot be represented in type 'int'

Dang. Didn't realize these new crazy >8k modes have dotclocks reaching
almost 6 GHz, which would overflow even u32. I guess we'll switch to
64bit maths. Now I wonder how many other places can hit this overflow
in practice...

> [    0.560909] CPU: 3 PID: 7 Comm: kworker/u16:0 Not tainted 5.9.0-next-20201021 #2
> [    0.560914] Hardware name: TOSHIBA PORTEGE R835/Portable PC, BIOS Version 4.10   01/08/2013
> [    0.560924] Workqueue: events_unbound async_run_entry_fn
> 
> [    0.560930] Call Trace:
> [    0.560938]  dump_stack+0x5e/0x74
> [    0.560943]  ubsan_epilogue+0x9/0x45
> [    0.560948]  handle_overflow+0x8b/0x98
> [    0.560953]  ? set_track+0x3f/0xad
> [    0.560958]  __ubsan_handle_mul_overflow+0xe/0x10
> [    0.560964]  drm_mode_vrefresh+0x4a/0xbc
> [    0.560970] initcall i915_init+0x0/0x6a returned 0 after 116076 usecs
> [    0.560974] calling  cn_proc_init+0x0/0x36 @ 1
> [    0.560978]  cea_mode_alternate_clock+0x11/0x62
> [    0.560985]  drm_match_cea_mode+0xc7/0x1e7
> [    0.560987] initcall cn_proc_init+0x0/0x36 returned 0 after 3 usecs
> [    0.560990] calling  topology_sysfs_init+0x0/0x2d @ 1
> [    0.561000]  drm_mode_validate_ycbcr420+0xd/0x48
> [    0.561005]  drm_helper_probe_single_connector_modes+0x6db/0x7da
> [    0.561012]  drm_client_modeset_probe+0x225/0x143f
> [    0.561018]  ? bitmap_fold+0x8a/0x8a
> [    0.561023]  ? update_cfs_rq_load_avg+0x192/0x1a2
> [    0.561029]  __drm_fb_helper_initial_config_and_unlock+0x3f/0x5b7
> [    0.561035]  ? get_sd_balance_interval+0x1c/0x40
> [    0.561040]  drm_fb_helper_initial_config+0x48/0x4f
> [    0.561047]  intel_fbdev_initial_config+0x13/0x23
> [    0.561052]  async_run_entry_fn+0x89/0x15c
> [    0.561058]  process_one_work+0x15c/0x1f3
> [    0.561064]  worker_thread+0x1ac/0x25d
> [    0.561069]  ? process_scheduled_works+0x2e/0x2e
> [    0.561074]  kthread+0x10e/0x116
> [    0.561078]  ? kthread_parkme+0x1c/0x1c
> [    0.561083]  ret_from_fork+0x22/0x30
> [    0.561087] ================================================================================
> 
> -- 
> ~Randy
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: dri-devel <dri-devel@lists.freedesktop.org>,
	LKML <linux-kernel@vger.kernel.org>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	intel-gfx <intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] drm_modes: signed integer overflow
Date: Thu, 22 Oct 2020 13:14:23 +0300	[thread overview]
Message-ID: <20201022101423.GI6112@intel.com> (raw)
In-Reply-To: <47527cdb-2eda-b5a3-d77c-3855b91a0b61@infradead.org>

On Wed, Oct 21, 2020 at 08:13:43PM -0700, Randy Dunlap wrote:
> Hi,
> 
> With linux-next 20201021, when booting up, I am seeing this:
> 
> [    0.560896] UBSAN: signed-integer-overflow in ../drivers/gpu/drm/drm_modes.c:765:20
> [    0.560903] 2376000 * 1000 cannot be represented in type 'int'

Dang. Didn't realize these new crazy >8k modes have dotclocks reaching
almost 6 GHz, which would overflow even u32. I guess we'll switch to
64bit maths. Now I wonder how many other places can hit this overflow
in practice...

> [    0.560909] CPU: 3 PID: 7 Comm: kworker/u16:0 Not tainted 5.9.0-next-20201021 #2
> [    0.560914] Hardware name: TOSHIBA PORTEGE R835/Portable PC, BIOS Version 4.10   01/08/2013
> [    0.560924] Workqueue: events_unbound async_run_entry_fn
> 
> [    0.560930] Call Trace:
> [    0.560938]  dump_stack+0x5e/0x74
> [    0.560943]  ubsan_epilogue+0x9/0x45
> [    0.560948]  handle_overflow+0x8b/0x98
> [    0.560953]  ? set_track+0x3f/0xad
> [    0.560958]  __ubsan_handle_mul_overflow+0xe/0x10
> [    0.560964]  drm_mode_vrefresh+0x4a/0xbc
> [    0.560970] initcall i915_init+0x0/0x6a returned 0 after 116076 usecs
> [    0.560974] calling  cn_proc_init+0x0/0x36 @ 1
> [    0.560978]  cea_mode_alternate_clock+0x11/0x62
> [    0.560985]  drm_match_cea_mode+0xc7/0x1e7
> [    0.560987] initcall cn_proc_init+0x0/0x36 returned 0 after 3 usecs
> [    0.560990] calling  topology_sysfs_init+0x0/0x2d @ 1
> [    0.561000]  drm_mode_validate_ycbcr420+0xd/0x48
> [    0.561005]  drm_helper_probe_single_connector_modes+0x6db/0x7da
> [    0.561012]  drm_client_modeset_probe+0x225/0x143f
> [    0.561018]  ? bitmap_fold+0x8a/0x8a
> [    0.561023]  ? update_cfs_rq_load_avg+0x192/0x1a2
> [    0.561029]  __drm_fb_helper_initial_config_and_unlock+0x3f/0x5b7
> [    0.561035]  ? get_sd_balance_interval+0x1c/0x40
> [    0.561040]  drm_fb_helper_initial_config+0x48/0x4f
> [    0.561047]  intel_fbdev_initial_config+0x13/0x23
> [    0.561052]  async_run_entry_fn+0x89/0x15c
> [    0.561058]  process_one_work+0x15c/0x1f3
> [    0.561064]  worker_thread+0x1ac/0x25d
> [    0.561069]  ? process_scheduled_works+0x2e/0x2e
> [    0.561074]  kthread+0x10e/0x116
> [    0.561078]  ? kthread_parkme+0x1c/0x1c
> [    0.561083]  ret_from_fork+0x22/0x30
> [    0.561087] ================================================================================
> 
> -- 
> ~Randy
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2020-10-22 10:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22  3:13 [Intel-gfx] drm_modes: signed integer overflow Randy Dunlap
2020-10-22  3:13 ` Randy Dunlap
2020-10-22  3:13 ` Randy Dunlap
2020-10-22 10:14 ` Ville Syrjälä [this message]
2020-10-22 10:14   ` [Intel-gfx] " Ville Syrjälä
2020-10-22 10:14   ` Ville Syrjälä
2020-10-23 15:14   ` Simon Ser
2020-10-23 15:14     ` Simon Ser
2020-10-23 15:14     ` Simon Ser
2020-10-23 15:27     ` Ville Syrjälä
2020-10-23 15:27       ` Ville Syrjälä
2020-10-23 15:27       ` Ville Syrjälä
2020-10-23 16:02       ` Simon Ser
2020-10-23 16:02         ` Simon Ser
2020-10-23 16:02         ` Simon Ser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201022101423.GI6112@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.