Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

Commit

Permalink
Merge tag 'v3.18.119' into XOS-8.1
Browse files Browse the repository at this point in the history
This is the 3.18.119 stable release

* tag 'v3.18.119':
  Linux 3.18.119
  Bluetooth: hidp: buffer overflow in hidp_process_report
  crypto: ablkcipher - fix crash flushing dcache in error path
  crypto: blkcipher - fix crash flushing dcache in error path
  crypto: vmac - separate tfm and request context
  crypto: vmac - require a block cipher with 128-bit block size
  kbuild: verify that $DEPMOD is installed
  i2c: ismt: fix wrong device address when unmap the data buffer
  mm: slub: fix format mismatches in slab_err() callers
  ALSA: info: Check for integer overflow in snd_info_entry_write()
  kprobes/x86: Fix %p uses in error messages
  ARM: dts: imx6sx: fix irq for pcie bridge
  fix __legitimize_mnt()/mntput() race
  fix mntput/mntput race
  root dentries need RCU-delayed freeing
  xen/netfront: don't cache skb_shinfo()
  • Loading branch information
Harsh Shandilya committed Aug 17, 2018
2 parents 53af094 + 18e6ee0 commit 4c789a1
Show file tree
Hide file tree
Showing 15 changed files with 293 additions and 380 deletions.
17 changes: 6 additions & 11 deletions Documentation/Changes
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ o Gnu C 3.2 # gcc --version
o Gnu make 3.80 # make --version
o binutils 2.12 # ld -v
o util-linux 2.10o # fdformat --version
o module-init-tools 0.9.10 # depmod -V
o kmod 13 # depmod -V
o e2fsprogs 1.41.4 # e2fsck -V
o jfsutils 1.1.3 # fsck.jfs -V
o reiserfsprogs 3.6.3 # reiserfsck -V
Expand Down Expand Up @@ -119,12 +119,6 @@ is not build with CONFIG_KALLSYMS and you have no way to rebuild and
reproduce the Oops with that option, then you can still decode that Oops
with ksymoops.

Module-Init-Tools
-----------------

A new module loader is now in the kernel that requires module-init-tools
to use. It is backward compatible with the 2.4.x series kernels.

Mkinitrd
--------

Expand Down Expand Up @@ -302,14 +296,15 @@ Util-linux
----------
o <ftp://ftp.kernel.org/pub/linux/utils/util-linux/>

Kmod
----
o <https://www.kernel.org/pub/linux/utils/kernel/kmod/>
o <https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git>

Ksymoops
--------
o <ftp://ftp.kernel.org/pub/linux/utils/kernel/ksymoops/v2.4/>

Module-Init-Tools
-----------------
o <ftp://ftp.kernel.org/pub/linux/kernel/people/rusty/modules/>

Mkinitrd
--------
o <https://code.launchpad.net/initrd-tools/main>
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 18
SUBLEVEL = 118
SUBLEVEL = 119
EXTRAVERSION =
NAME = Diseased Newt

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/imx6sx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@
/* non-prefetchable memory */
0x82000000 0 0x08000000 0x08000000 0 0x00f00000>;
num-lanes = <1>;
interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6SX_CLK_PCIE_REF_125M>,
<&clks IMX6SX_CLK_PCIE_AXI>,
<&clks IMX6SX_CLK_LVDS1_OUT>,
Expand Down
4 changes: 1 addition & 3 deletions arch/x86/kernel/kprobes/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ int __copy_instruction(u8 *dest, u8 *src)
newdisp = (u8 *) src + (s64) insn.displacement.value - (u8 *) dest;
if ((s64) (s32) newdisp != newdisp) {
pr_err("Kprobes error: new displacement does not fit into s32 (%llx)\n", newdisp);
pr_err("\tSrc: %p, Dest: %p, old disp: %x\n", src, dest, insn.displacement.value);
return 0;
}
disp = (u8 *) dest + insn_offset_displacement(&insn);
Expand Down Expand Up @@ -568,8 +567,7 @@ static int reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
* Raise a BUG or we'll continue in an endless reentering loop
* and eventually a stack overflow.
*/
printk(KERN_WARNING "Unrecoverable kprobe detected at %p.\n",
p->addr);
pr_err("Unrecoverable kprobe detected.\n");
dump_kprobe(p);
BUG();
default:
Expand Down
57 changes: 26 additions & 31 deletions crypto/ablkcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@ static inline u8 *ablkcipher_get_spot(u8 *start, unsigned int len)
return max(start, end_page);
}

