mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luis Henriques <luis.henriques@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	kernel-team@lists.ubuntu.com
Cc: Steve Cornelius <steve.cornelius@freescale.com>,
	Victoria Milhoan <vicki.milhoan@freescale.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Luis Henriques <luis.henriques@canonical.com>
Subject: [PATCH 3.16.y-ckt 67/71] crypto: caam - improve initalization for context state saves
Date: Thu, 25 Jun 2015 11:02:46 +0100	[thread overview]
Message-ID: <1435226570-3669-68-git-send-email-luis.henriques@canonical.com> (raw)
In-Reply-To: <1435226570-3669-1-git-send-email-luis.henriques@canonical.com>

3.16.7-ckt14 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: Steve Cornelius <steve.cornelius@freescale.com>

commit 6fd4b15603124c1b56e03db29b41ec39d8a077b9 upstream.

Multiple function in asynchronous hashing use a saved-state block,
a.k.a. struct caam_hash_state, which holds a stash of information
between requests (init/update/final). Certain values in this state
block are loaded for processing using an inline-if, and when this
is done, the potential for uninitialized data can pose conflicts.
Therefore, this patch improves initialization of state data to
prevent false assignments using uninitialized data in the state block.

This patch addresses the following traceback, originating in
ahash_final_ctx(), although a problem like this could certainly
exhibit other symptoms:

