2019-05-09 19:06:58

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 4.19 00/66] 4.19.42-stable review

This is the start of the stable review cycle for the 4.19.42 release.
There are 66 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.

Responses should be made by Sat 11 May 2019 06:11:18 PM UTC.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.42-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <[email protected]>
Linux 4.19.42-rc1

Will Deacon <[email protected]>
arm64: futex: Bound number of LDXR/STXR loops in FUTEX_WAKE_OP

Will Deacon <[email protected]>
locking/futex: Allow low-level atomic operations to return -EAGAIN

Ross Zwisler <[email protected]>
ASoC: Intel: avoid Oops if DMA setup fails

Oliver Neukum <[email protected]>
UAS: fix alignment of scatter/gather segments

Marcel Holtmann <[email protected]>
Bluetooth: Align minimum encryption key size for LE and BR/EDR connections

Young Xiao <[email protected]>
Bluetooth: hidp: fix buffer overflow

Quinn Tran <[email protected]>
scsi: qla2xxx: Fix device staying in blocked state

Andrew Vasquez <[email protected]>
scsi: qla2xxx: Fix incorrect region-size setting in optrom SYSFS routines

Silvio Cesare <[email protected]>
scsi: lpfc: change snprintf to scnprintf for possible overflow

Samuel Holland <[email protected]>
soc: sunxi: Fix missing dependency on REGMAP_MMIO

Gregory CLEMENT <[email protected]>
cpufreq: armada-37xx: fix frequency calculation for opp

Alexander Shishkin <[email protected]>
intel_th: pci: Add Comet Lake support

Alan Stern <[email protected]>
usb-storage: Set virt_boundary_mask to avoid SG overflows

Johan Hovold <[email protected]>
USB: cdc-acm: fix unthrottle races

Ji-Ze Hong (Peter Hong) <[email protected]>
USB: serial: f81232: fix interrupt worker not stop

Thinh Nguyen <[email protected]>
usb: dwc3: Fix default lpm_nyet_threshold value

Prasad Sodagudi <[email protected]>
genirq: Prevent use-after-free and work list corruption

Joerg Roedel <[email protected]>
iommu/amd: Set exclusion range correctly

Peter Zijlstra <[email protected]>
perf/core: Fix perf_event_disable_inatomic() race

Stephen Boyd <[email protected]>
platform/x86: pmc_atom: Drop __initconst on dmi table

James Smart <[email protected]>
nvme-fc: correct csn initialization and increments on error

Dongli Zhang <[email protected]>
virtio-blk: limit number of hw queues by nr_cpu_ids

Tzung-Bi Shih <[email protected]>
ASoC: Intel: kbl: fix wrong number of channels

Wen Yang <[email protected]>
drm/mediatek: fix possible object reference leak

Varun Prakash <[email protected]>
scsi: csiostor: fix missing data copy in csio_scsi_err_handler()

Lijun Ou <[email protected]>
RDMA/hns: Fix bug that caused srq creation to fail

Kamal Heib <[email protected]>
RDMA/vmw_pvrdma: Fix memory leak on pvrdma_pci_remove

Longpeng <[email protected]>
virtio_pci: fix a NULL pointer reference in vp_del_vqs

Ondrej Jirman <[email protected]>
drm/sun4i: tcon top: Fix NULL/invalid pointer dereference in sun8i_tcon_top_un/bind

Qian Cai <[email protected]>
slab: fix a crash by reading /proc/slab_allocators

Josh Poimboeuf <[email protected]>
objtool: Add rewind_stack_do_exit() to the noreturn list

Charles Keepax <[email protected]>
ASoC: cs35l35: Disable regulators on driver removal

tiancyin <[email protected]>
drm/amd/display: fix cursor black issue

Sugar Zhang <[email protected]>
ASoC: rockchip: pdm: fix regmap_ops hang issue

Max Filippov <[email protected]>
xtensa: fix initialization of pt_regs::syscall in start_thread

Jann Horn <[email protected]>
linux/kernel.h: Use parentheses around argument in u64_to_user_ptr()

Peter Zijlstra <[email protected]>
perf/x86/intel: Initialize TFA MSR

Stephane Eranian <[email protected]>
perf/x86/intel: Fix handling of wakeup_events for multi-entry PEBS

Dan Carpenter <[email protected]>
drm/mediatek: Fix an error code in mtk_hdmi_dt_parse_pdata()

Annaliese McDermond <[email protected]>
ASoC: tlv320aic32x4: Fix Common Pins

Chong Qiao <[email protected]>
MIPS: KGDB: fix kgdb support for SMP platforms.

