Commit graph

599707 commits

Author SHA1 Message Date
Linux Build Service Account
68745c46c6 Merge "soc: qcom: boot_marker: add mpm timer interface" 2018-06-04 04:30:57 -07:00
Linux Build Service Account
d56749a4f9 Merge "hbtp_inpu.c: add 800s power down uevent in suspend func" 2018-06-04 04:30:55 -07:00
Linux Build Service Account
c053ae31b8 Merge "soc: qcom: hab: add performance test mechanism for HAB" 2018-06-04 04:30:53 -07:00
Linux Build Service Account
3c78eaa812 Merge "soc: msm: add size check to fix out of bounds on ANC" 2018-06-03 19:10:45 -07:00
Linux Build Service Account
fd95dadf54 Merge "Merge android-4.4.133 (3f51ea2) into msm-4.4" 2018-06-02 01:13:34 -07:00
Linux Build Service Account
33b2567cd5 Merge "spi: spi_qsd: add boot marker" 2018-06-01 14:39:22 -07:00
Linux Build Service Account
707b3d9760 Merge "serial: msm_serial_hs: add boot marker" 2018-06-01 14:39:19 -07:00
Timothy Sham
49662914af soc: msm: add size check to fix out of bounds on ANC
Before calling audio ANC ioctl functions, compare the
allocated buffer size to the size of the header and ANC cmd header
to ensure the buffer is big enough.

Change-Id: I8fcd0a830853d802bbb11fc243a4d392fbe384f3
Signed-off-by: Timothy Sham <tsham@codeaurora.org>
2018-06-01 13:35:21 -04:00
Linux Build Service Account
ef6cdc4600 Merge "ARM: dts: msm: remove USB3 device in msm8996-ivi-lv-mt vplatform" 2018-06-01 06:35:14 -07:00
Zhiqiang Tu
1bf695251f spi: spi_qsd: add boot marker
Add boot marker for booting KPI measurement

Change-Id: I8ba79f1b0e71e662ad20fcded128d43363e8302f
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2018-05-31 23:50:03 -07:00
Zhiqiang Tu
e55e517e9a serial: msm_serial_hs: add boot marker
Add boot marker for booting KPI measurement.

Change-Id: Ia54411a901cc09493f2085af42c3a2188438e29d
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2018-05-31 23:48:48 -07:00
Zhiqiang Tu
7c7109f9b9 soc: qcom: boot_marker: add mpm timer interface
Provide a debugfs interface to get count of mpm timer.

Change-Id: I24e927b6219b8bd4c2f4ddecb8f51518f0db663a
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2018-06-01 14:34:56 +08:00
Yong Ding
8c4608db93 ARM: dts: msm: remove USB3 device in msm8996-ivi-lv-mt vplatform
In the latest multiple GVMs(Guest Virtual Machines)
environment, USB3 is expected to be used by LA GVM with
the passthrough mode. So it is necessary to remove its
access from LV GVM, or there will be conflict.

Change-Id: I8409a81a636ca38e64b8e00e25170c064549dc61
Signed-off-by: Yong Ding <yongding@codeaurora.org>
2018-05-31 19:18:48 -07:00
Linux Build Service Account
15dfd16651 Merge "defconfig: msm: Enable CONFIG_CGROUP_DEBUG" 2018-05-31 16:44:26 -07:00
Linux Build Service Account
c0a42ee0ed Merge "adv7481: Add support for AVI Infoframe" 2018-05-31 05:11:45 -07:00
Linux Build Service Account
cbeccf228a Merge "soc: qcom: scm_qcpe: Close hab socket on error" 2018-05-31 05:11:44 -07:00
Linux Build Service Account
2272788153 Merge "selinux: KASAN: slab-out-of-bounds in xattr_getsecurity" 2018-05-31 05:11:43 -07:00
Linux Build Service Account
92fbf2a482 Merge "defconfig: msm: Disable config EXT2_FS and EXT3_FS for sdm660" 2018-05-31 05:11:42 -07:00
Linux Build Service Account
dad9612b1f Merge "soc: qcom: boot_stats: Fix compilation issue" 2018-05-31 05:11:41 -07:00
Linux Build Service Account
155d32a6a7 Merge "ARM: dts: msm: Add support for new speed bin for SDM660" 2018-05-31 05:11:40 -07:00
Linux Build Service Account
95be57e783 Merge "clk: qcom: Add support for 585MHz GPU frequency" 2018-05-31 05:11:39 -07:00
Linux Build Service Account
9b371fc84d Merge "audit: Checks valid value of audit_signals and tsk->audit_context" 2018-05-31 05:11:33 -07:00
Linux Build Service Account
e4a7e7dbaa Merge "defconfig: Sync automotive gvm defconfig with metal defconfig" 2018-05-31 05:11:29 -07:00
Linux Build Service Account
1d5d6eea84 Merge "defconfig: reduce HZ value from 250 to 100" 2018-05-31 05:11:20 -07:00
Srinivasarao P
66249baab2 defconfig: msm: Enable CONFIG_CGROUP_DEBUG
Enable CONFIG_CGROUP_DEBUG to address the compatibility issue with
AOSP.