kernel BUG at arch/arm/mm/dma-mapping.c:465!
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = 80004000
[00000000] *pgd=00000000
Internal error: Oops: 805 [#1] PREEMPT SMP
Modules linked in:
CPU: 0    Not tainted  (3.0.15-01752-gdd441b9-dirty #40)
PC is at __bug+0x1c/0x28
LR is at __bug+0x18/0x28
pc : [<80043240>]    lr : [<8004323c>]    psr: 60000013
sp : e423fd98  ip : 60000013  fp : 0000001c
r10: e4191b84  r9 : 00000020  r8 : 00000009
r7 : 88005038  r6 : 00000001  r5 : 2d676572  r4 : e4191a60
r3 : 00000000  r2 : 00000001  r1 : 60000093  r0 : 00000033
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: 1000404a  DAC: 00000015
Process cryptomgr_test (pid: 1306, stack limit = 0xe423e2f0)
Stack: (0xe423fd98 to 0xe4240000)
fd80:                                                       11807fd1 80048544
fda0: 88005000 e4191a00 e5178040 8039dda0 00000000 00000014 2d676572 e4191008
fdc0: 88005018 e4191a60 00100100 e4191a00 00000000 8039ce0c e423fea8 00000007
fde0: e4191a00 e4227000 e5178000 8039ce18 e419183c 80203808 80a94a44 00000006
fe00: 00000000 80207180 00000000 00000006 e423ff08 00000000 00000007 e5178000
fe20: e41918a4 80a949b4 8c4844e2 00000000 00000049 74227000 8c4844e2 00000e90
fe40: 0000000e 74227e90 ffff8c58 80ac29e0 e423fed4 8006a350 8c81625c e423ff5c
fe60: 00008576 e4002500 00000003 00030010 e4002500 00000003 e5180000 e4002500
fe80: e5178000 800e6d24 007fffff 00000000 00000010 e4001280 e4002500 60000013
fea0: 000000d0 804df078 00000000 00000000 00000000 00000000 00000000 00000000
fec0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
fee0: 00000000 00000000 e4227000 e4226000 e4753000 e4752000 e40a5000 e40a4000
ff00: e41e7000 e41e6000 00000000 00000000 00000000 e423ff14 e423ff14 00000000
ff20: 00000400 804f9080 e5178000 e4db0b40 00000000 e4db0b80 0000047c 00000400
ff40: 00000000 8020758c 00000400 ffffffff 0000008a 00000000 e4db0b40 80206e00
ff60: e4049dbc 00000000 00000000 00000003 e423ffa4 80062978 e41a8bfc 00000000
ff80: 00000000 e4049db4 00000013 e4049db0 00000013 00000000 00000000 00000000
ffa0: e4db0b40 e4db0b40 80204cbc 00000013 00000000 00000000 00000000 80204cfc
ffc0: e4049da0 80089544 80040a40 00000000 e4db0b40 00000000 00000000 00000000
ffe0: e423ffe0 e423ffe0 e4049da0 800894c4 80040a40 80040a40 00000000 00000000
[<80043240>] (__bug+0x1c/0x28) from [<80048544>] (___dma_single_dev_to_cpu+0x84)
[<80048544>] (___dma_single_dev_to_cpu+0x84/0x94) from [<8039dda0>] (ahash_fina)
[<8039dda0>] (ahash_final_ctx+0x180/0x428) from [<8039ce18>] (ahash_final+0xc/0)
[<8039ce18>] (ahash_final+0xc/0x10) from [<80203808>] (crypto_ahash_op+0x28/0xc)
[<80203808>] (crypto_ahash_op+0x28/0xc0) from [<80207180>] (test_hash+0x214/0x5)
[<80207180>] (test_hash+0x214/0x5b8) from [<8020758c>] (alg_test_hash+0x68/0x8c)
[<8020758c>] (alg_test_hash+0x68/0x8c) from [<80206e00>] (alg_test+0x7c/0x1b8)
[<80206e00>] (alg_test+0x7c/0x1b8) from [<80204cfc>] (cryptomgr_test+0x40/0x48)
[<80204cfc>] (cryptomgr_test+0x40/0x48) from [<80089544>] (kthread+0x80/0x88)
[<80089544>] (kthread+0x80/0x88) from [<80040a40>] (kernel_thread_exit+0x0/0x8)
Code: e59f0010 e1a01003 eb126a8d e3a03000 (e5833000)
---[ end trace d52a403a1d1eaa86 ]---

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/crypto/caam/caamhash.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index eea7ae823947..7e050b85b4f2 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -1460,6 +1460,8 @@ static int ahash_init(struct ahash_request *req)
 
 	state->current_buf = 0;
 	state->buf_dma = 0;
+	state->buflen_0 = 0;
+	state->buflen_1 = 0;
 
 	return 0;
 }

  parent reply	other threads:[~2015-06-25 10:08 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 10:01 [3.16.y-ckt stable] Linux 3.16.7-ckt14 stable review Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 01/71] iio: adis16400: Report pressure channel scale Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 02/71] iio: adis16400: Use != channel indices for the two voltage channels Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 03/71] iio: adis16400: Compute the scan mask from channel indices Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 04/71] iio: adis16400: Remove unused variable Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 05/71] iio: adis16400: Fix burst mode Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 06/71] iio: adis16400: Fix burst transfer for adis16448 Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 07/71] USB: serial: ftdi_sio: Add support for a Motion Tracker Development Board Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 08/71] iio: adc: twl6030-gpadc: Fix modalias Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 09/71] serial: imx: Fix DMA handling for IDLE condition aborts Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 10/71] usb: dwc3: gadget: Fix incorrect DEPCMD and DGCMD status macros Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 11/71] ALSA: usb-audio: Add mic volume fix quirk for Logitech Quickcam Fusion Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 12/71] ozwpan: Use proper check to prevent heap overflow Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 13/71] ozwpan: Use unsigned ints " Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 14/71] ozwpan: divide-by-zero leading to panic Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 15/71] ozwpan: unchecked signed subtraction leads to DoS Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 16/71] n_tty: Fix auditing support for cannonical mode Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 17/71] drm/i915/hsw: Fix workaround for server AUX channel clock divisor Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 18/71] x86/asm/irq: Stop relying on magic JMP behavior for early_idt_handlers Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 19/71] lib: Fix strnlen_user() to not touch memory after specified maximum Luis Henriques