Kaike Wan <[email protected]>
IB/hfi1: Fix the allocation of RSM table

Kaike Wan <[email protected]>
IB/hfi1: Eliminate opcode tests on mr deref

Tony Lindgren <[email protected]>
drm/omap: hdmi4_cec: Fix CEC clock handling for PM

Pankaj Bharadiya <[email protected]>
ASoC: dapm: Fix NULL pointer dereference in snd_soc_dapm_free_kcontrol

Daniel Mack <[email protected]>
ASoC: cs4270: Set auto-increment bit for register writes

Olivier Moysan <[email protected]>
ASoC: stm32: dfsdm: fix debugfs warnings on entry creation

Olivier Moysan <[email protected]>
ASoC: stm32: dfsdm: manage multiple prepare

Maxime Jourdan <[email protected]>
clk: meson-gxbb: round the vdec dividers to closest

Charles Keepax <[email protected]>
ASoC: wm_adsp: Add locking to wm_adsp2_bus_error

Shuming Fan <[email protected]>
ASoC: rt5682: recording has no sound after booting

Sylwester Nawrocki <[email protected]>
ASoC: samsung: odroid: Fix clock configuration for 44100 sample rate

John Hsu <[email protected]>
ASoC: nau8810: fix the issue of widget with prefixed name

John Hsu <[email protected]>
ASoC: nau8824: fix the issue of the widget with prefix name

Rander Wang <[email protected]>
ASoC:intel:skl:fix a simultaneous playback & capture issue on hda platform

Rander Wang <[email protected]>
ASoC:soc-pcm:fix a codec fixup issue in TDM case

Olivier Moysan <[email protected]>
ASoC: stm32: sai: fix exposed capabilities in spdif mode

Olivier Moysan <[email protected]>
ASoC: stm32: sai: fix iec958 controls indexation

Russell King <[email protected]>
ASoC: hdmi-codec: fix S/PDIF DAI

Philipp Puschmann <[email protected]>
ASoC: tlv320aic3x: fix reset gpio reference counting

Suresh Udipi <[email protected]>
staging: most: cdev: fix chrdev_region leak in mod_exit

Johan Hovold <[email protected]>
staging: greybus: power_supply: fix prop-descriptor request size

Andrey Ryabinin <[email protected]>
ubsan: Fix nasty -Wbuiltin-declaration-mismatch GCC-9 warnings

Dexuan Cui <[email protected]>
Drivers: hv: vmbus: Remove the undesired put_cpu_ptr() in hv_synic_cleanup()

Jason Yan <[email protected]>
scsi: libsas: fix a race condition when smp task timeout

YueHaibing <[email protected]>
net: stmmac: Use bfsize1 in ndesc_init_rx_desc


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

Diffstat:

Makefile | 4 +-
arch/arm64/include/asm/futex.h | 55 ++-
arch/mips/kernel/kgdb.c | 3 +-
arch/x86/events/intel/core.c | 8 +-
arch/xtensa/include/asm/processor.h | 21 +-
drivers/block/virtio_blk.c | 2 +
drivers/clk/meson/gxbb.c | 2 +
drivers/cpufreq/armada-37xx-cpufreq.c | 22 +-
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +-
drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c | 26 +-
drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 5 +-
drivers/hv/hv.c | 1 -
drivers/hwtracing/intel_th/pci.c | 5 +
drivers/infiniband/hw/hfi1/chip.c | 26 +-
drivers/infiniband/hw/hfi1/rc.c | 4 +-
drivers/infiniband/hw/hns/hns_roce_hem.c | 6 +-
drivers/infiniband/hw/hns/hns_roce_mr.c | 4 +-
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 +
drivers/iommu/amd_iommu_init.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 2 +-
drivers/nvme/host/fc.c | 20 +-
drivers/platform/x86/pmc_atom.c | 2 +-
drivers/scsi/csiostor/csio_scsi.c | 5 +-
drivers/scsi/libsas/sas_expander.c | 9 +-
drivers/scsi/lpfc/lpfc_attr.c | 180 ++++----
drivers/scsi/lpfc/lpfc_ct.c | 12 +-
drivers/scsi/lpfc/lpfc_debugfs.c | 453 +++++++++++----------
drivers/scsi/lpfc/lpfc_debugfs.h | 6 +-
drivers/scsi/qla2xxx/qla_attr.c | 4 +-
drivers/scsi/qla2xxx/qla_target.c | 4 +-
drivers/soc/sunxi/Kconfig | 1 +
drivers/staging/greybus/power_supply.c | 2 +-
drivers/staging/most/cdev/cdev.c | 2 +-
drivers/usb/class/cdc-acm.c | 32 +-
drivers/usb/dwc3/core.c | 2 +-
drivers/usb/musb/Kconfig | 2 +-
drivers/usb/serial/f81232.c | 39 ++
drivers/usb/storage/scsiglue.c | 26 +-
drivers/usb/storage/uas.c | 35 +-
drivers/virtio/virtio_pci_common.c | 8 +-
include/linux/kernel.h | 4 +-
include/net/bluetooth/hci_core.h | 3 +
kernel/events/core.c | 52 ++-
kernel/events/ring_buffer.c | 4 +-
kernel/futex.c | 188 +++++----
kernel/irq/manage.c | 4 +-
lib/ubsan.c | 49 ++-
mm/slab.c | 3 +-
net/bluetooth/hci_conn.c | 8 +
net/bluetooth/hidp/sock.c | 1 +
sound/soc/codecs/cs35l35.c | 11 +
sound/soc/codecs/cs4270.c | 1 +
sound/soc/codecs/hdmi-codec.c | 118 +++---
sound/soc/codecs/nau8810.c | 4 +-
sound/soc/codecs/nau8824.c | 46 ++-
sound/soc/codecs/rt5682.c | 14 +-
sound/soc/codecs/tlv320aic32x4.c | 2 +
sound/soc/codecs/tlv320aic3x.c | 5 +-
sound/soc/codecs/wm_adsp.c | 11 +-
.../soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 2 +-
sound/soc/intel/common/sst-firmware.c | 8 +-
sound/soc/intel/skylake/skl-pcm.c | 19 +-
sound/soc/rockchip/rockchip_pdm.c | 2 +
sound/soc/samsung/odroid.c | 4 +-
sound/soc/soc-dapm.c | 4 +
sound/soc/soc-pcm.c | 7 +-
sound/soc/stm/stm32_adfsdm.c | 38 +-
sound/soc/stm/stm32_sai_sub.c | 15 +-
tools/objtool/check.c | 1 +
70 files changed, 1019 insertions(+), 656 deletions(-)



2019-05-09 19:07:00

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 4.19 11/66] ASoC:soc-pcm:fix a codec fixup issue in TDM case

[ Upstream commit 570f18b6a8d1f0e60e8caf30e66161b6438dcc91 ]

On HDaudio platforms, if playback is started when capture is working,
there is no audible output.

This can be root-caused to the use of the rx|tx_mask to store an HDaudio
stream tag.

If capture is stared before playback, rx_mask would be non-zero on HDaudio
platform, then the channel number of playback, which is in the same codec
dai with the capture, would be changed by soc_pcm_codec_params_fixup based
on the tx_mask at first, then overwritten by this function based on rx_mask
at last.

According to the author of tx|rx_mask, tx_mask is for playback and rx_mask
is for capture. And stream direction is checked at all other references of
tx|rx_mask in ASoC, so here should be an error. This patch checks stream
direction for tx|rx_mask for fixup function.

This issue would affect not only HDaudio+ASoC, but also I2S codecs if the
channel number based on rx_mask is not equal to the one for tx_mask. It could
be rarely reproduecd because most drivers in kernel set the same channel number
to tx|rx_mask or rx_mask is zero.

Tested on all platforms using stream_tag & HDaudio and intel I2S platforms.

Signed-off-by: Rander Wang <[email protected]>
Acked-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
sound/soc/soc-pcm.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index e8b98bfd4cf13..33060af18b5a4 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -957,10 +957,13 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
codec_params = *params;

/* fixup params based on TDM slot masks */
- if (codec_dai->tx_mask)
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+ codec_dai->tx_mask)
soc_pcm_codec_params_fixup(&codec_params,
codec_dai->tx_mask);
- if (codec_dai->rx_mask)
+
+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE &&
+ codec_dai->rx_mask)
soc_pcm_codec_params_fixup(&codec_params,
codec_dai->rx_mask);

--
2.20.1



2019-05-09 19:07:07

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 4.19 30/66] perf/x86/intel: Initialize TFA MSR

[ Upstream commit d7262457e35dbe239659e62654e56f8ddb814bed ]

Stephane reported that the TFA MSR is not initialized by the kernel,
but the TFA bit could set by firmware or as a leftover from a kexec,
which makes the state inconsistent.

Reported-by: Stephane Eranian <[email protected]>
Tested-by: Nelson DSouza <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Vince Weaver <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/x86/events/intel/core.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 26432ee4590e3..f9958ad4d3353 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -3447,6 +3447,12 @@ static void intel_pmu_cpu_starting(int cpu)