Change-Id: I30aa2341535bc53982034e7f8ef430137c102177
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2018-05-31 15:51:23 +05:30
Srinivasarao P
9848856fe1 Merge android-4.4.133 (3f51ea2) into msm-4.4
* refs/heads/tmp-3f51ea2
  Linux 4.4.133
  x86/kexec: Avoid double free_page() upon do_kexec_load() failure
  hfsplus: stop workqueue when fill_super() failed
  cfg80211: limit wiphy names to 128 bytes
  gpio: rcar: Add Runtime PM handling for interrupts
  time: Fix CLOCK_MONOTONIC_RAW sub-nanosecond accounting
  dmaengine: ensure dmaengine helpers check valid callback
  scsi: zfcp: fix infinite iteration on ERP ready list
  scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()
  scsi: libsas: defer ata device eh commands to libata
  s390: use expoline thunks in the BPF JIT
  s390: extend expoline to BC instructions
  s390: move spectre sysfs attribute code
  s390/kernel: use expoline for indirect branches
  s390/lib: use expoline for indirect branches
  s390: move expoline assembler macros to a header
  s390: add assembler macros for CPU alternatives
  ext2: fix a block leak
  tcp: purge write queue in tcp_connect_init()
  sock_diag: fix use-after-free read in __sk_free
  packet: in packet_snd start writing at link layer allocation
  net: test tailroom before appending to linear skb
  btrfs: fix reading stale metadata blocks after degraded raid1 mounts
  btrfs: fix crash when trying to resume balance without the resume flag
  Btrfs: fix xattr loss after power failure
  ARM: 8772/1: kprobes: Prohibit kprobes on get_user functions
  ARM: 8770/1: kprobes: Prohibit probing on optimized_callback
  ARM: 8769/1: kprobes: Fix to use get_kprobe_ctlblk after irq-disabed
  tick/broadcast: Use for_each_cpu() specially on UP kernels
  ARM: 8771/1: kprobes: Prohibit kprobes on do_undefinstr
  efi: Avoid potential crashes, fix the 'struct efi_pci_io_protocol_32' definition for mixed mode
  s390: remove indirect branch from do_softirq_own_stack
  s390/qdio: don't release memory in qdio_setup_irq()
  s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero
  s390/qdio: fix access to uninitialized qdio_q fields
  mm: don't allow deferred pages with NEED_PER_CPU_KM
  powerpc/powernv: Fix NVRAM sleep in invalid context when crashing
  procfs: fix pthread cross-thread naming if !PR_DUMPABLE
  proc read mm's {arg,env}_{start,end} with mmap semaphore taken.
  tracing/x86/xen: Remove zero data size trace events trace_xen_mmu_flush_tlb{_all}
  cpufreq: intel_pstate: Enable HWP by default
  signals: avoid unnecessary taking of sighand->siglock
  mm: filemap: avoid unnecessary calls to lock_page when waiting for IO to complete during a read
  mm: filemap: remove redundant code in do_read_cache_page
  proc: meminfo: estimate available memory more conservatively
  vmscan: do not force-scan file lru if its absolute size is small
  powerpc: Don't preempt_disable() in show_cpuinfo()
  cpuidle: coupled: remove unused define cpuidle_coupled_lock
  powerpc/powernv: remove FW_FEATURE_OPALv3 and just use FW_FEATURE_OPAL
  powerpc/powernv: Remove OPALv2 firmware define and references
  powerpc/powernv: panic() on OPAL < V3
  spi: pxa2xx: Allow 64-bit DMA
  ALSA: control: fix a redundant-copy issue
  ALSA: hda: Add Lenovo C50 All in one to the power_save blacklist
  ALSA: usb: mixer: volume quirk for CM102-A+/102S+
  usbip: usbip_host: fix bad unlock balance during stub_probe()
  usbip: usbip_host: fix NULL-ptr deref and use-after-free errors
  usbip: usbip_host: run rebind from exit when module is removed
  usbip: usbip_host: delete device from busid_table after rebind
  usbip: usbip_host: refine probe and disconnect debug msgs to be useful
  kernel/exit.c: avoid undefined behaviour when calling wait4()
  futex: futex_wake_op, fix sign_extend32 sign bits
  pipe: cap initial pipe capacity according to pipe-max-size limit
  l2tp: revert "l2tp: fix missing print session offset info"
  Revert "ARM: dts: imx6qdl-wandboard: Fix audio channel swap"
  lockd: lost rollback of set_grace_period() in lockd_down_net()
  xfrm: fix xfrm_do_migrate() with AEAD e.g(AES-GCM)
  futex: Remove duplicated code and fix undefined behaviour
  futex: Remove unnecessary warning from get_futex_key
  arm64: Add work around for Arm Cortex-A55 Erratum 1024718
  arm64: introduce mov_q macro to move a constant into a 64-bit register
  audit: move calcs after alloc and check when logging set loginuid
  ALSA: timer: Call notifier in the same spinlock
  sctp: delay the authentication for the duplicated cookie-echo chunk
  sctp: fix the issue that the cookie-ack with auth can't get processed
  tcp: ignore Fast Open on repair mode
  bonding: do not allow rlb updates to invalid mac
  tg3: Fix vunmap() BUG_ON() triggered from tg3_free_consistent().
  sctp: use the old asoc when making the cookie-ack chunk in dupcook_d
  sctp: handle two v4 addrs comparison in sctp_inet6_cmp_addr
  r8169: fix powering up RTL8168h
  qmi_wwan: do not steal interfaces from class drivers
  openvswitch: Don't swap table in nlattr_set() after OVS_ATTR_NESTED is found
  net: support compat 64-bit time in {s,g}etsockopt
  net_sched: fq: take care of throttled flows before reuse
  net/mlx4_en: Verify coalescing parameters are in range
  net: ethernet: sun: niu set correct packet size in skb
  llc: better deal with too small mtu
  ipv4: fix memory leaks in udp_sendmsg, ping_v4_sendmsg
  dccp: fix tasklet usage
  bridge: check iface upper dev when setting master via ioctl
  8139too: Use disable_irq_nosync() in rtl8139_poll_controller()
  BACKPORT, FROMLIST: fscrypt: add Speck128/256 support
  cgroup: Disable IRQs while holding css_set_lock
  Revert "cgroup: Disable IRQs while holding css_set_lock"
  cgroup: Disable IRQs while holding css_set_lock
  ANDROID: proc: fix undefined behavior in proc_uid_base_readdir
  x86: vdso: Fix leaky vdso linker with CC=clang.
  ANDROID: build: cuttlefish: Upgrade clang to newer version.
  ANDROID: build: cuttlefish: Upgrade clang to newer version.
  ANDROID: build: cuttlefish: Fix path to clang.
  UPSTREAM: dm bufio: avoid sleeping while holding the dm_bufio lock
  ANDROID: sdcardfs: Don't d_drop in d_revalidate