2015-06-25 10:01 ` [PATCH 3.16.y-ckt 20/71] Input: elantech - fix detection of touchpads where the revision matches a known rate Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 21/71] ALSA: hda/realtek - Add a fixup for another Acer Aspire 9420 Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 22/71] ALSA: usb-audio: add MAYA44 USB+ mixer control names Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 23/71] ALSA: usb-audio: fix missing input volume controls in MAYA44 USB(+) Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 24/71] USB: cp210x: add ID for HubZ dual ZigBee and Z-Wave dongle Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 25/71] Input: elantech - add new icbody type Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 26/71] MIPS: Fix enabling of DEBUG_STACKOVERFLOW Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 27/71] xfrm: fix a race in xfrm_state_lookup_byspi Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 28/71] kconfig: Fix warning "‘jump’ may be used uninitialized" Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 29/71] scripts/sortextable: suppress warning: `relocs_size' may be used uninitialized Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 30/71] thermal: step_wise: Revert optimization Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 31/71] MIPS: KVM: Do not sign extend on unsigned MMIO load Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 32/71] arch/x86/kvm/mmu.c: work around gcc-4.4.4 bug Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 33/71] net: core: Correct an over-stringent device loop detection Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 34/71] net: phy: Allow EEE for all RGMII variants Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 35/71] net: dp83640: fix broken calibration routine Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 36/71] net: dp83640: reinforce locking rules Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 37/71] unix/caif: sk_socket can disappear when state is unlocked Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 38/71] xen/netback: Properly initialize credit_bytes Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 39/71] udp: fix behavior of wrong checksums Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 40/71] xen: netback: read hotplug script once at start of day Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 41/71] ipv4/udp: Verify multicast group is ours in upd_v4_early_demux() Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 42/71] bridge: disable softirqs around br_fdb_update to avoid lockup Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 43/71] drm/i915: Assume dual channel LVDS if pixel clock necessitates it Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 44/71] Btrfs: send, add missing check for dead clone root Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 45/71] Btrfs: send, don't leave without decrementing clone root's send_progress Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 46/71] btrfs: incorrect handling for fiemap_fill_next_extent return Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 47/71] btrfs: cleanup orphans while looking up default subvolume Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 48/71] Drivers: hv: vmbus: Add support for VMBus panic notifier handler Luis Henriques
2015-06-30 16:19   ` Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 49/71] Drivers: hv: vmbus: Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 50/71] iommu/vt-d: Allow RMRR on graphics devices too Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 51/71] iommu/vt-d: Fix passthrough mode with translation-disabled devices Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 52/71] ata: ahci_mvebu: Fix wrongly set base address for the MBus window setting Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 53/71] virtio_pci: Clear stale cpumask when setting irq affinity Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 54/71] irqchip: sunxi-nmi: Fix off-by-one error in irq iterator Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 55/71] pata_octeon_cf: fix broken build Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 56/71] Input: synaptics - add min/max quirk for Lenovo S540 Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 57/71] drm/i915: Fix DDC probe for passive adapters Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 58/71] cfg80211: wext: clear sinfo struct before calling driver Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 59/71] mm/memory_hotplug.c: set zone->wait_table to null after freeing it Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 60/71] ring-buffer-benchmark: Fix the wrong sched_priority of producer Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 61/71] block: fix ext_dev_lock lockdep report Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 62/71] iser-target: Fix variable-length response error completion Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 63/71] iser-target: release stale iser connections Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 64/71] ALSA: hda - adding a DAC/pin preference map for a HP Envy TS machine Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 65/71] drm/mgag200: Reject non-character-cell-aligned mode widths Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 66/71] crypto: caam - fix uninitialized state->buf_dma field Luis Henriques
2015-06-25 10:02 ` Luis Henriques [this message]
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 68/71] crypto: caam - fix RNG buffer cache alignment Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 69/71] tracing: Have filter check for balanced ops Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 70/71] drm/radeon: fix freeze for laptop with Turks/Thames GPU Luis Henriques
2015-06-25 10:02 ` [PATCH 3.16.y-ckt 71/71] Revert "tools/vm: fix page-flags build" Luis Henriques

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=1435226570-3669-68-git-send-email-luis.henriques@canonical.com \
    --to=luis.henriques@canonical.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=steve.cornelius@freescale.com \
    --cc=vicki.milhoan@freescale.com \
    /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®