cpuc->lbr_sel = NULL;

+ if (x86_pmu.flags & PMU_FL_TFA) {
+ WARN_ON_ONCE(cpuc->tfa_shadow);
+ cpuc->tfa_shadow = ~0ULL;
+ intel_set_tfa(cpuc, false);
+ }
+
if (x86_pmu.version > 1)
flip_smm_bit(&x86_pmu.attr_freeze_on_smi);

--
2.20.1



2019-05-09 19:07:11

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 4.19 03/66] Drivers: hv: vmbus: Remove the undesired put_cpu_ptr() in hv_synic_cleanup()

From: Dexuan Cui <[email protected]>

commit a0033bd1eae4650b69be07c17cb87393da584563 upstream.

With CONFIG_DEBUG_PREEMPT=y, the put_cpu_ptr() triggers an underflow
warning in preempt_count_sub().

Fixes: 37cdd991fac8 ("vmbus: put related per-cpu variable together")
Cc: [email protected]
Cc: Stephen Hemminger <[email protected]>
Signed-off-by: Dexuan Cui <[email protected]>
Reviewed-by: Michael Kelley <[email protected]>
Signed-off-by: Sasha Levin (Microsoft) <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/hv/hv.c | 1 -
1 file changed, 1 deletion(-)

--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -402,7 +402,6 @@ int hv_synic_cleanup(unsigned int cpu)

clockevents_unbind_device(hv_cpu->clk_evt, cpu);
hv_ce_shutdown(hv_cpu->clk_evt);
- put_cpu_ptr(hv_cpu);
}

hv_get_synint_state(VMBUS_MESSAGE_SINT, shared_sint.as_uint64);


2019-05-09 19:07:15

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 4.19 02/66] scsi: libsas: fix a race condition when smp task timeout

From: Jason Yan <[email protected]>

commit b90cd6f2b905905fb42671009dc0e27c310a16ae upstream.

When the lldd is processing the complete sas task in interrupt and set the
task stat as SAS_TASK_STATE_DONE, the smp timeout timer is able to be
triggered at the same time. And smp_task_timedout() will complete the task
wheter the SAS_TASK_STATE_DONE is set or not. Then the sas task may freed
before lldd end the interrupt process. Thus a use-after-free will happen.

Fix this by calling the complete() only when SAS_TASK_STATE_DONE is not
set. And remove the check of the return value of the del_timer(). Once the
LLDD sets DONE, it must call task->done(), which will call
smp_task_done()->complete() and the task will be completed and freed
correctly.

Reported-by: chenxiang <[email protected]>
Signed-off-by: Jason Yan <[email protected]>
CC: John Garry <[email protected]>
CC: Johannes Thumshirn <[email protected]>
CC: Ewan Milne <[email protected]>
CC: Christoph Hellwig <[email protected]>
CC: Tomas Henzl <[email protected]>
CC: Dan Williams <[email protected]>
CC: Hannes Reinecke <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: John Garry <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Cc: Guenter Roeck <[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/scsi/libsas/sas_expander.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -48,17 +48,16 @@ static void smp_task_timedout(struct tim
unsigned long flags;

spin_lock_irqsave(&task->task_state_lock, flags);
- if (!(task->task_state_flags & SAS_TASK_STATE_DONE))
+ if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) {
task->task_state_flags |= SAS_TASK_STATE_ABORTED;
+ complete(&task->slow_task->completion);
+ }
spin_unlock_irqrestore(&task->task_state_lock, flags);
-
- complete(&task->slow_task->completion);
}

static void smp_task_done(struct sas_task *task)
{
- if (!del_timer(&task->slow_task->timer))
- return;
+ del_timer(&task->slow_task->timer);
complete(&task->slow_task->completion);
}



2019-05-09 19:07:19

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 4.19 01/66] net: stmmac: Use bfsize1 in ndesc_init_rx_desc

From: YueHaibing <[email protected]>

commit f87db4dbd52f2f8a170a2b51cb0926221ca7c9e2 upstream.

gcc warn this:

drivers/net/ethernet/stmicro/stmmac/norm_desc.c: In function ndesc_init_rx_desc:
drivers/net/ethernet/stmicro/stmmac/norm_desc.c:138:6: warning: variable 'bfsize1' set but not used [-Wunused-but-set-variable]

Like enh_desc_init_rx_desc, we should use bfsize1
in ndesc_init_rx_desc to calculate 'p->des1'