Conflicts:
	arch/arm64/include/asm/cputype.h
	fs/ext4/crypto.c
	fs/ext4/ext4.h
	kernel/cgroup.c
	mm/vmscan.c

Change-Id: Ic10c5722b6439af1cf423fd949c493f786764d7e
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2018-05-31 12:28:38 +05:30
Sachin Grover
e42662afef selinux: KASAN: slab-out-of-bounds in xattr_getsecurity
Call trace:
 [<ffffff9203a8d7a8>] dump_backtrace+0x0/0x428
 [<ffffff9203a8dbf8>] show_stack+0x28/0x38
 [<ffffff920409bfb8>] dump_stack+0xd4/0x124
 [<ffffff9203d187e8>] print_address_description+0x68/0x258
 [<ffffff9203d18c00>] kasan_report.part.2+0x228/0x2f0
 [<ffffff9203d1927c>] kasan_report+0x5c/0x70
 [<ffffff9203d1776c>] check_memory_region+0x12c/0x1c0
 [<ffffff9203d17cdc>] memcpy+0x34/0x68
 [<ffffff9203d75348>] xattr_getsecurity+0xe0/0x160
 [<ffffff9203d75490>] vfs_getxattr+0xc8/0x120
 [<ffffff9203d75d68>] getxattr+0x100/0x2c8
 [<ffffff9203d76fb4>] SyS_fgetxattr+0x64/0xa0
 [<ffffff9203a83f70>] el0_svc_naked+0x24/0x28

