]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
stm class: Prevent division by zero
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Thu, 21 Feb 2019 12:19:17 +0000 (14:19 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitd38eec54e1aca84b3a4df107158b60111550ad0c
tree3812473b67765f2a775af80b2fcc9fc9495ab81a
parentf1eeb90723a4db100d10f843dfc716778e7fc802
stm class: Prevent division by zero

BugLink: https://bugs.launchpad.net/bugs/1837952
commit bf7cbaae0831252b416f375ca9b1027ecd4642dd upstream.

Using STP_POLICY_ID_SET ioctl command with dummy_stm device, or any STM
device that supplies zero mmio channel size, will trigger a division by
zero bug in the kernel.

Prevent this by disallowing channel widths other than 1 for such devices.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Fixes: 7bd1d4093c2f ("stm class: Introduce an abstraction for System Trace Module devices")
CC: stable@vger.kernel.org # v4.4+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hwtracing/stm/core.c