Fixes: 583e63614149 ("net: stmmac: use correct DMA buffer size in the RX descriptor")
Signed-off-by: YueHaibing <[email protected]>
Reviewed-by: Aaro Koskinen <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Cc: Nobuhiro Iwamatsu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
@@ -140,7 +140,7 @@ static void ndesc_init_rx_desc(struct dm
p->des0 |= cpu_to_le32(RDES0_OWN);

bfsize1 = min(bfsize, BUF_SIZE_2KiB - 1);
- p->des1 |= cpu_to_le32(bfsize & RDES1_BUFFER1_SIZE_MASK);
+ p->des1 |= cpu_to_le32(bfsize1 & RDES1_BUFFER1_SIZE_MASK);

if (mode == STMMAC_CHAIN_MODE)
ndesc_rx_set_on_chain(p, end);


2019-05-09 19:07:26

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 4.19 28/66] drm/mediatek: Fix an error code in mtk_hdmi_dt_parse_pdata()

[ Upstream commit 2d85978341e6a32e7443d9f28639da254d53f400 ]

We don't want to overwrite "ret", it already holds the correct error
code. The "regmap" variable might be a valid pointer as this point.

Fixes: 8f83f26891e1 ("drm/mediatek: Add HDMI support")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: CK Hu <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/gpu/drm/mediatek/mtk_hdmi.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
index 643f5edd68fe3..c7a77d6f612b2 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
@@ -1473,7 +1473,6 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
if (IS_ERR(regmap))
ret = PTR_ERR(regmap);
if (ret) {
- ret = PTR_ERR(regmap);
dev_err(dev,
"Failed to get system configuration registers: %d\n",
ret);
--
2.20.1



2019-05-09 19:07:46

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 4.19 04/66] ubsan: Fix nasty -Wbuiltin-declaration-mismatch GCC-9 warnings

From: Andrey Ryabinin <[email protected]>

commit f0996bc2978e02d2ea898101462b960f6119b18f upstream.

Building lib/ubsan.c with gcc-9 results in a ton of nasty warnings like
this one:

lib/ubsan.c warning: conflicting types for built-in function
‘__ubsan_handle_negate_overflow’; expected ‘void(void *, void *)’ [-Wbuiltin-declaration-mismatch]

The kernel's declarations of __ubsan_handle_*() often uses 'unsigned
long' types in parameters while GCC these parameters as 'void *' types,
hence the mismatch.

Fix this by using 'void *' to match GCC's declarations.

Reported-by: Linus Torvalds <[email protected]>
Signed-off-by: Andrey Ryabinin <[email protected]>
Fixes: c6d308534aef ("UBSAN: run-time undefined behavior sanity checker")
Cc: <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
lib/ubsan.c | 49 +++++++++++++++++++++++--------------------------
1 file changed, 23 insertions(+), 26 deletions(-)

--- a/lib/ubsan.c
+++ b/lib/ubsan.c
@@ -86,11 +86,13 @@ static bool is_inline_int(struct type_de
return bits <= inline_bits;
}