If user get root access and calls security.selinux setxattr() with an
embedded NUL on a file and then if some process performs a getxattr()
on that file with a length greater than the actual length of the string,
it would result in a panic.

To fix this, add the actual length of the string to the security context
instead of the length passed by the userspace process.

Change-Id: Ie0b8bfc7c96bc12282b955fb3adf41b3c2d011cd
Signed-off-by: Sachin Grover <sgrover@codeaurora.org>
2018-05-30 21:25:04 -07:00
Suprith Malligere Shankaregowda
1fb990c0b3 adv7481: Add support for AVI Infoframe
AVI Infoframe provides the aspect ratio and video
identification code information. Add support to read
this from ADV7481 registers and to return it to user space
through an ioctl call.

Change-Id: Ia64fbc736b548633b34a9bd96f7a78700afb3db5
Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org>
2018-05-30 21:21:40 -07:00
Linux Build Service Account
07c1b26257 Merge "mmc: card: Update multi_cmd_ioctl path to support cmdq" 2018-05-30 21:10:30 -07:00
Linux Build Service Account
7f1e39e00b Merge "drm: sde: Check commit's validity when starting splash handoff" 2018-05-30 10:21:00 -07:00
Amit Blay
9d0080999d soc: qcom: scm_qcpe: Close hab socket on error
Close the open hab socket after receiving an error status from
the hab.

Change-Id: Ia56c7ce49d0e61661c9f133d35540e48f3707e01
Signed-off-by: Amit Blay <ablay@codeaurora.org>
2018-05-30 18:08:45 +03:00
Taniya Das
129e694595 ARM: dts: msm: Add support for new speed bin for SDM660
New cpu speed bin of 4 is added to support 1.9/1.8GHz.

Change-Id: Ic0dffc7c46e82748bf9f40de7f478ec073142dd1
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2018-05-30 15:03:27 +05:30
Taniya Das
22f07893c9 clk: qcom: Add support for 585MHz GPU frequency
On SDM660 there is a new frequency requirement of 585MHz, so add support
for the same.

Change-Id: I9b55b18d6befdc8f5a7d9dac6bcb832eda338497
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2018-05-30 15:03:18 +05:30
Zhiqiang Tu
e54fbdbc40 soc: qcom: boot_stats: Fix compilation issue
Fix the multiple definition issue of msm_timer_get_sclk_ticks
when CONFIG_MSM_BOOT_STATS is disabled.

Change-Id: Id2c263c48cec038be4354894fa57b203a5f764c6
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2018-05-30 16:51:56 +08:00
Chetan C R
ad60f0e735 audit: Checks valid value of audit_signals and tsk->audit_context
There can be a case when current task's audit context
may be NULL or even if it is not NULL, it can have
invalid non-zero value of dummy variable and also
we should audit the signal only if we have non-zero
value of audit_signals.

Issue has been seen during power on/off tests. So
better to add explicit check on these variables.

Change-Id: I2f3e17d933fca8e3b8f4013f44f942f11c68f440
Signed-off-by: Chetan C R <cravin@codeaurora.org>
2018-05-29 21:58:34 -07:00
Lei wang
beafa8ecff defconfig: Sync automotive gvm defconfig with metal defconfig
Sync automotive gvm defconfig with metal, cleanup some unused config

