~apw/ubuntu/+source/linux/+git/trusty:master

Last commit made on 2018-12-05
Get this branch:
git clone -b master https://git.launchpad.net/~apw/ubuntu/+source/linux/+git/trusty
Only Andy Whitcroft can upload to this branch. If you are Andy Whitcroft please log in for upload directions.

Branch merges

Branch information

Name:
master
Repository:
lp:~apw/ubuntu/+source/linux/+git/trusty

Recent commits

6bfe558... by Khaled El Mously

UBUNTU: Ubuntu-3.13.0-164.214

Signed-off-by: Khalid Elmously <email address hidden>

46a85af... by Khaled El Mously

UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/1806428
Signed-off-by: Khalid Elmously <email address hidden>

f3841d1... by tglx

posix-timers: Sanitize overrun handling

CVE-2018-12896

The posix timer overrun handling is broken because the forwarding functions
can return a huge number of overruns which does not fit in an int. As a
consequence timer_getoverrun(2) and siginfo::si_overrun can turn into
random number generators.

The k_clock::timer_forward() callbacks return a 64 bit value now. Make
k_itimer::ti_overrun[_last] 64bit as well, so the kernel internal
accounting is correct. 3Remove the temporary (int) casts.

Add a helper function which clamps the overrun value returned to user space
via timer_getoverrun(2) or siginfo::si_overrun limited to a positive value
between 0 and INT_MAX. INT_MAX is an indicator for user space that the
overrun value has been clamped.

Reported-by: Team OWL337 <email address hidden>
Signed-off-by: Thomas Gleixner <email address hidden>
Acked-by: John Stultz <email address hidden>
Cc: Peter Zijlstra <email address hidden>
Cc: Michael Kerrisk <email address hidden>
Link: https://<email address hidden>
(backported from commit 78c9c4dfbf8c04883941445a195276bb4bb92c76)
[ kmously: Mostly context adjustments or adjusting for slightly refactored
code. A cosmetic change from the original (changing '-1' to
'-1LL') was dropped because it's not applicable. Also path changes were
needed from kernel/time -> kernel ]
Signed-off-by: Khalid Elmously <email address hidden>
Acked-by: Tyler Hicks <email address hidden>
Acked-by: Kleber Souza <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

6af7bd9... by Jann Horn (corp account)

USB: yurex: fix out-of-bounds uaccess in read handler

In general, accessing userspace memory beyond the length of the supplied
buffer in VFS read/write handlers can lead to both kernel memory corruption
(via kernel_read()/kernel_write(), which can e.g. be triggered via
sys_splice()) and privilege escalation inside userspace.

Fix it by using simple_read_from_buffer() instead of custom logic.

Fixes: 6bc235a2e24a ("USB: add driver for Meywa-Denki & Kayac YUREX")
Signed-off-by: Jann Horn <email address hidden>
Cc: stable <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>

CVE-2018-16276
(backported from commit f1e255d60ae66a9f672ff9a207ee6cd8e33d2679)
[ klebers: context adjustment ]
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>
Acked-by: Khalid Elmously <email address hidden>
Acked-by: Tyler Hicks <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

382c274... by Takashi Iwai

ALSA: rawmidi: Change resized buffers atomically

CVE-2018-10902

The SNDRV_RAWMIDI_IOCTL_PARAMS ioctl may resize the buffers and the
current code is racy. For example, the sequencer client may write to
buffer while it being resized.

As a simple workaround, let's switch to the resized buffer inside the
stream runtime lock.

Reported-by: <email address hidden>
Cc: <email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from commit 39675f7a7c7e7702f7d5341f1e0d01db746543a0)
Signed-off-by: Khalid Elmously <email address hidden>
Acked-by: Kleber Souza <email address hidden>
Acked-by: Tyler Hicks <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

ae83450... by Linus Torvalds <email address hidden>

n_tty: fix EXTPROC vs ICANON interaction with TIOCINQ (aka FIONREAD)