-static s_max get_signed_val(struct type_descriptor *type, unsigned long val)
+static s_max get_signed_val(struct type_descriptor *type, void *val)
{
if (is_inline_int(type)) {
unsigned extra_bits = sizeof(s_max)*8 - type_bit_width(type);
- return ((s_max)val) << extra_bits >> extra_bits;
+ unsigned long ulong_val = (unsigned long)val;
+
+ return ((s_max)ulong_val) << extra_bits >> extra_bits;
}

if (type_bit_width(type) == 64)
@@ -99,15 +101,15 @@ static s_max get_signed_val(struct type_
return *(s_max *)val;
}

-static bool val_is_negative(struct type_descriptor *type, unsigned long val)
+static bool val_is_negative(struct type_descriptor *type, void *val)
{
return type_is_signed(type) && get_signed_val(type, val) < 0;
}

-static u_max get_unsigned_val(struct type_descriptor *type, unsigned long val)
+static u_max get_unsigned_val(struct type_descriptor *type, void *val)
{
if (is_inline_int(type))
- return val;
+ return (unsigned long)val;

if (type_bit_width(type) == 64)
return *(u64 *)val;
@@ -116,7 +118,7 @@ static u_max get_unsigned_val(struct typ
}

static void val_to_string(char *str, size_t size, struct type_descriptor *type,
- unsigned long value)
+ void *value)
{
if (type_is_int(type)) {
if (type_bit_width(type) == 128) {
@@ -163,8 +165,8 @@ static void ubsan_epilogue(unsigned long
current->in_ubsan--;
}

-static void handle_overflow(struct overflow_data *data, unsigned long lhs,
- unsigned long rhs, char op)
+static void handle_overflow(struct overflow_data *data, void *lhs,
+ void *rhs, char op)
{

struct type_descriptor *type = data->type;
@@ -191,8 +193,7 @@ static void handle_overflow(struct overf
}

void __ubsan_handle_add_overflow(struct overflow_data *data,
- unsigned long lhs,
- unsigned long rhs)
+ void *lhs, void *rhs)
{

handle_overflow(data, lhs, rhs, '+');
@@ -200,23 +201,21 @@ void __ubsan_handle_add_overflow(struct
EXPORT_SYMBOL(__ubsan_handle_add_overflow);

void __ubsan_handle_sub_overflow(struct overflow_data *data,
- unsigned long lhs,
- unsigned long rhs)
+ void *lhs, void *rhs)
{
handle_overflow(data, lhs, rhs, '-');
}
EXPORT_SYMBOL(__ubsan_handle_sub_overflow);

void __ubsan_handle_mul_overflow(struct overflow_data *data,
- unsigned long lhs,
- unsigned long rhs)
+ void *lhs, void *rhs)
{
handle_overflow(data, lhs, rhs, '*');
}
EXPORT_SYMBOL(__ubsan_handle_mul_overflow);

void __ubsan_handle_negate_overflow(struct overflow_data *data,
- unsigned long old_val)
+ void *old_val)
{
unsigned long flags;
char old_val_str[VALUE_LENGTH];
@@ -237,8 +236,7 @@ EXPORT_SYMBOL(__ubsan_handle_negate_over


void __ubsan_handle_divrem_overflow(struct overflow_data *data,
- unsigned long lhs,
- unsigned long rhs)
+ void *lhs, void *rhs)
{
unsigned long flags;
char rhs_val_str[VALUE_LENGTH];
@@ -323,7 +321,7 @@ static void ubsan_type_mismatch_common(s
}

void __ubsan_handle_type_mismatch(struct type_mismatch_data *data,
- unsigned long ptr)
+ void *ptr)
{
struct type_mismatch_data_common common_data = {
.location = &data->location,
@@ -332,12 +330,12 @@ void __ubsan_handle_type_mismatch(struct
.type_check_kind = data->type_check_kind
};

- ubsan_type_mismatch_common(&common_data, ptr);
+ ubsan_type_mismatch_common(&common_data, (unsigned long)ptr);
}
EXPORT_SYMBOL(__ubsan_handle_type_mismatch);

void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data_v1 *data,
- unsigned long ptr)
+ void *ptr)
{

struct type_mismatch_data_common common_data = {
@@ -347,12 +345,12 @@ void __ubsan_handle_type_mismatch_v1(str
.type_check_kind = data->type_check_kind
};

- ubsan_type_mismatch_common(&common_data, ptr);
+ ubsan_type_mismatch_common(&common_data, (unsigned long)ptr);
}
EXPORT_SYMBOL(__ubsan_handle_type_mismatch_v1);

void __ubsan_handle_vla_bound_not_positive(struct vla_bound_data *data,
- unsigned long bound)
+ void *bound)
{
unsigned long flags;
char bound_str[VALUE_LENGTH];
@@ -369,8 +367,7 @@ void __ubsan_handle_vla_bound_not_positi
}
EXPORT_SYMBOL(__ubsan_handle_vla_bound_not_positive);

-void __ubsan_handle_out_of_bounds(struct out_of_bounds_data *data,
- unsigned long index)
+void __ubsan_handle_out_of_bounds(struct out_of_bounds_data *data, void *index)
{
unsigned long flags;
char index_str[VALUE_LENGTH];
@@ -388,7 +385,7 @@ void __ubsan_handle_out_of_bounds(struct
EXPORT_SYMBOL(__ubsan_handle_out_of_bounds);

void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data,
- unsigned long lhs, unsigned long rhs)
+ void *lhs, void *rhs)
{
unsigned long flags;
struct type_descriptor *rhs_type = data->rhs_type;
@@ -439,7 +436,7 @@ void __ubsan_handle_builtin_unreachable(
EXPORT_SYMBOL(__ubsan_handle_builtin_unreachable);

void __ubsan_handle_load_invalid_value(struct invalid_value_data *data,
- unsigned long val)
+ void *val)
{
unsigned long flags;
char val_str[VALUE_LENGTH];


2019-05-10 00:08:28

by kernelci.org bot

[permalink] [raw]
Subject: Re: [PATCH 4.19 00/66] 4.19.42-stable review

stable-rc/linux-4.19.y boot: 135 boots: 1 failed, 132 passed with 2 conflicts (v4.19.41-67-g82fd2fd59cff)

Full Boot Summary: https://kernelci.org/boot/all/job/stable-rc/branch/linux-4.19.y/kernel/v4.19.41-67-g82fd2fd59cff/
Full Build Summary: https://kernelci.org/build/stable-rc/branch/linux-4.19.y/kernel/v4.19.41-67-g82fd2fd59cff/

Tree: stable-rc
Branch: linux-4.19.y
Git Describe: v4.19.41-67-g82fd2fd59cff
Git Commit: 82fd2fd59cffa3045f205da555c0defe8bb35912
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Tested: 71 unique boards, 25 SoC families, 15 builds out of 206

Boot Regressions Detected:

arm:

omap2plus_defconfig:
gcc-8:
omap4-panda:
lab-baylibre: failing since 1 day (last pass: v4.19.40-100-gf897c76a347c - first fail: v4.19.41)

x86_64:

x86_64_defconfig:
gcc-8:
qemu:
lab-collabora: new failure (last pass: v4.19.41-56-g487b15502665)

Boot Failure Detected:

arm:
multi_v7_defconfig:
gcc-8:
stih410-b2120: 1 failed lab

Conflicting Boot Failures Detected: (These likely are not failures as other labs are reporting PASS. Needs review.)

x86_64:
x86_64_defconfig:
qemu:
lab-baylibre: PASS (gcc-8)
lab-mhart: PASS (gcc-8)
lab-drue: PASS (gcc-8)
lab-collabora: FAIL (gcc-8)

arm:
omap2plus_defconfig:
omap4-panda:
lab-baylibre: FAIL (gcc-8)
lab-baylibre-seattle: PASS (gcc-8)

---
For more info write to <[email protected]>

2019-05-10 06:36:00

by Naresh Kamboju

[permalink] [raw]
Subject: Re: [PATCH 4.19 00/66] 4.19.42-stable review

On Fri, 10 May 2019 at 00:35, Greg Kroah-Hartman
<[email protected]> wrote:
>
> This is the start of the stable review cycle for the 4.19.42 release.
> There are 66 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Sat 11 May 2019 06:11:18 PM UTC.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.42-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>

Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.

Summary
------------------------------------------------------------------------

kernel: 4.19.42-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.19.y
git commit: 82fd2fd59cffa3045f205da555c0defe8bb35912
git describe: v4.19.41-67-g82fd2fd59cff
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.19-oe/build/v4.19.41-67-g82fd2fd59cff

No regressions (compared to build v4.19.41)

No fixes (compared to build v4.19.41)

Ran 24988 total tests in the following environments and test suites.

Environments
--------------
- dragonboard-410c - arm64
- hi6220-hikey - arm64
- i386
- juno-r2 - arm64
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15 - arm
- x86_64

Test Suites
-----------
* build
* install-android-platform-tools-r2600
* kselftest
* libgpiod
* libhugetlbfs
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-cpuhotplug-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-timers-tests
* perf
* spectre-meltdown-checker-test
* v4l2-compliance
* ltp-open-posix-tests
* prep-tmp-disk
* kvm-unit-tests
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-none

--
Linaro LKFT
https://lkft.linaro.org

2019-05-10 10:20:11

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH 4.19 00/66] 4.19.42-stable review


On 09/05/2019 19:41, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.19.42 release.
> There are 66 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Sat 11 May 2019 06:11:18 PM UTC.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.42-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h

All tests are passing for Tegra ...

Test results for stable-v4.19:
12 builds: 12 pass, 0 fail
22 boots: 22 pass, 0 fail
32 tests: 32 pass, 0 fail

Linux version: 4.19.42-rc1-g82fd2fd
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana, tegra210,
tegra210-p2371-2180, tegra30-cardhu-a04

Cheers
Jon

--
nvpublic

2019-05-10 13:55:08

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 4.19 00/66] 4.19.42-stable review

On 5/9/19 11:41 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.19.42 release.
> There are 66 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Sat 11 May 2019 06:11:18 PM UTC.
> Anything received after that time might be too late.
>

Build results:
total: 156 pass: 156 fail: 0
Qemu test results:
total: 349 pass: 349 fail: 0

Guenter

2019-05-10 21:26:29

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH 4.19 00/66] 4.19.42-stable review

On 5/9/19 12:41 PM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.19.42 release.
> There are 66 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Sat 11 May 2019 06:11:18 PM UTC.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.42-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
> and the diffstat can be found below.
>

Compiled and booted on my test system. No dmesg regressions.

thanks,
-- Shuah

2019-05-11 11:21:55

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH 4.19 00/66] 4.19.42-stable review

Hi!

> This is the start of the stable review cycle for the 4.19.42 release.
> There are 66 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Sat 11 May 2019 06:11:18 PM UTC.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.42-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
> and the diffstat can be found below.

I reviewed these patches and found them ok:

/- commit in linux-stable-rc.git linux-4.19.
| /- mainline commit it references.
a | c9849e7b0d19 03110a5cb216 | arm64: futex: Bound number of LDXR/STXR loops in FUTEX_WAKE_OP
a | 7f70094a664c 0efa3334d65b | ASoC: Intel: avoid Oops if DMA setup fails
a diff has whitespace problems | b47e4bc2c6bf 3ae62a42090f | UAS: fix alignment of scatter/gather segments
a | d93b3794e11d a1616a5ac99e | Bluetooth: hidp: fix buffer overflow
a | 390fb51f14ed 2137490f2147 | scsi: qla2xxx: Fix device staying in blocked state
a | 648efce413c9 5cbdae10bf11 | scsi: qla2xxx: Fix incorrect region-size setting in optrom SYSFS routines
a | de4ed47623d2 a84014e1db35 | soc: sunxi: Fix missing dependency on REGMAP_MMIO
a | cfccebbba945 8db82563451f | cpufreq: armada-37xx: fix frequency calculation for opp
a | a747d98ffde8 e60e9a4b231a | intel_th: pci: Add Comet Lake support
a | 79c5c7d9ce07 747668dbc061 | usb-storage: Set virt_boundary_mask to avoid SG overflows
a | 841f47e3548c 764478f41130 | USB: cdc-acm: fix unthrottle races
a | 14fa060959b0 8d791929b2fb | usb: dwc3: Fix default lpm_nyet_threshold value
a | 3b34dc57f585 59c39840f5ab | genirq: Prevent use-after-free and work list corruption
a | 2b02d3a95527 b995dcca7cf1 | platform/x86: pmc_atom: Drop __initconst on dmi table
a | 997718a02d82 d6ba3f815bc5 | ASoC: Intel: kbl: fix wrong number of channels
a | 1483cfcf3c9f 4772e03d2394 | RDMA/hns: Fix bug that caused srq creation to fail
a | 506a0e6862e1 6a8aae68c873 | virtio_pci: fix a NULL pointer reference in vp_del_vqs
a | 02fd02c489cc 1a07a94b47b1 | drm/sun4i: tcon top: Fix NULL/invalid pointer dereference in sun8i_tcon_top_un/bind
a | 71ad65f5bb67 fcf88917dd43 | slab: fix a crash by reading /proc/slab_allocators
a | b5d7ac566868 c85064435fe7 | ASoC: rockchip: pdm: fix regmap_ops hang issue
a | eaa1d16862ee d7262457e35d | perf/x86/intel: Initialize TFA MSR
a | 378151a25204 583feb08e7f7 | perf/x86/intel: Fix handling of wakeup_events for multi-entry PEBS
a | 0c56a7078088 2d85978341e6 | drm/mediatek: Fix an error code in mtk_hdmi_dt_parse_pdata()
a | adbf3d1f3ed8 c63adb28f6d9 | ASoC: tlv320aic32x4: Fix Common Pins
a | b9cdb2937e9a ab8a6d821179 | MIPS: KGDB: fix kgdb support for SMP platforms.
a | de583e633e02 a8639a79e85c | IB/hfi1: Eliminate opcode tests on mr deref
a typo: inaudile | b13ae59295e9 c899df3e9b0b | ASoC:intel:skl:fix a simultaneous playback & capture issue on hda platform
a | 3161876cbf97 570f18b6a8d1 | ASoC:soc-pcm:fix a codec fixup issue in TDM case
a wrong reference counting, not terribly serious; noone unloads these anyway | d978c80542e6 af708900e9a4 | ee3b6ffe3302 82ad759143ed | ASoC: tlv320aic3x: fix reset gpio reference counting
a "))" in changelog | e275c9a0765b 47830c1127ef | staging: greybus: power_supply: fix prop-descriptor request size
a | c211648a4906 a0033bd1eae4 | Drivers: hv: vmbus: Remove the undesired put_cpu_ptr() in hv_synic_cleanup()
a | 97aec5cea4fa b90cd6f2b905 | scsi: libsas: fix a race condition when smp task timeout
a | bf78d2cb30eb f87db4dbd52f | net: stmmac: Use bfsize1 in ndesc_init_rx_desc

A lot of the autosel patches do not seem to match stable criteria to
me. It would be good to synchronize documentation with actual practice here.

Best regards,
Pavel


--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


Attachments:
(No filename) (4.07 kB)
signature.asc (188.00 B)
Digital signature
Download all attachments