Change-Id: Ic0f6f5e1d274692886da237f52c13b587e43a779
Signed-off-by: Lei wang <leiwan@codeaurora.org>
2018-05-29 19:28:32 -07:00
Linux Build Service Account
fc98b97cd8 Merge "msm: kgsl: Don't dump GPMU registers on non GPMU devices" 2018-05-29 13:57:06 -07:00
Linux Build Service Account
addd4dab16 Merge "ASoC: msm: add boot marker for mi2s and auto sound card" 2018-05-29 05:07:37 -07:00
Veerabhadrarao Badiganti
d4a088792f mmc: card: Update multi_cmd_ioctl path to support cmdq
Halt cmdq in multi_cmd_ioctl path before processing IOCTL
commands and un-halt it once it has done with IOCTL processing.

Without this change, the mmc driver would try to process legacy
commands when host & card are in cmdq mode which may result
in unexpected interrupt / illegal command errors.

Change-Id: I254a1a752f770ffd03331c4856aa9f54867092dc
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2018-05-29 10:40:41 +05:30
Linux Build Service Account
5cb5749cd7 Merge "defconfig: msm: enable lpass resource mgr for msm8996-auto" 2018-05-27 09:11:15 -07:00
Linux Build Service Account
2115d78a54 Merge "ARM: dts: msm: add lpass resource mgr on automotive msm8996" 2018-05-27 09:11:14 -07:00
Linux Build Service Account
fd10e25d18 Merge "defconfig: msm: enable Sensor DSP framework" 2018-05-27 09:11:11 -07:00
Linux Build Service Account
b746664418 Merge "msm: ipa: fix to not allow NAT DMA command without device initialization" 2018-05-27 02:06:57 -07:00
Linux Build Service Account
10f17193d7 Merge "defconfig: msmcortex: Enable INET_UDP_DIAG" 2018-05-26 13:26:54 -07:00
Linux Build Service Account
d9f6f32dae Merge "defconfig: sdm660: Enable INET_UDP_DIAG" 2018-05-26 13:26:53 -07:00
Linux Build Service Account
7879aadfcc Merge "asoc: msm8998: Add configuration for adaptive bitrate." 2018-05-26 13:26:51 -07:00
Mohammed Javid
333b7dec60 msm: ipa: fix to not allow NAT DMA command without device initialization
Without NAT device initialization sending NAT DMA
commands leads to XPU violation. Added checks to
verify device initialized or not before sending DMA
command.

Change-Id: I7440abc14a81e1621573f0e2808a410d60b2458d
Acked-by: Ashok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
2018-05-26 23:56:08 +05:30
Greg Kroah-Hartman
3f51ea2db9 This is the 4.4.133 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlsJA10ACgkQONu9yGCS
 aT4NqRAAr+4+KwFqbdUDDAdYMLgomybjLVNxbI80CvOTF24NIKfKIKUn+Q3e2qCE
 11y2Q+PixE9qbujYPg+qoC3Xux+S6DAj9QOJPJpuJVQhBRRmnFugKlAq630kaoxx
 VOPJx1x+244Q1OsAJMRDqEJEtMEFew/r0VGQ1yrXd9APYgc0KvDKHfjt8rXzGGuA
 sdf5GsbxSxptMCF6nnUAGcyfuRBVIBW0v6NOEnj5m/K6f4oESQb+uKk7R8MO7m3U
 kc2ggTALxA1u/0iAsfxScfaFkT865+2IxCz4i4N13PUmxuJJTDF0xshAOSdlrSxV
 j8x7B+YmVaPgs63m2EyClQpVitqkcgyfiPZ0byWEcaKtuYXavcOO77aGB7W/QUSw
 ZfGJeDhz0hkjOCSGD2LCx062clMSpqqZn20MUDyF32HiRl1mIf6prac/LBXphNHh
 l+arXyzRk9rVTgtfbqcKBgi8h5n0LKzqbfD4f+8hrhv8q0i+9tNoM1lW8R+GL4RC
 nXfCuhCEIEXbsfQIJeSkEp6AH8N9guMcbw9jOiji9HvNFQZj3RpfkuCHGGggBlwa
 EiD3GzMhwFyJmIzWqdYCSGfCh6YI6FA7KpspOKhUKZKkHVDfJ7M+A8lBQmOZGRBQ
 G44XJJvaKB7l/I0ux2S0C5CdcyBb7EMjD8tXXLnRjMEGjLoKpqM=
 =s+Ms
 -----END PGP SIGNATURE-----