static inline unsigned int ablkcipher_done_slow(struct ablkcipher_walk *walk,
unsigned int bsize)
static inline void ablkcipher_done_slow(struct ablkcipher_walk *walk,
unsigned int n)
{
unsigned int n = bsize;

for (;;) {
unsigned int len_this_page = scatterwalk_pagelen(&walk->out);

Expand All @@ -88,17 +86,13 @@ static inline unsigned int ablkcipher_done_slow(struct ablkcipher_walk *walk,
n -= len_this_page;
scatterwalk_start(&walk->out, scatterwalk_sg_next(walk->out.sg));
}

return bsize;
}

static inline unsigned int ablkcipher_done_fast(struct ablkcipher_walk *walk,
unsigned int n)
static inline void ablkcipher_done_fast(struct ablkcipher_walk *walk,
unsigned int n)
{
scatterwalk_advance(&walk->in, n);
scatterwalk_advance(&walk->out, n);

return n;
}

static int ablkcipher_walk_next(struct ablkcipher_request *req,
Expand All @@ -108,39 +102,40 @@ int ablkcipher_walk_done(struct ablkcipher_request *req,
struct ablkcipher_walk *walk, int err)
{
struct crypto_tfm *tfm = req->base.tfm;
unsigned int nbytes = 0;
unsigned int n; /* bytes processed */
bool more;

if (likely(err >= 0)) {
unsigned int n = walk->nbytes - err;
if (unlikely(err < 0))
goto finish;

if (likely(!(walk->flags & ABLKCIPHER_WALK_SLOW)))
n = ablkcipher_done_fast(walk, n);
else if (WARN_ON(err)) {
err = -EINVAL;
goto err;
} else
n = ablkcipher_done_slow(walk, n);
n = walk->nbytes - err;
walk->total -= n;
more = (walk->total != 0);

nbytes = walk->total - n;
err = 0;
if (likely(!(walk->flags & ABLKCIPHER_WALK_SLOW))) {
ablkcipher_done_fast(walk, n);
} else {
if (WARN_ON(err)) {
/* unexpected case; didn't process all bytes */
err = -EINVAL;
goto finish;
}
ablkcipher_done_slow(walk, n);
}

scatterwalk_done(&walk->in, 0, nbytes);
scatterwalk_done(&walk->out, 1, nbytes);

err:
walk->total = nbytes;
walk->nbytes = nbytes;
scatterwalk_done(&walk->in, 0, more);
scatterwalk_done(&walk->out, 1, more);

if (nbytes) {
if (more) {
crypto_yield(req->base.flags);
return ablkcipher_walk_next(req, walk);
}

err = 0;
finish:
walk->nbytes = 0;
if (walk->iv != req->info)
memcpy(req->info, walk->iv, tfm->crt_ablkcipher.ivsize);
kfree(walk->iv_buffer);

return err;
}
EXPORT_SYMBOL_GPL(ablkcipher_walk_done);
Expand Down
54 changes: 26 additions & 28 deletions crypto/blkcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,18 @@ static inline u8 *blkcipher_get_spot(u8 *start, unsigned int len)
return max(start, end_page);
}

static inline unsigned int blkcipher_done_slow(struct blkcipher_walk *walk,
unsigned int bsize)
static inline void blkcipher_done_slow(struct blkcipher_walk *walk,
unsigned int bsize)
{
u8 *addr;

addr = (u8 *)ALIGN((unsigned long)walk->buffer, walk->alignmask + 1);
addr = blkcipher_get_spot(addr, bsize);
scatterwalk_copychunks(addr, &walk->out, bsize, 1);
return bsize;
}

static inline unsigned int blkcipher_done_fast(struct blkcipher_walk *walk,
unsigned int n)
static inline void blkcipher_done_fast(struct blkcipher_walk *walk,
unsigned int n)
{
if (walk->flags & BLKCIPHER_WALK_COPY) {
blkcipher_map_dst(walk);
Expand All @@ -96,49 +95,48 @@ static inline unsigned int blkcipher_done_fast(struct blkcipher_walk *walk,

scatterwalk_advance(&walk->in, n);
scatterwalk_advance(&walk->out, n);

return n;
}

int blkcipher_walk_done(struct blkcipher_desc *desc,
struct blkcipher_walk *walk, int err)
{
unsigned int nbytes = 0;
unsigned int n; /* bytes processed */
bool more;

if (likely(err >= 0)) {
unsigned int n = walk->nbytes - err;
if (unlikely(err < 0))
goto finish;

if (likely(!(walk->flags & BLKCIPHER_WALK_SLOW)))
n = blkcipher_done_fast(walk, n);
else if (WARN_ON(err)) {
err = -EINVAL;
goto err;
} else
n = blkcipher_done_slow(walk, n);
n = walk->nbytes - err;
walk->total -= n;
more = (walk->total != 0);

nbytes = walk->total - n;
err = 0;
if (likely(!(walk->flags & BLKCIPHER_WALK_SLOW))) {
blkcipher_done_fast(walk, n);
} else {
if (WARN_ON(err)) {
/* unexpected case; didn't process all bytes */
err = -EINVAL;
goto finish;
}
blkcipher_done_slow(walk, n);
}

scatterwalk_done(&walk->in, 0, nbytes);
scatterwalk_done(&walk->out, 1, nbytes);

err:
walk->total = nbytes;
walk->nbytes = nbytes;
scatterwalk_done(&walk->in, 0, more);
scatterwalk_done(&walk->out, 1, more);

if (nbytes) {
if (more) {
crypto_yield(desc->flags);
return blkcipher_walk_next(desc, walk);
}

err = 0;
finish:
walk->nbytes = 0;
if (walk->iv != desc->info)
memcpy(desc->info, walk->iv, walk->ivsize);
if (walk->buffer != walk->page)
kfree(walk->buffer);
if (walk->page)
free_page((unsigned long)walk->page);

return err;
}
EXPORT_SYMBOL_GPL(blkcipher_walk_done);
Expand Down
Loading

0 comments on commit 4c789a1

Please sign in to comment.