We added support for EXTPROC back in 2010 in commit 26df6d13406d ("tty:
Add EXTPROC support for LINEMODE") and the intent was to allow it to
override some (all?) ICANON behavior. Quoting from that original commit
message:

         There is a new bit in the termios local flag word, EXTPROC.
         When this bit is set, several aspects of the terminal driver
         are disabled. Input line editing, character echo, and mapping
         of signals are all disabled. This allows the telnetd to turn
         off these functions when in linemode, but still keep track of
         what state the user wants the terminal to be in.

but the problem turns out that "several aspects of the terminal driver
are disabled" is a bit ambiguous, and you can really confuse the n_tty
layer by setting EXTPROC and then causing some of the ICANON invariants
to no longer be maintained.

This fixes at least one such case (TIOCINQ) becoming unhappy because of
the confusion over whether ICANON really means ICANON when EXTPROC is set.

This basically makes TIOCINQ match the case of read: if EXTPROC is set,
we ignore ICANON. Also, make sure to reset the ICANON state ie EXTPROC
changes, not just if ICANON changes.

Fixes: 26df6d13406d ("tty: Add EXTPROC support for LINEMODE")
Reported-by: Tetsuo Handa <email address hidden>
Reported-by: syzkaller <email address hidden>
Cc: Jiri Slaby <email address hidden>
Signed-off-by: Linus Torvalds <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>

CVE-2018-18386
(cherry picked from commit 966031f340185eddd05affcf72b740549f056348)
Signed-off-by: Kleber Sacilotto de Souza <email address hidden>
Acked-by: Tyler Hicks <email address hidden>
Acked-by: Colin Ian King <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

acf416c... by "Gustavo A. R. Silva" <email address hidden>

tty: vt_ioctl: fix potential Spectre v1

vsa.console is indirectly controlled by user-space, hence leading to
a potential exploitation of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:

drivers/tty/vt/vt_ioctl.c:711 vt_ioctl() warn: potential spectre issue
'vc_cons' [r]

Fix this by sanitizing vsa.console before using it to index vc_cons

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

Cc: <email address hidden>
Signed-off-by: Gustavo A. R. Silva <email address hidden>
Reviewed-by: Alan Cox <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>

CVE-2017-5753

(cherry picked from commit e97267cb4d1ee01ca0929638ec0fcbb0904f903d)
Signed-off-by: Juerg Haefliger <email address hidden>
Acked-by: Stefan Bader <email address hidden>
Acked-by: Kleber Sacilotto de Souza <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

5c6155c... by "Gustavo A. R. Silva" <email address hidden>

misc: hmc6352: fix potential Spectre v1

val is indirectly controlled by user-space, hence leading to a
potential exploitation of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:

drivers/misc/hmc6352.c:54 compass_store() warn: potential spectre issue
'map' [r]

Fix this by sanitizing val before using it to index map

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

Cc: <email address hidden>
Signed-off-by: Gustavo A. R. Silva <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>

CVE-2017-5753

(cherry picked from commit de916736aaaadddbd6061472969f667b14204aa9)
Signed-off-by: Juerg Haefliger <email address hidden>
Acked-by: Stefan Bader <email address hidden>
Acked-by: Kleber Sacilotto de Souza <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

7df312d... by Jeremy Cline <email address hidden>

fs/quota: Fix spectre gadget in do_quotactl

'type' is user-controlled, so sanitize it after the bounds check to
avoid using it in speculative execution. This covers the following
potential gadgets detected with the help of smatch:

* fs/ext4/super.c:5741 ext4_quota_read() warn: potential spectre issue
  'sb_dqopt(sb)->files' [r]
* fs/ext4/super.c:5778 ext4_quota_write() warn: potential spectre issue
  'sb_dqopt(sb)->files' [r]
* fs/f2fs/super.c:1552 f2fs_quota_read() warn: potential spectre issue
  'sb_dqopt(sb)->files' [r]
* fs/f2fs/super.c:1608 f2fs_quota_write() warn: potential spectre issue
  'sb_dqopt(sb)->files' [r]
* fs/quota/dquot.c:412 mark_info_dirty() warn: potential spectre issue
  'sb_dqopt(sb)->info' [w]
* fs/quota/dquot.c:933 dqinit_needed() warn: potential spectre issue
  'dquots' [r]
* fs/quota/dquot.c:2112 dquot_commit_info() warn: potential spectre
  issue 'dqopt->ops' [r]
* fs/quota/dquot.c:2362 vfs_load_quota_inode() warn: potential spectre
  issue 'dqopt->files' [w] (local cap)
* fs/quota/dquot.c:2369 vfs_load_quota_inode() warn: potential spectre
  issue 'dqopt->ops' [w] (local cap)
* fs/quota/dquot.c:2370 vfs_load_quota_inode() warn: potential spectre
  issue 'dqopt->info' [w] (local cap)
* fs/quota/quota.c:110 quota_getfmt() warn: potential spectre issue
  'sb_dqopt(sb)->info' [r]
* fs/quota/quota_v2.c:84 v2_check_quota_file() warn: potential spectre
  issue 'quota_magics' [w]
* fs/quota/quota_v2.c:85 v2_check_quota_file() warn: potential spectre
  issue 'quota_versions' [w]
* fs/quota/quota_v2.c:96 v2_read_file_info() warn: potential spectre
  issue 'dqopt->info' [r]
* fs/quota/quota_v2.c:172 v2_write_file_info() warn: potential spectre
  issue 'dqopt->info' [r]

Additionally, a quick inspection indicates there are array accesses with
'type' in quota_on() and quota_off() functions which are also addressed
by this.

Cc: Josh Poimboeuf <email address hidden>
Cc: <email address hidden>
Signed-off-by: Jeremy Cline <email address hidden>
Signed-off-by: Jan Kara <email address hidden>

CVE-2017-5753

(backported from commit 7b6924d94a60c6b8c1279ca003e8744e6cd9e8b1)
[juergh: Adjusted context.]
Signed-off-by: Juerg Haefliger <email address hidden>
Acked-by: Stefan Bader <email address hidden>
Acked-by: Kleber Sacilotto de Souza <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

ba83700... by Jeremy Cline <email address hidden>

ext4: fix spectre gadget in ext4_mb_regular_allocator()

'ac->ac_g_ex.fe_len' is a user-controlled value which is used in the
derivation of 'ac->ac_2order'. 'ac->ac_2order', in turn, is used to
index arrays which makes it a potential spectre gadget. Fix this by
sanitizing the value assigned to 'ac->ac2_order'. This covers the
following accesses found with the help of smatch:

* fs/ext4/mballoc.c:1896 ext4_mb_simple_scan_group() warn: potential
  spectre issue 'grp->bb_counters' [w] (local cap)

* fs/ext4/mballoc.c:445 mb_find_buddy() warn: potential spectre issue
  'EXT4_SB(e4b->bd_sb)->s_mb_offsets' [r] (local cap)

* fs/ext4/mballoc.c:446 mb_find_buddy() warn: potential spectre issue
  'EXT4_SB(e4b->bd_sb)->s_mb_maxs' [r] (local cap)

Suggested-by: Josh Poimboeuf <email address hidden>
Signed-off-by: Jeremy Cline <email address hidden>
Signed-off-by: Theodore Ts'o <email address hidden>
Cc: <email address hidden>

CVE-2017-5753

(backported from commit 1a5d5e5d51e75a5bca67dadbcea8c841934b7b85)
[juergh: Adjusted context.]
Signed-off-by: Juerg Haefliger <email address hidden>
Acked-by: Stefan Bader <email address hidden>
Acked-by: Kleber Sacilotto de Souza <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>