Merge 4.4.133 into android-4.4

Changes in 4.4.133
	8139too: Use disable_irq_nosync() in rtl8139_poll_controller()
	bridge: check iface upper dev when setting master via ioctl
	dccp: fix tasklet usage
	ipv4: fix memory leaks in udp_sendmsg, ping_v4_sendmsg
	llc: better deal with too small mtu
	net: ethernet: sun: niu set correct packet size in skb
	net/mlx4_en: Verify coalescing parameters are in range
	net_sched: fq: take care of throttled flows before reuse
	net: support compat 64-bit time in {s,g}etsockopt
	openvswitch: Don't swap table in nlattr_set() after OVS_ATTR_NESTED is found
	qmi_wwan: do not steal interfaces from class drivers
	r8169: fix powering up RTL8168h
	sctp: handle two v4 addrs comparison in sctp_inet6_cmp_addr
	sctp: use the old asoc when making the cookie-ack chunk in dupcook_d
	tg3: Fix vunmap() BUG_ON() triggered from tg3_free_consistent().
	bonding: do not allow rlb updates to invalid mac
	tcp: ignore Fast Open on repair mode
	sctp: fix the issue that the cookie-ack with auth can't get processed
	sctp: delay the authentication for the duplicated cookie-echo chunk
	ALSA: timer: Call notifier in the same spinlock
	audit: move calcs after alloc and check when logging set loginuid
	arm64: introduce mov_q macro to move a constant into a 64-bit register
	arm64: Add work around for Arm Cortex-A55 Erratum 1024718
	futex: Remove unnecessary warning from get_futex_key
	futex: Remove duplicated code and fix undefined behaviour
	xfrm: fix xfrm_do_migrate() with AEAD e.g(AES-GCM)
	lockd: lost rollback of set_grace_period() in lockd_down_net()
	Revert "ARM: dts: imx6qdl-wandboard: Fix audio channel swap"
	l2tp: revert "l2tp: fix missing print session offset info"
	pipe: cap initial pipe capacity according to pipe-max-size limit
	futex: futex_wake_op, fix sign_extend32 sign bits
	kernel/exit.c: avoid undefined behaviour when calling wait4()
	usbip: usbip_host: refine probe and disconnect debug msgs to be useful
	usbip: usbip_host: delete device from busid_table after rebind
	usbip: usbip_host: run rebind from exit when module is removed
	usbip: usbip_host: fix NULL-ptr deref and use-after-free errors
	usbip: usbip_host: fix bad unlock balance during stub_probe()
	ALSA: usb: mixer: volume quirk for CM102-A+/102S+
	ALSA: hda: Add Lenovo C50 All in one to the power_save blacklist
	ALSA: control: fix a redundant-copy issue
	spi: pxa2xx: Allow 64-bit DMA
	powerpc/powernv: panic() on OPAL < V3
	powerpc/powernv: Remove OPALv2 firmware define and references
	powerpc/powernv: remove FW_FEATURE_OPALv3 and just use FW_FEATURE_OPAL
	cpuidle: coupled: remove unused define cpuidle_coupled_lock
	powerpc: Don't preempt_disable() in show_cpuinfo()
	vmscan: do not force-scan file lru if its absolute size is small
	proc: meminfo: estimate available memory more conservatively
	mm: filemap: remove redundant code in do_read_cache_page
	mm: filemap: avoid unnecessary calls to lock_page when waiting for IO to complete during a read
	signals: avoid unnecessary taking of sighand->siglock
	cpufreq: intel_pstate: Enable HWP by default
	tracing/x86/xen: Remove zero data size trace events trace_xen_mmu_flush_tlb{_all}
	proc read mm's {arg,env}_{start,end} with mmap semaphore taken.
	procfs: fix pthread cross-thread naming if !PR_DUMPABLE
	powerpc/powernv: Fix NVRAM sleep in invalid context when crashing
	mm: don't allow deferred pages with NEED_PER_CPU_KM
	s390/qdio: fix access to uninitialized qdio_q fields
	s390/cpum_sf: ensure sample frequency of perf event attributes is non-zero
	s390/qdio: don't release memory in qdio_setup_irq()
	s390: remove indirect branch from do_softirq_own_stack
	efi: Avoid potential crashes, fix the 'struct efi_pci_io_protocol_32' definition for mixed mode
	ARM: 8771/1: kprobes: Prohibit kprobes on do_undefinstr
	tick/broadcast: Use for_each_cpu() specially on UP kernels
	ARM: 8769/1: kprobes: Fix to use get_kprobe_ctlblk after irq-disabed
	ARM: 8770/1: kprobes: Prohibit probing on optimized_callback
	ARM: 8772/1: kprobes: Prohibit kprobes on get_user functions
	Btrfs: fix xattr loss after power failure
	btrfs: fix crash when trying to resume balance without the resume flag
	btrfs: fix reading stale metadata blocks after degraded raid1 mounts
	net: test tailroom before appending to linear skb
	packet: in packet_snd start writing at link layer allocation
	sock_diag: fix use-after-free read in __sk_free
	tcp: purge write queue in tcp_connect_init()
	ext2: fix a block leak
	s390: add assembler macros for CPU alternatives
	s390: move expoline assembler macros to a header
	s390/lib: use expoline for indirect branches
	s390/kernel: use expoline for indirect branches
	s390: move spectre sysfs attribute code
	s390: extend expoline to BC instructions
	s390: use expoline thunks in the BPF JIT
	scsi: libsas: defer ata device eh commands to libata
	scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()
	scsi: zfcp: fix infinite iteration on ERP ready list
	dmaengine: ensure dmaengine helpers check valid callback
	time: Fix CLOCK_MONOTONIC_RAW sub-nanosecond accounting
	gpio: rcar: Add Runtime PM handling for interrupts
	cfg80211: limit wiphy names to 128 bytes
	hfsplus: stop workqueue when fill_super() failed
	x86/kexec: Avoid double free_page() upon do_kexec_load() failure
	Linux 4.4.133

