From: Kamal Mostafa <kamal@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
kernel-team@lists.ubuntu.com
Cc: Stephane Grosjean <s.grosjean@peak-system.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
"David S. Miller" <davem@davemloft.net>,
Kamal Mostafa <kamal@canonical.com>
Subject: [PATCH 07/58] can: pcan_usb: fix wrong memcpy() bytes length
Date: Tue, 3 Sep 2013 09:23:11 -0700 [thread overview]
Message-ID: <1378225442-20654-8-git-send-email-kamal@canonical.com> (raw)
In-Reply-To: <1378225442-20654-1-git-send-email-kamal@canonical.com>
3.8.13.8 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephane Grosjean <s.grosjean@peak-system.com>
commit 3c322a56b01695df15c70bfdc2d02e0ccd80654e upstream.
Fix possibly wrong memcpy() bytes length since some CAN records received from
PCAN-USB could define a DLC field in range [9..15].
In that case, the real DLC value MUST be used to move forward the record pointer
but, only 8 bytes max. MUST be copied into the data field of the struct
can_frame object of the skb given to the network core.
Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/net/can/usb/peak_usb/pcan_usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c
index 25723d8..925ab8e 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb.c
@@ -649,7 +649,7 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len)
if ((mc->ptr + rec_len) > mc->end)
goto decode_failed;
- memcpy(cf->data, mc->ptr, rec_len);
+ memcpy(cf->data, mc->ptr, cf->can_dlc);
mc->ptr += rec_len;
}
--
1.8.1.2
next prev parent reply other threads:[~2013-09-03 16:36 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-03 16:23 [ 3.8.y.z extended stable ] Linux 3.8.13.8 stable review Kamal Mostafa
2013-09-03 16:23 ` [PATCH 01/58] mac80211: fix infinite loop in ieee80211_determine_chantype Kamal Mostafa
2013-09-03 16:23 ` [PATCH 02/58] cfg80211/mac80211: disconnect on suspend Kamal Mostafa
2013-09-03 16:23 ` [PATCH 03/58] cfg80211: fix P2P GO interface teardown Kamal Mostafa
2013-09-03 16:23 ` [PATCH 04/58] iwl4965: set power mode early Kamal Mostafa
2013-09-03 16:23 ` [PATCH 05/58] iwl4965: reset firmware after rfkill off Kamal Mostafa
2013-09-03 16:23 ` [PATCH 06/58] ASoC: cs42l52: Reorder Min/Max and update to SX_TLV for Beep Volume Kamal Mostafa
2013-09-03 16:23 ` Kamal Mostafa [this message]
2013-09-03 16:23 ` [PATCH 08/58] ALSA: 6fire: make buffers DMA-able (pcm) Kamal Mostafa
2013-09-03 16:23 ` [PATCH 09/58] ALSA: 6fire: make buffers DMA-able (midi) Kamal Mostafa
2013-09-03 16:23 ` [PATCH 10/58] jbd2: Fix use after free after error in jbd2_journal_dirty_metadata() Kamal Mostafa
2013-09-03 16:23 ` [PATCH 11/58] USB: EHCI: accept very late isochronous URBs Kamal Mostafa
2013-09-03 16:23 ` [PATCH 12/58] USB-Serial: Fix error handling of usb_wwan Kamal Mostafa
2013-09-03 16:23 ` [PATCH 13/58] USB: mos7840: fix big-endian probe Kamal Mostafa
2013-09-03 16:23 ` [PATCH 14/58] USB: adutux: fix big-endian device-type reporting Kamal Mostafa
2013-09-03 16:23 ` [PATCH 15/58] USB: ti_usb_3410_5052: fix big-endian firmware handling Kamal Mostafa
2013-09-03 16:23 ` [PATCH 16/58] ARM: 7809/1: perf: fix event validation for software group leaders Kamal Mostafa
2013-09-03 16:23 ` [PATCH 17/58] m68k/atari: ARAnyM - Fix NatFeat module support Kamal Mostafa
2013-09-03 16:23 ` [PATCH 18/58] m68k: Truncate base in do_div() Kamal Mostafa
2013-09-03 16:23 ` [PATCH 19/58] usb: add two quirky touchscreen Kamal Mostafa
2013-09-03 16:23 ` [PATCH 20/58] USB: mos7720: fix broken control requests Kamal Mostafa
2013-09-03 16:23 ` [PATCH 21/58] USB: keyspan: fix null-deref at disconnect and release Kamal Mostafa
2013-09-03 16:23 ` [PATCH 22/58] ASoC: tegra: fix Tegra30 I2S capture parameter setup Kamal Mostafa
2013-09-03 16:23 ` [PATCH 23/58] ALSA: hda - Add a fixup for Gateway LT27 Kamal Mostafa
2013-09-03 16:23 ` [PATCH 24/58] mm: fix the TLB range flushed when __tlb_remove_page() runs out of slots Kamal Mostafa
2013-09-03 16:23 ` [PATCH 25/58] arch, mm: Remove tlb_fast_mode() Kamal Mostafa
2013-09-03 16:23 ` [PATCH 26/58] Fix TLB gather virtual address range invalidation corner cases Kamal Mostafa
2013-09-03 16:23 ` [PATCH 27/58] s390: Fix broken build Kamal Mostafa
2013-09-03 16:23 ` [PATCH 28/58] x86 get_unmapped_area: Access mmap_legacy_base through mm_struct member Kamal Mostafa
2013-09-03 16:23 ` [PATCH 29/58] Bluetooth: Add support for Foxconn/Hon Hai [0489:e04d] Kamal Mostafa
2013-09-03 16:23 ` [PATCH 30/58] Bluetooth: ath3k: Add support for Fujitsu Lifebook UH5x2 [04c5:1330] Kamal Mostafa
2013-09-03 16:23 ` [PATCH 31/58] Bluetooth: ath3k: Add support for ID 0x13d3/0x3402 Kamal Mostafa
2013-09-03 16:23 ` [PATCH 32/58] Bluetooth: Add support for Atheros [0cf3:3121] Kamal Mostafa
2013-09-03 16:23 ` [PATCH 33/58] Bluetooth: Add support for Atheros [0cf3:e003] Kamal Mostafa
2013-09-03 16:23 ` [PATCH 34/58] iwlwifi: dvm: fix calling ieee80211_chswitch_done() with NULL Kamal Mostafa
2013-09-03 16:23 ` [PATCH 35/58] iwlwifi: pcie: disable L1 Active after pci_enable_device Kamal Mostafa
2013-09-03 16:23 ` [PATCH 36/58] zd1201: do not use stack as URB transfer_buffer Kamal Mostafa
2013-09-03 16:23 ` [PATCH 37/58] Hostap: copying wrong data prism2_ioctl_giwaplist() Kamal Mostafa
2013-09-03 16:23 ` [PATCH 38/58] ARM: at91/DT: fix at91sam9n12ek memory node Kamal Mostafa
2013-09-03 16:23 ` [PATCH 39/58] drm/i915: Move num_pipes to intel info Kamal Mostafa
2013-09-03 16:23 ` [PATCH 40/58] drm/i915: Don't deref pipe->cpu_transcoder in the hangcheck code Kamal Mostafa
2013-09-03 16:23 ` [PATCH 41/58] drm/i915: Invalidate TLBs for the rings after a reset Kamal Mostafa
2013-09-03 16:23 ` [PATCH 42/58] libata: apply behavioral quirks to sil3826 PMP Kamal Mostafa
2013-09-03 16:23 ` [PATCH 43/58] ARM: davinci: nand: specify ecc strength Kamal Mostafa
2013-09-03 16:23 ` [PATCH 44/58] ARM: allow kuser helpers to be removed from the vector page Kamal Mostafa
2013-09-03 16:23 ` [PATCH 45/58] ARM: 7816/1: CONFIG_KUSER_HELPERS: fix help text Kamal Mostafa
2013-09-03 16:23 ` [PATCH 46/58] arm64: perf: fix array out of bounds access in armpmu_map_hw_event() Kamal Mostafa
2013-09-03 16:23 ` [PATCH 47/58] arm64: perf: fix event validation for software group leaders Kamal Mostafa
2013-09-03 16:23 ` [PATCH 48/58] sata_fsl: save irqs while coalescing Kamal Mostafa
2013-09-03 16:23 ` [PATCH 49/58] xen/events: initialize local per-cpu mask for all possible events Kamal Mostafa
2013-09-03 16:23 ` [PATCH 50/58] xen/events: mask events when changing their VCPU binding Kamal Mostafa
2013-09-03 16:23 ` [PATCH 51/58] block: Add bio_for_each_segment_all() Kamal Mostafa
2013-09-03 16:23 ` [PATCH 52/58] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal Kamal Mostafa
2013-09-03 16:23 ` [PATCH 53/58] of: fdt: fix memory initialization for expanded DT Kamal Mostafa
2013-09-03 16:23 ` [PATCH 54/58] [SCSI] zfcp: fix lock imbalance by reworking request queue locking Kamal Mostafa
2013-09-03 16:23 ` [PATCH 55/58] [SCSI] zfcp: fix schedule-inside-lock in scsi_device list loops Kamal Mostafa
2013-09-03 16:24 ` [PATCH 56/58] drivers/platform/olpc/olpc-ec.c: initialise earlier Kamal Mostafa
2013-09-03 16:24 ` [PATCH 57/58] nilfs2: remove double bio_put() in nilfs_end_bio_write() for BIO_EOPNOTSUPP error Kamal Mostafa
2013-09-03 16:24 ` [PATCH 58/58] nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection 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=1378225442-20654-8-git-send-email-kamal@canonical.com \
--to=kamal@canonical.com \
--cc=davem@davemloft.net \
--cc=kernel-team@lists.ubuntu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=s.grosjean@peak-system.com \
--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®