linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Kangjie Lu <kjlu@umn.edu>, Daniel Vetter <daniel.vetter@ffwll.ch>,
	Sasha Levin <sashal@kernel.org>,
	dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 4.4 30/71] drm/gma500: fix memory disclosures due to uninitialized bytes
Date: Tue, 10 Dec 2019 17:32:35 -0500	[thread overview]
Message-ID: <20191210223316.14988-30-sashal@kernel.org> (raw)
In-Reply-To: <20191210223316.14988-1-sashal@kernel.org>

From: Kangjie Lu <kjlu@umn.edu>

[ Upstream commit ec3b7b6eb8c90b52f61adff11b6db7a8db34de19 ]

"clock" may be copied to "best_clock". Initializing best_clock
is not sufficient. The fix initializes clock as well to avoid
memory disclosures and informaiton leaks.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20191018044150.1899-1-kjlu@umn.edu
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/gma500/oaktrail_crtc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/gma500/oaktrail_crtc.c b/drivers/gpu/drm/gma500/oaktrail_crtc.c
index 1048f0c7c6ce7..31e0899035f98 100644
--- a/drivers/gpu/drm/gma500/oaktrail_crtc.c
+++ b/drivers/gpu/drm/gma500/oaktrail_crtc.c
@@ -139,6 +139,7 @@ static bool mrst_sdvo_find_best_pll(const struct gma_limit_t *limit,
 	s32 freq_error, min_error = 100000;
 
 	memset(best_clock, 0, sizeof(*best_clock));
+	memset(&clock, 0, sizeof(clock));
 
 	for (clock.m = limit->m.min; clock.m <= limit->m.max; clock.m++) {
 		for (clock.n = limit->n.min; clock.n <= limit->n.max;
@@ -195,6 +196,7 @@ static bool mrst_lvds_find_best_pll(const struct gma_limit_t *limit,
 	int err = target;
 
 	memset(best_clock, 0, sizeof(*best_clock));
+	memset(&clock, 0, sizeof(clock));
 
 	for (clock.m = limit->m.min; clock.m <= limit->m.max; clock.m++) {
 		for (clock.p1 = limit->p1.min; clock.p1 <= limit->p1.max;
-- 
2.20.1


  parent reply	other threads:[~2019-12-10 22:34 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 22:32 [PATCH AUTOSEL 4.4 01/71] drm: mst: Fix query_payload ack reply struct Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 02/71] iio: light: bh1750: Resolve compiler warning and make code more readable Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 03/71] iio: tcs3414: fix iio_triggered_buffer_{pre,post}enable positions Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 04/71] spi: Add call to spi_slave_abort() function when spidev driver is released Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 05/71] staging: rtl8188eu: fix possible null dereference Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 06/71] rtlwifi: prevent memory leak in rtl_usb_probe Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 07/71] IB/iser: bound protection_sg size by data_sg size Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 08/71] media: am437x-vpfe: Setting STD to current value is not an error Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 09/71] media: i2c: ov2659: fix s_stream return value Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 10/71] media: i2c: ov2659: Fix missing 720p register config Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 11/71] media: ov6650: Fix stored frame format not in sync with hardware Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 12/71] tools/power/cpupower: Fix initializer override in hsw_ext_cstates Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 13/71] usb: renesas_usbhs: add suspend event support in gadget mode Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 14/71] hwrng: omap3-rom - Call clk_disable_unprepare() on exit only if not idled Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 15/71] regulator: max8907: Fix the usage of uninitialized variable in max8907_regulator_probe() Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 16/71] media: flexcop-usb: fix NULL-ptr deref in flexcop_usb_transfer_init() Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 17/71] samples: pktgen: fix proc_cmd command result check logic Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 18/71] iio: proximity: sx9500: fix iio_triggered_buffer_{predisable,postenable} positions Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 19/71] mwifiex: pcie: Fix memory leak in mwifiex_pcie_init_evt_ring Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 20/71] media: ti-vpe: vpe: fix a v4l2-compliance warning about invalid pixel format Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 21/71] media: ti-vpe: vpe: fix a v4l2-compliance failure about frame sequence number Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 22/71] media: ti-vpe: vpe: Make sure YUYV is set as default format Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 23/71] extcon: sm5502: Reset registers during initialization Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 24/71] x86/mm: Use the correct function type for native_set_fixmap() Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 25/71] perf report: Add warning when libunwind not compiled in Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 26/71] usb: usbfs: Suppress problematic bind and unbind uevents Sasha Levin