Change-Id: I0554b12889bc91add2a444da95f18d59c6fb9cdb
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2018-05-26 10:12:26 +02:00
Greg Kroah-Hartman
7620164e85 Linux 4.4.133 2018-05-26 08:49:01 +02:00
Tetsuo Handa
eef045e7f6 x86/kexec: Avoid double free_page() upon do_kexec_load() failure
commit a466ef76b815b86748d9870ef2a430af7b39c710 upstream.

>From ff82bedd3e12f0d3353282054ae48c3bd8c72012 Mon Sep 17 00:00:00 2001
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date: Wed, 9 May 2018 12:12:39 +0900
Subject: x86/kexec: Avoid double free_page() upon do_kexec_load() failure

syzbot is reporting crashes after memory allocation failure inside
do_kexec_load() [1]. This is because free_transition_pgtable() is called
by both init_transition_pgtable() and machine_kexec_cleanup() when memory
allocation failed inside init_transition_pgtable().

Regarding 32bit code, machine_kexec_free_page_tables() is called by both
machine_kexec_alloc_page_tables() and machine_kexec_cleanup() when memory
allocation failed inside machine_kexec_alloc_page_tables().

Fix this by leaving the error handling to machine_kexec_cleanup()
(and optionally setting NULL after free_page()).

[1] https://syzkaller.appspot.com/bug?id=91e52396168cf2bdd572fe1e1bc0bc645c1c6b40

Fixes: f5deb79679 ("x86: kexec: Use one page table in x86_64 machine_kexec")
Fixes: 92be3d6bdf ("kexec/i386: allocate page table pages dynamically")
Reported-by: syzbot <syzbot+d96f60296ef613fe1d69@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: thomas.lendacky@amd.com
Cc: prudo@linux.vnet.ibm.com
Cc: Huang Ying <ying.huang@intel.com>
Cc: syzkaller-bugs@googlegroups.com
Cc: takahiro.akashi@linaro.org
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: akpm@linux-foundation.org
Cc: dyoung@redhat.com
Cc: kirill.shutemov@linux.intel.com
Link: https://lkml.kernel.org/r/201805091942.DGG12448.tMFVFSJFQOOLHO@I-love.SAKURA.ne.jp
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-26 08:49:01 +02:00