From: Kamal Mostafa <kamal@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
kernel-team@lists.ubuntu.com
Cc: "Bruno Prémont" <bonbons@linux-vserver.org>,
"Jiri Kosina" <jkosina@suse.cz>,
"Kamal Mostafa" <kamal@canonical.com>
Subject: [PATCH 57/93] HID: picolcd: Prevent NULL pointer dereference on _remove()
Date: Fri, 20 Sep 2013 13:08:52 -0700 [thread overview]
Message-ID: <1379707768-1804-58-git-send-email-kamal@canonical.com> (raw)
In-Reply-To: <1379707768-1804-1-git-send-email-kamal@canonical.com>
3.8.13.10 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Bruno=20Pr=C3=A9mont?= <bonbons@linux-vserver.org>
commit 1cde501bb4655e98fb832194beb88ac73be5a05d upstream.
When picolcd is switched into bootloader mode (for FW flashing) make
sure not to try to dereference NULL-pointers of feature-devices during
unplug/unbind.
This fixes following BUG:
BUG: unable to handle kernel NULL pointer dereference at 00000298
IP: [<f811f56b>] picolcd_exit_framebuffer+0x1b/0x80 [hid_picolcd]
*pde = 00000000
Oops: 0000 [#1]
Modules linked in: hid_picolcd syscopyarea sysfillrect sysimgblt fb_sys_fops
CPU: 0 PID: 15 Comm: khubd Not tainted 3.11.0-rc7-00002-g50d62d4 #2
EIP: 0060:[<f811f56b>] EFLAGS: 00010292 CPU: 0
EIP is at picolcd_exit_framebuffer+0x1b/0x80 [hid_picolcd]
Call Trace:
[<f811d1ab>] picolcd_remove+0xcb/0x120 [hid_picolcd]
[<c1469b09>] hid_device_remove+0x59/0xc0
[<c13464ca>] __device_release_driver+0x5a/0xb0
[<c134653f>] device_release_driver+0x1f/0x30
[<c134603d>] bus_remove_device+0x9d/0xd0
[<c13439a5>] device_del+0xd5/0x150
[<c14696a4>] hid_destroy_device+0x24/0x60
[<c1474cbb>] usbhid_disconnect+0x1b/0x40
...
Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/hid/hid-picolcd_cir.c | 3 ++-
drivers/hid/hid-picolcd_fb.c | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-picolcd_cir.c b/drivers/hid/hid-picolcd_cir.c
index a79e95b..1a79a1e 100644
--- a/drivers/hid/hid-picolcd_cir.c
+++ b/drivers/hid/hid-picolcd_cir.c
@@ -147,6 +147,7 @@ void picolcd_exit_cir(struct picolcd_data *data)
struct rc_dev *rdev = data->rc_dev;
data->rc_dev = NULL;
- rc_unregister_device(rdev);
+ if (rdev)
+ rc_unregister_device(rdev);
}
diff --git a/drivers/hid/hid-picolcd_fb.c b/drivers/hid/hid-picolcd_fb.c
index eb00357..104df56 100644
--- a/drivers/hid/hid-picolcd_fb.c
+++ b/drivers/hid/hid-picolcd_fb.c
@@ -595,10 +595,14 @@ err_nomem:
void picolcd_exit_framebuffer(struct picolcd_data *data)
{
struct fb_info *info = data->fb_info;
- struct picolcd_fb_data *fbdata = info->par;
+ struct picolcd_fb_data *fbdata;
unsigned long flags;
+ if (!info)
+ return;
+
device_remove_file(&data->hdev->dev, &dev_attr_fb_update_rate);
+ fbdata = info->par;
/* disconnect framebuffer from HID dev */
spin_lock_irqsave(&fbdata->lock, flags);
--
1.8.1.2
next prev parent reply other threads:[~2013-09-20 20:27 UTC|newest]
Thread overview: 94+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-20 20:07 [ 3.8.y.z extended stable ] Linux 3.8.13.10 stable review Kamal Mostafa
2013-09-20 20:07 ` [PATCH 01/93] Revert "net/core/sock.c: add missing VSOCK string in af_family_*_key_strings" Kamal Mostafa
2013-09-20 20:07 ` [PATCH 02/93] Revert "zram: use zram->lock to protect zram_free_page() in swap free notify path" Kamal Mostafa
2013-09-20 20:07 ` [PATCH 03/93] zram: allow request end to coincide with disksize Kamal Mostafa
2013-09-20 20:07 ` [PATCH 04/93] mtd: nand: fix NAND_BUSWIDTH_AUTO for x16 devices Kamal Mostafa
2013-09-20 20:08 ` [PATCH 05/93] HID: hidraw: correctly deallocate memory on device disconnect Kamal Mostafa
2013-09-20 20:08 ` [PATCH 06/93] xen-gnt: prevent adding duplicate gnt callbacks Kamal Mostafa
2013-09-20 20:08 ` [PATCH 07/93] ath9k: always clear ps filter bit on new assoc Kamal Mostafa
2013-09-20 20:08 ` [PATCH 08/93] ceph: Don't forget the 'up_read(&osdc->map_sem)' if met error Kamal Mostafa
2013-09-20 20:08 ` [PATCH 09/93] libceph: unregister request in __map_request failed and nofail == false Kamal Mostafa
2013-09-20 20:08 ` [PATCH 10/93] usb: config->desc.bLength may not exceed amount of data returned by the device Kamal Mostafa
2013-09-20 20:08 ` [PATCH 11/93] USB: cdc-wdm: fix race between interrupt handler and tasklet Kamal Mostafa
2013-09-20 20:08 ` [PATCH 12/93] powerpc: Handle unaligned ldbrx/stdbrx Kamal Mostafa
2013-09-20 20:08 ` [PATCH 13/93] intel-iommu: Fix leaks in pagetable freeing Kamal Mostafa
2013-09-20 20:08 ` [PATCH 14/93] drivers/misc/hpilo: Correct panic when an AUX iLO is detected Kamal Mostafa
2013-09-20 20:08 ` [PATCH 15/93] USB: handle LPM errors during device suspend correctly Kamal Mostafa
2013-09-20 20:08 ` [PATCH 16/93] xhci-plat: Don't enable legacy PCI interrupts Kamal Mostafa
2013-09-20 20:08 ` [PATCH 17/93] ath9k: fix rx descriptor related race condition Kamal Mostafa
2013-09-20 20:08 ` [PATCH 18/93] ath9k: avoid accessing MRC registers on single-chain devices Kamal Mostafa
2013-09-20 20:08 ` [PATCH 19/93] brcmsmac: Fix WARNING caused by lack of calls to dma_mapping_error() Kamal Mostafa
2013-09-20 20:08 ` [PATCH 20/93] ext4: simplify truncation code in ext4_setattr() Kamal Mostafa
2013-09-20 20:08 ` [PATCH 21/93] ext4: fix lost truncate due to race with writeback Kamal Mostafa
2013-09-20 20:08 ` [PATCH 22/93] ASoC: wm8960: Fix PLL register writes Kamal Mostafa
2013-09-20 20:08 ` [PATCH 23/93] rculist: list_first_or_null_rcu() should use list_entry_rcu() Kamal Mostafa
2013-09-20 20:08 ` [PATCH 24/93] USB: mos7720: use GFP_ATOMIC under spinlock Kamal Mostafa
2013-09-20 20:08 ` [PATCH 25/93] USB: mos7720: fix big-endian control requests Kamal Mostafa
2013-09-20 20:08 ` [PATCH 26/93] arm64: perf: fix group validation when using enable_on_exec Kamal Mostafa
2013-09-20 20:08 ` [PATCH 27/93] arm64: perf: fix ARMv8 EVTYPE_MASK to include NSH bit Kamal Mostafa
2013-09-20 20:08 ` [PATCH 28/93] staging: comedi: dt282x: dt282x_ai_insn_read() always fails Kamal Mostafa
2013-09-20 20:08 ` [PATCH 29/93] usb: ehci-mxc: check for pdata before dereferencing Kamal Mostafa
2013-09-20 20:08 ` [PATCH 30/93] mmc: tmio_mmc_dma: fix PIO fallback on SDHI Kamal Mostafa
2013-09-20 20:08 ` [PATCH 31/93] proc: Restrict mounting the proc filesystem Kamal Mostafa
2013-09-20 20:08 ` [PATCH 32/93] usb: xhci: Disable runtime PM suspend for quirky controllers Kamal Mostafa
2013-09-20 20:08 ` [PATCH 33/93] USB: OHCI: Allow runtime PM without system sleep Kamal Mostafa
2013-09-20 20:08 ` [PATCH 34/93] pinctrl: at91: fix get_pullup/down function return Kamal Mostafa
2013-09-20 20:08 ` [PATCH 35/93] ACPI / EC: Add HP Folio 13 to ec_dmi_table in order to skip DSDT scan Kamal Mostafa
2013-09-20 20:08 ` [PATCH 36/93] ACPI / EC: Add ASUSTEK L4R to quirk list in order to validate ECDT Kamal Mostafa
2013-09-20 20:08 ` [PATCH 37/93] HID: validate HID report id size Kamal Mostafa
2013-09-20 20:08 ` [PATCH 38/93] cpuidle: coupled: abort idle if pokes are pending Kamal Mostafa
2013-09-20 20:08 ` [PATCH 39/93] cpuidle: coupled: disable interrupts after entering safe state Kamal Mostafa
2013-09-20 20:08 ` [PATCH 40/93] cpuidle: coupled: fix race condition between pokes and " Kamal Mostafa
2013-09-20 20:08 ` [PATCH 41/93] of: Fix missing memory initialization on FDT unflattening Kamal Mostafa
2013-09-20 20:08 ` [PATCH 42/93] leds: wm831x-status: Request a REG resource Kamal Mostafa
2013-09-20 20:08 ` [PATCH 43/93] USB: fix build error when CONFIG_PM_SLEEP isn't enabled Kamal Mostafa
2013-09-20 20:08 ` [PATCH 44/93] clk: wm831x: Initialise wm831x pointer on init Kamal Mostafa
2013-09-20 20:08 ` [PATCH 45/93] drm/edid: add quirk for Medion MD30217PG Kamal Mostafa
2013-09-20 20:08 ` [PATCH 46/93] drm/radeon: fix endian bugs in hw i2c atom routines Kamal Mostafa
2013-09-20 20:08 ` [PATCH 47/93] drm/radeon: update line buffer allocation for dce4.1/5 Kamal Mostafa
2013-09-20 20:08 ` [PATCH 48/93] drm/radeon: update line buffer allocation for dce6 Kamal Mostafa
2013-09-20 20:08 ` [PATCH 49/93] drm/radeon: fix LCD record parsing Kamal Mostafa
2013-09-20 20:08 ` [PATCH 50/93] drm/radeon: fix resume on some rs4xx boards (v2) Kamal Mostafa
2013-09-20 20:08 ` [PATCH 51/93] drm/radeon: fix handling of variable sized arrays for router objects Kamal Mostafa
2013-09-20 20:08 ` [PATCH 52/93] radeon kms: fix uninitialised hotplug work usage in r100_irq_process() Kamal Mostafa
2013-09-20 20:08 ` [PATCH 53/93] pidns: Fix hang in zap_pid_ns_processes by sending a potentially extra wakeup Kamal Mostafa
2013-09-20 20:08 ` [PATCH 54/93] x86, smap: Handle csum_partial_copy_*_user() Kamal Mostafa
2013-09-20 20:08 ` [PATCH 55/93] Introduce [compat_]save_altstack_ex() to unbreak x86 SMAP Kamal Mostafa
2013-09-20 20:08 ` [PATCH 56/93] drm: fix DRM_IOCTL_MODE_GETFB handle-leak Kamal Mostafa
2013-09-20 20:08 ` Kamal Mostafa [this message]
2013-09-20 20:08 ` [PATCH 58/93] HID: battery: don't do DMA from stack Kamal Mostafa
2013-09-20 20:08 ` [PATCH 59/93] ALSA: hda - hdmi: Fallback to ALSA allocation when selecting CA Kamal Mostafa
2013-09-20 20:08 ` [PATCH 60/93] fuse: postpone end_page_writeback() in fuse_writepage_locked() Kamal Mostafa
2013-09-20 20:08 ` [PATCH 61/93] fuse: invalidate inode attributes on xattr modification Kamal Mostafa
2013-09-20 20:08 ` [PATCH 62/93] [media] media: coda: Fix DT driver data pointer for i.MX27 Kamal Mostafa
2013-09-20 20:08 ` [PATCH 63/93] [media] s5p-g2d: Fix registration failure Kamal Mostafa
2013-09-20 20:08 ` [PATCH 64/93] [media] DocBook: upgrade media_api DocBook version to 4.2 Kamal Mostafa
2013-09-20 20:09 ` [PATCH 65/93] [media] v4l2: added missing mutex.h include to v4l2-ctrls.h Kamal Mostafa
2013-09-20 20:09 ` [PATCH 66/93] [media] hdpvr: fix iteration over uninitialized lists in hdpvr_probe() Kamal Mostafa
2013-09-20 20:09 ` [PATCH 67/93] [media] exynos-gsc: Register v4l2 device Kamal Mostafa
2013-09-20 20:09 ` [PATCH 68/93] fuse: readdir: check for slash in names Kamal Mostafa
2013-09-20 20:09 ` [PATCH 69/93] MIPS: ath79: Fix ar933x watchdog clock Kamal Mostafa
2013-09-20 20:09 ` [PATCH 70/93] libceph: use pg_num_mask instead of pgp_num_mask for pg.seed calc Kamal Mostafa
2013-09-20 20:09 ` [PATCH 71/93] HID: pantherlord: validate output report details Kamal Mostafa
2013-09-20 20:09 ` [PATCH 72/93] HID: ntrig: validate feature " Kamal Mostafa
2013-09-20 20:09 ` [PATCH 73/93] HID: sensor-hub: " Kamal Mostafa
2013-09-20 20:09 ` [PATCH 74/93] HID: picolcd_core: validate output " Kamal Mostafa
2013-09-20 20:09 ` [PATCH 75/93] HID: check for NULL field when setting values Kamal Mostafa
2013-09-20 20:09 ` [PATCH 76/93] ARM: PCI: versatile: Fix map_irq function to match hardware Kamal Mostafa
2013-09-20 20:09 ` [PATCH 77/93] ARM: PCI: versatile: Fix PCI I/O Kamal Mostafa
2013-09-20 20:09 ` [PATCH 78/93] ARM: PCI: versatile: Fix SMAP register offsets Kamal Mostafa
2013-09-20 20:09 ` [PATCH 79/93] net: mvneta: properly disable HW PHY polling and ensure adjust_link() works Kamal Mostafa
2013-09-20 20:09 ` [PATCH 80/93] drm/i915: try not to lose backlight CBLV precision Kamal Mostafa
2013-09-20 20:09 ` [PATCH 81/93] crypto: api - Fix race condition in larval lookup Kamal Mostafa
2013-09-20 20:09 ` [PATCH 82/93] cifs: ensure that srv_mutex is held when dealing with ssocket pointer Kamal Mostafa
2013-09-20 20:09 ` [PATCH 83/93] CIFS: Fix a memory leak when a lease break comes Kamal Mostafa
2013-09-20 20:09 ` [PATCH 84/93] ALSA: hda - Add Toshiba Satellite C870 to MSI blacklist Kamal Mostafa
2013-09-20 20:09 ` [PATCH 85/93] lguest: Point to the right directory for the lguest launcher Kamal Mostafa
2013-09-20 20:09 ` [PATCH 86/93] powerpc: Default arch idle could cede processor on pseries Kamal Mostafa
2013-09-20 20:09 ` [PATCH 87/93] ASoC: mc13783: add spi errata fix Kamal Mostafa
2013-09-20 20:09 ` [PATCH 88/93] [SCSI] sd: Fix potential out-of-bounds access Kamal Mostafa
2013-09-20 20:09 ` [PATCH 89/93] pidns: fix vfork() after unshare(CLONE_NEWPID) Kamal Mostafa
2013-09-20 20:09 ` [PATCH 90/93] ocfs2: fix the end cluster offset of FIEMAP Kamal Mostafa
2013-09-20 20:09 ` [PATCH 91/93] mm/huge_memory.c: fix potential NULL pointer dereference Kamal Mostafa
2013-09-20 20:09 ` [PATCH 92/93] mm: fix aio performance regression for database caused by THP Kamal Mostafa
2013-09-20 20:09 ` [PATCH 93/93] memcg: fix multiple large threshold notifications Kamal Mostafa
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=1379707768-1804-58-git-send-email-kamal@canonical.com \
--to=kamal@canonical.com \
--cc=bonbons@linux-vserver.org \
--cc=jkosina@suse.cz \
--cc=kernel-team@lists.ubuntu.com \
--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
all inboxes | Powered by JetHome®