2019-12-11  7:47   ` Greg Kroah-Hartman
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 27/71] iio: adc: max1027: Reset the device at probe time Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 28/71] iio: dac: ad7303: replace mlock with own lock Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 29/71] Bluetooth: hci_core: fix init for HCI_USER_CHANNEL Sasha Levin
2019-12-10 22:32 ` Sasha Levin [this message]
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 31/71] x86/ioapic: Prevent inconsistent state when moving an interrupt Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 32/71] arm64: psci: Reduce the waiting time for cpu_psci_cpu_kill() Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 33/71] ALSA: hda - Fix pending unsol events at shutdown Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 34/71] libata: Ensure ata_port probe has completed before detach Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 35/71] ata: sata_mv, avoid trigerrable BUG_ON Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 36/71] pinctrl: sh-pfc: sh7734: Fix duplicate TCLK1_B Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 37/71] bnx2x: Fix PF-VF communication over multi-cos queues Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 38/71] spi: img-spfi: fix potential double release Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 39/71] rtlwifi: fix memory leak in rtl92c_set_fw_rsvdpagepkt() Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 40/71] perf probe: Fix to find range-only function instance Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 41/71] perf probe: Fix to list probe event with correct line number Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 42/71] perf probe: Walk function lines in lexical blocks Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 43/71] perf probe: Fix to probe an inline function which has no entry pc Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 44/71] perf probe: Fix to show ranges of variables in functions without entry_pc Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 45/71] perf probe: Fix to show inlined function callsite " Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 46/71] perf probe: Skip overlapped location on searching variables Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 47/71] perf probe: Return a better scope DIE if there is no best scope Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 48/71] perf probe: Fix to show calling lines of inlined functions Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 49/71] perf probe: Skip end-of-sequence and non statement lines Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 50/71] perf probe: Filter out instances except for inlined subroutine and subprogram Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 51/71] ath10k: fix get invalid tx rate for Mesh metric Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 52/71] media: pvrusb2: Fix oops on tear-down when radio support is not present Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 53/71] media: si470x-i2c: add missed operations in remove Sasha Levin
2019-12-10 22:32 ` [PATCH AUTOSEL 4.4 54/71] EDAC/ghes: Fix grain calculation Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 55/71] spi: pxa2xx: Add missed security checks Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 56/71] ASoC: rt5677: Mark reg RT5677_PWR_ANLG2 as volatile Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 57/71] net: bcmgenet: Add RGMII_RXID support Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 58/71] parport: load lowlevel driver if ports not found Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 59/71] cpufreq: Register drivers only after CPU devices have been registered Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 60/71] x86/crash: Add a forward declaration of struct kimage Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 61/71] RDMA/qib: Validate ->show()/store() callbacks before calling them Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 62/71] spi: tegra20-slink: add missed clk_unprepare Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 63/71] btrfs: don't prematurely free work in end_workqueue_fn() Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 64/71] iwlwifi: check kasprintf() return value Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 65/71] fbtft: Make sure string is NULL terminated Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 66/71] crypto: sun4i-ss - Fix 64-bit size_t warnings on sun4i-ss-hash.c Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 67/71] crypto: vmx - Avoid weird build failures Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 68/71] libtraceevent: Fix memory leakage in copy_filter_type Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 69/71] perf parse: Fix potential memory leak when handling tracepoint errors Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 70/71] perf intel-bts: Does not support AUX area sampling Sasha Levin
2019-12-10 22:33 ` [PATCH AUTOSEL 4.4 71/71] net: phy: initialise phydev speed and duplex sanely Sasha Levin

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=20191210223316.14988-30-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).