* [PATCH AUTOSEL 5.4 02/16] drm/msm/dpu: allow initialization of encoder locks during encoder init
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 03/16] ima: extend boot_aggregate with kernel measurements Sasha Levin
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Krishna Manikandan, Rob Clark, Sasha Levin, linux-arm-msm,
dri-devel, freedreno
From: Krishna Manikandan <mkrishn@codeaurora.org>
[ Upstream commit 2e7ec6b5297157efabb50e5f82adc628cf90296c ]
In the current implementation, mutex initialization
for encoder mutex locks are done during encoder
setup. This can lead to scenarios where the lock
is used before it is initialized. Move mutex_init
to dpu_encoder_init to avoid this.
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index d82ea994063fa..62a70e9c3dacc 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -2185,7 +2185,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
dpu_enc = to_dpu_encoder_virt(enc);
- mutex_init(&dpu_enc->enc_lock);
ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info);
if (ret)
goto fail;
@@ -2200,7 +2199,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
0);
- mutex_init(&dpu_enc->rc_lock);
INIT_DELAYED_WORK(&dpu_enc->delayed_off_work,
dpu_encoder_off_work);
dpu_enc->idle_timeout = IDLE_TIMEOUT;
@@ -2245,6 +2243,8 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
spin_lock_init(&dpu_enc->enc_spinlock);
dpu_enc->enabled = false;
+ mutex_init(&dpu_enc->enc_lock);
+ mutex_init(&dpu_enc->rc_lock);
return &dpu_enc->base;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 03/16] ima: extend boot_aggregate with kernel measurements
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 02/16] drm/msm/dpu: allow initialization of encoder locks during encoder init Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 04/16] drm/exynos: Properly propagate return value in drm_iommu_attach_device() Sasha Levin
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Maurizio Drocco, Bruno Meneguele, Mimi Zohar, Sasha Levin,
linux-integrity, linux-security-module
From: Maurizio Drocco <maurizio.drocco@ibm.com>
[ Upstream commit 20c59ce010f84300f6c655d32db2610d3433f85c ]
Registers 8-9 are used to store measurements of the kernel and its
command line (e.g., grub2 bootloader with tpm module enabled). IMA
should include them in the boot aggregate. Registers 8-9 should be
only included in non-SHA1 digests to avoid ambiguity.
Signed-off-by: Maurizio Drocco <maurizio.drocco@ibm.com>
Reviewed-by: Bruno Meneguele <bmeneg@redhat.com>
Tested-by: Bruno Meneguele <bmeneg@redhat.com> (TPM 1.2, TPM 2.0)
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/integrity/ima/ima.h | 2 +-
security/integrity/ima/ima_crypto.c | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h
index be469fce19e12..d5127b9f24ae1 100644
--- a/security/integrity/ima/ima.h
+++ b/security/integrity/ima/ima.h
@@ -30,7 +30,7 @@
enum ima_show_type { IMA_SHOW_BINARY, IMA_SHOW_BINARY_NO_FIELD_LEN,
IMA_SHOW_BINARY_OLD_STRING_FMT, IMA_SHOW_ASCII };
-enum tpm_pcrs { TPM_PCR0 = 0, TPM_PCR8 = 8 };
+enum tpm_pcrs { TPM_PCR0 = 0, TPM_PCR8 = 8, TPM_PCR10 = 10 };
/* digest size for IMA, fits SHA1 or MD5 */
#define IMA_DIGEST_SIZE SHA1_DIGEST_SIZE
diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c
index d5ad7b2539c75..c9b04005c8be9 100644
--- a/security/integrity/ima/ima_crypto.c
+++ b/security/integrity/ima/ima_crypto.c
@@ -682,13 +682,26 @@ static int ima_calc_boot_aggregate_tfm(char *digest, u16 alg_id,
if (rc != 0)
return rc;
- /* cumulative sha1 over tpm registers 0-7 */
+ /* cumulative digest over TPM registers 0-7 */
for (i = TPM_PCR0; i < TPM_PCR8; i++) {
ima_pcrread(i, &d);
/* now accumulate with current aggregate */
rc = crypto_shash_update(shash, d.digest,
crypto_shash_digestsize(tfm));
}
+ /*
+ * Extend cumulative digest over TPM registers 8-9, which contain
+ * measurement for the kernel command line (reg. 8) and image (reg. 9)
+ * in a typical PCR allocation. Registers 8-9 are only included in
+ * non-SHA1 boot_aggregate digests to avoid ambiguity.
+ */
+ if (alg_id != TPM_ALG_SHA1) {
+ for (i = TPM_PCR8; i < TPM_PCR10; i++) {
+ ima_pcrread(i, &d);
+ rc = crypto_shash_update(shash, d.digest,
+ crypto_shash_digestsize(tfm));
+ }
+ }
if (!rc)
crypto_shash_final(shash, digest);
return rc;
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 04/16] drm/exynos: Properly propagate return value in drm_iommu_attach_device()
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 02/16] drm/msm/dpu: allow initialization of encoder locks during encoder init Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 03/16] ima: extend boot_aggregate with kernel measurements Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 05/16] drm/exynos: fix ref count leak in mic_pre_enable Sasha Levin
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Marek Szyprowski, kbuild test robot, Inki Dae, Sasha Levin,
dri-devel, linux-arm-kernel, linux-samsung-soc
From: Marek Szyprowski <m.szyprowski@samsung.com>
[ Upstream commit b9c633882de4601015625f9136f248e9abca8a7a ]
Propagate the proper error codes from the called functions instead of
unconditionally returning 0.
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Merge conflict so merged it manually.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/exynos/exynos_drm_dma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c b/drivers/gpu/drm/exynos/exynos_drm_dma.c
index 619f81435c1b2..58b89ec11b0eb 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dma.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c
@@ -61,7 +61,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev,
struct device *subdrv_dev, void **dma_priv)
{
struct exynos_drm_private *priv = drm_dev->dev_private;
- int ret;
+ int ret = 0;
if (get_dma_ops(priv->dma_dev) != get_dma_ops(subdrv_dev)) {
DRM_DEV_ERROR(subdrv_dev, "Device %s lacks support for IOMMU\n",
@@ -92,7 +92,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev,
if (ret)
clear_dma_max_seg_size(subdrv_dev);
- return 0;
+ return ret;
}
/*
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 05/16] drm/exynos: fix ref count leak in mic_pre_enable
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
` (2 preceding siblings ...)
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 04/16] drm/exynos: Properly propagate return value in drm_iommu_attach_device() Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 06/16] x86/fpu: Reset MXCSR to default in kernel_fpu_begin() Sasha Levin
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Navid Emamdoost, Inki Dae, Sasha Levin, dri-devel,
linux-arm-kernel, linux-samsung-soc
From: Navid Emamdoost <navid.emamdoost@gmail.com>
[ Upstream commit d4f5a095daf0d25f0b385e1ef26338608433a4c5 ]
in mic_pre_enable, pm_runtime_get_sync is called which
increments the counter even in case of failure, leading to incorrect
ref count. In case of failure, decrement the ref count before returning.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/exynos/exynos_drm_mic.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c
index b78e8c5ba553b..2aff986add899 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c
@@ -268,8 +268,10 @@ static void mic_pre_enable(struct drm_bridge *bridge)
goto unlock;
ret = pm_runtime_get_sync(mic->dev);
- if (ret < 0)
+ if (ret < 0) {
+ pm_runtime_put_noidle(mic->dev);
goto unlock;
+ }
mic_set_path(mic, 1);
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 06/16] x86/fpu: Reset MXCSR to default in kernel_fpu_begin()
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
` (3 preceding siblings ...)
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 05/16] drm/exynos: fix ref count leak in mic_pre_enable Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 07/16] thermal/drivers: imx: Fix missing of_node_put() at probe time Sasha Levin
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Petteri Aimonen, Borislav Petkov, Sasha Levin
From: Petteri Aimonen <jpa@git.mail.kapsi.fi>
[ Upstream commit 7ad816762f9bf89e940e618ea40c43138b479e10 ]
Previously, kernel floating point code would run with the MXCSR control
register value last set by userland code by the thread that was active
on the CPU core just before kernel call. This could affect calculation
results if rounding mode was changed, or a crash if a FPU/SIMD exception
was unmasked.
Restore MXCSR to the kernel's default value.
[ bp: Carve out from a bigger patch by Petteri, add feature check, add
FNINIT call too (amluto). ]
Signed-off-by: Petteri Aimonen <jpa@git.mail.kapsi.fi>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=207979
Link: https://lkml.kernel.org/r/20200624114646.28953-2-bp@alien8.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/include/asm/fpu/internal.h | 5 +++++
arch/x86/kernel/fpu/core.c | 6 ++++++
2 files changed, 11 insertions(+)
diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h
index 44c48e34d7994..00eac7f1529b0 100644
--- a/arch/x86/include/asm/fpu/internal.h
+++ b/arch/x86/include/asm/fpu/internal.h
@@ -619,6 +619,11 @@ static inline void switch_fpu_finish(struct fpu *new_fpu)
* MXCSR and XCR definitions:
*/
+static inline void ldmxcsr(u32 mxcsr)
+{
+ asm volatile("ldmxcsr %0" :: "m" (mxcsr));
+}
+
extern unsigned int mxcsr_feature_mask;
#define XCR_XFEATURE_ENABLED_MASK 0x00000000
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index 12c70840980e4..cd8839027f66d 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -101,6 +101,12 @@ void kernel_fpu_begin(void)
copy_fpregs_to_fpstate(¤t->thread.fpu);
}
__cpu_invalidate_fpregs_state();
+
+ if (boot_cpu_has(X86_FEATURE_XMM))
+ ldmxcsr(MXCSR_DEFAULT);
+
+ if (boot_cpu_has(X86_FEATURE_FPU))
+ asm volatile ("fninit");
}
EXPORT_SYMBOL_GPL(kernel_fpu_begin);
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 07/16] thermal/drivers: imx: Fix missing of_node_put() at probe time
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
` (4 preceding siblings ...)
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 06/16] x86/fpu: Reset MXCSR to default in kernel_fpu_begin() Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 08/16] blk-mq-debugfs: update blk_queue_flag_name[] accordingly for new flags Sasha Levin
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Anson Huang, Daniel Lezcano, Sasha Levin, linux-pm,
linux-arm-kernel
From: Anson Huang <Anson.Huang@nxp.com>
[ Upstream commit b45fd13be340e4ed0a2a9673ba299eb2a71ba829 ]
After finishing using cpu node got from of_get_cpu_node(), of_node_put()
needs to be called.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/1585232945-23368-1-git-send-email-Anson.Huang@nxp.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/thermal/imx_thermal.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index bb6754a5342c1..85511c1160b7f 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -656,7 +656,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match);
static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
{
struct device_node *np;
- int ret;
+ int ret = 0;
data->policy = cpufreq_cpu_get(0);
if (!data->policy) {
@@ -671,11 +671,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
if (IS_ERR(data->cdev)) {
ret = PTR_ERR(data->cdev);
cpufreq_cpu_put(data->policy);
- return ret;
}
}
- return 0;
+ of_node_put(np);
+
+ return ret;
}
static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data)
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 08/16] blk-mq-debugfs: update blk_queue_flag_name[] accordingly for new flags
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
` (5 preceding siblings ...)
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 07/16] thermal/drivers: imx: Fix missing of_node_put() at probe time Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 09/16] m68k: nommu: register start of the memory with memblock Sasha Levin
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Hou Tao, Bart Van Assche, Jens Axboe, Sasha Levin, linux-block
From: Hou Tao <houtao1@huawei.com>
[ Upstream commit bfe373f608cf81b7626dfeb904001b0e867c5110 ]
Else there may be magic numbers in /sys/kernel/debug/block/*/state.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/blk-mq-debugfs.c | 3 +++
include/linux/blkdev.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index b3f2ba483992d..121f4c1e0697b 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -125,6 +125,9 @@ static const char *const blk_queue_flag_name[] = {
QUEUE_FLAG_NAME(REGISTERED),
QUEUE_FLAG_NAME(SCSI_PASSTHROUGH),
QUEUE_FLAG_NAME(QUIESCED),
+ QUEUE_FLAG_NAME(PCI_P2PDMA),
+ QUEUE_FLAG_NAME(ZONE_RESETALL),
+ QUEUE_FLAG_NAME(RQ_ALLOC_TIME),
};
#undef QUEUE_FLAG_NAME
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index bff1def62eed9..d5338b9ee5502 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -592,6 +592,7 @@ struct request_queue {
u64 write_hints[BLK_MAX_WRITE_HINTS];
};
+/* Keep blk_queue_flag_name[] in sync with the definitions below */
#define QUEUE_FLAG_STOPPED 0 /* queue is stopped */
#define QUEUE_FLAG_DYING 1 /* queue being torn down */
#define QUEUE_FLAG_NOMERGES 3 /* disable merge attempts */
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 09/16] m68k: nommu: register start of the memory with memblock
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
` (6 preceding siblings ...)
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 08/16] blk-mq-debugfs: update blk_queue_flag_name[] accordingly for new flags Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 10/16] m68k: mm: fix node memblock init Sasha Levin
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Mike Rapoport, Greg Ungerer, Sasha Levin, linux-m68k
From: Mike Rapoport <rppt@linux.ibm.com>
[ Upstream commit d63bd8c81d8ab64db506ffde569cc8ff197516e2 ]
The m68k nommu setup code didn't register the beginning of the physical
memory with memblock because it was anyway occupied by the kernel. However,
commit fa3354e4ea39 ("mm: free_area_init: use maximal zone PFNs rather than
zone sizes") changed zones initialization to use memblock.memory to detect
the zone extents and this caused inconsistency between zone PFNs and the
actual PFNs:
BUG: Bad page state in process swapper pfn:20165
page:41fe0ca0 refcount:0 mapcount:1 mapping:00000000 index:0x0 flags: 0x0()
raw: 00000000 00000100 00000122 00000000 00000000 00000000 00000000 00000000
page dumped because: nonzero mapcount
CPU: 0 PID: 1 Comm: swapper Not tainted 5.8.0-rc1-00001-g3a38f8a60c65-dirty #1
Stack from 404c9ebc:
404c9ebc 4029ab28 4029ab28 40088470 41fe0ca0 40299e21 40299df1 404ba2a4
00020165 00000000 41fd2c10 402c7ba0 41fd2c04 40088504 41fe0ca0 40299e21
00000000 40088a12 41fe0ca0 41fe0ca4 0000020a 00000000 00000001 402ca000
00000000 41fe0ca0 41fd2c10 41fd2c10 00000000 00000000 402b2388 00000001
400a0934 40091056 404c9f44 404c9f44 40088db4 402c7ba0 00000001 41fd2c04
41fe0ca0 41fd2000 41fe0ca0 40089e02 4026ecf4 40089e4e 41fe0ca0 ffffffff
Call Trace:
[<40088470>] 0x40088470
[<40088504>] 0x40088504
[<40088a12>] 0x40088a12
[<402ca000>] 0x402ca000
[<400a0934>] 0x400a0934
Adjust the memory registration with memblock to include the beginning of
the physical memory and make sure that the area occupied by the kernel is
marked as reserved.
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/m68k/kernel/setup_no.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c
index 3c5def10d486e..caa260f877f24 100644
--- a/arch/m68k/kernel/setup_no.c
+++ b/arch/m68k/kernel/setup_no.c
@@ -139,7 +139,8 @@ void __init setup_arch(char **cmdline_p)
pr_debug("MEMORY -> ROMFS=0x%p-0x%06lx MEM=0x%06lx-0x%06lx\n ",
__bss_stop, memory_start, memory_start, memory_end);
- memblock_add(memory_start, memory_end - memory_start);
+ memblock_add(_rambase, memory_end - _rambase);
+ memblock_reserve(_rambase, memory_start - _rambase);
/* Keep a copy of command line */
*cmdline_p = &command_line[0];
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 10/16] m68k: mm: fix node memblock init
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
` (7 preceding siblings ...)
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 09/16] m68k: nommu: register start of the memory with memblock Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 11/16] dt-bindings: mailbox: zynqmp_ipi: fix unit address Sasha Levin
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Angelo Dureghello, Mike Rapoport, Greg Ungerer, Sasha Levin,
linux-m68k
From: Angelo Dureghello <angelo.dureghello@timesys.com>
[ Upstream commit c43e55796dd4d13f4855971a4d7970ce2cd94db4 ]
After pulling 5.7.0 (linux-next merge), mcf5441x mmu boot was
hanging silently.
memblock_add() seems not appropriate, since using MAX_NUMNODES
as node id, while memblock_add_node() sets up memory for node id 0.
Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/m68k/mm/mcfmmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c
index 6cb1e41d58d00..70a5f55ea6647 100644
--- a/arch/m68k/mm/mcfmmu.c
+++ b/arch/m68k/mm/mcfmmu.c
@@ -164,7 +164,7 @@ void __init cf_bootmem_alloc(void)
m68k_memory[0].addr = _rambase;
m68k_memory[0].size = _ramend - _rambase;
- memblock_add(m68k_memory[0].addr, m68k_memory[0].size);
+ memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0);
/* compute total pages in system */
num_pages = PFN_DOWN(_ramend - _rambase);
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 11/16] dt-bindings: mailbox: zynqmp_ipi: fix unit address
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
` (8 preceding siblings ...)
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 10/16] m68k: mm: fix node memblock init Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 12/16] cifs: prevent truncation from long to int in wait_for_free_credits Sasha Levin
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Kangmin Park, Rob Herring, Sasha Levin, devicetree,
linux-arm-kernel
From: Kangmin Park <l4stpr0gr4m@gmail.com>
[ Upstream commit 35b9c0fdb9f666628ecda02b1fc44306933a2d97 ]
Fix unit address to match the first address specified in the reg
property of the node in example.
Signed-off-by: Kangmin Park <l4stpr0gr4m@gmail.com>
Link: https://lore.kernel.org/r/20200625135158.5861-1-l4stpr0gr4m@gmail.com
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt
index 4438432bfe9b3..ad76edccf8816 100644
--- a/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt
+++ b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt
@@ -87,7 +87,7 @@ Example:
ranges;
/* APU<->RPU0 IPI mailbox controller */
- ipi_mailbox_rpu0: mailbox@ff90400 {
+ ipi_mailbox_rpu0: mailbox@ff990400 {
reg = <0xff990400 0x20>,
<0xff990420 0x20>,
<0xff990080 0x20>,
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 12/16] cifs: prevent truncation from long to int in wait_for_free_credits
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
` (9 preceding siblings ...)
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 11/16] dt-bindings: mailbox: zynqmp_ipi: fix unit address Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 13/16] arm64/alternatives: use subsections for replacement sequences Sasha Levin
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Ronnie Sahlberg, Marshall Midden, Steve French, Sasha Levin,
linux-cifs, samba-technical
From: Ronnie Sahlberg <lsahlber@redhat.com>
[ Upstream commit 19e888678bac8c82206eb915eaf72741b2a2615c ]
The wait_event_... defines evaluate to long so we should not assign it an int as this may truncate
the value.
Reported-by: Marshall Midden <marshallmidden@gmail.com>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/cifs/transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index fe1552cc8a0a7..eafc49de4d7f7 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -528,7 +528,7 @@ wait_for_free_credits(struct TCP_Server_Info *server, const int num_credits,
const int timeout, const int flags,
unsigned int *instance)
{
- int rc;
+ long rc;
int *credits;
int optype;
long int t;
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 13/16] arm64/alternatives: use subsections for replacement sequences
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
` (10 preceding siblings ...)
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 12/16] cifs: prevent truncation from long to int in wait_for_free_credits Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 14/16] tpm_tis: extra chip->ops check on error path in tpm_tis_core_init Sasha Levin
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Ard Biesheuvel, Suzuki K Poulose, James Morse, Andre Przywara,
Dave P Martin, Will Deacon, Sasha Levin, linux-arm-kernel
From: Ard Biesheuvel <ardb@kernel.org>
[ Upstream commit f7b93d42945cc71e1346dd5ae07c59061d56745e ]
When building very large kernels, the logic that emits replacement
sequences for alternatives fails when relative branches are present
in the code that is emitted into the .altinstr_replacement section
and patched in at the original site and fixed up. The reason is that
the linker will insert veneers if relative branches go out of range,
and due to the relative distance of the .altinstr_replacement from
the .text section where its branch targets usually live, veneers
may be emitted at the end of the .altinstr_replacement section, with
the relative branches in the sequence pointed at the veneers instead
of the actual target.
The alternatives patching logic will attempt to fix up the branch to
point to its original target, which will be the veneer in this case,
but given that the patch site is likely to be far away as well, it
will be out of range and so patching will fail. There are other cases
where these veneers are problematic, e.g., when the target of the
branch is in .text while the patch site is in .init.text, in which
case putting the replacement sequence inside .text may not help either.
So let's use subsections to emit the replacement code as closely as
possible to the patch site, to ensure that veneers are only likely to
be emitted if they are required at the patch site as well, in which
case they will be in range for the replacement sequence both before
and after it is transported to the patch site.
This will prevent alternative sequences in non-init code from being
released from memory after boot, but this is tolerable given that the
entire section is only 512 KB on an allyesconfig build (which weighs in
at 500+ MB for the entire Image). Also, note that modules today carry
the replacement sequences in non-init sections as well, and any of
those that target init code will be emitted into init sections after
this change.
This fixes an early crash when booting an allyesconfig kernel on a
system where any of the alternatives sequences containing relative
branches are activated at boot (e.g., ARM64_HAS_PAN on TX2)
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Dave P Martin <dave.martin@arm.com>
Link: https://lore.kernel.org/r/20200630081921.13443-1-ardb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/include/asm/alternative.h | 16 ++++++++--------
arch/arm64/kernel/vmlinux.lds.S | 3 ---
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h
index 5e5dc05d63a06..12f0eb56a1cc3 100644
--- a/arch/arm64/include/asm/alternative.h
+++ b/arch/arm64/include/asm/alternative.h
@@ -73,11 +73,11 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
".pushsection .altinstructions,\"a\"\n" \
ALTINSTR_ENTRY(feature) \
".popsection\n" \
- ".pushsection .altinstr_replacement, \"a\"\n" \
+ ".subsection 1\n" \
"663:\n\t" \
newinstr "\n" \
"664:\n\t" \
- ".popsection\n\t" \
+ ".previous\n\t" \
".org . - (664b-663b) + (662b-661b)\n\t" \
".org . - (662b-661b) + (664b-663b)\n" \
".endif\n"
@@ -117,9 +117,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
662: .pushsection .altinstructions, "a"
altinstruction_entry 661b, 663f, \cap, 662b-661b, 664f-663f
.popsection
- .pushsection .altinstr_replacement, "ax"
+ .subsection 1
663: \insn2
-664: .popsection
+664: .previous
.org . - (664b-663b) + (662b-661b)
.org . - (662b-661b) + (664b-663b)
.endif
@@ -160,7 +160,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
.pushsection .altinstructions, "a"
altinstruction_entry 663f, 661f, \cap, 664f-663f, 662f-661f
.popsection
- .pushsection .altinstr_replacement, "ax"
+ .subsection 1
.align 2 /* So GAS knows label 661 is suitably aligned */
661:
.endm
@@ -179,9 +179,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
.macro alternative_else
662:
.if .Lasm_alt_mode==0
- .pushsection .altinstr_replacement, "ax"
+ .subsection 1
.else
- .popsection
+ .previous
.endif
663:
.endm
@@ -192,7 +192,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
.macro alternative_endif
664:
.if .Lasm_alt_mode==0
- .popsection
+ .previous
.endif
.org . - (664b-663b) + (662b-661b)
.org . - (662b-661b) + (664b-663b)
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index e1af25dbc57ea..8d0374ffdd2d6 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -172,9 +172,6 @@ SECTIONS
*(.altinstructions)
__alt_instructions_end = .;
}
- .altinstr_replacement : {
- *(.altinstr_replacement)
- }
. = ALIGN(PAGE_SIZE);
__inittext_end = .;
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 14/16] tpm_tis: extra chip->ops check on error path in tpm_tis_core_init
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
` (11 preceding siblings ...)
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 13/16] arm64/alternatives: use subsections for replacement sequences Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 15/16] gfs2: read-only mounts should grab the sd_freeze_gl glock Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 16/16] i2c: eg20t: Load module automatically if ID matches Sasha Levin
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Vasily Averin, Jerry Snitselaar, Jarkko Sakkinen, Sasha Levin,
linux-integrity
From: Vasily Averin <vvs@virtuozzo.com>
[ Upstream commit ccf6fb858e17a8f8a914a1c6444d277cfedfeae6 ]
Found by smatch:
drivers/char/tpm/tpm_tis_core.c:1088 tpm_tis_core_init() warn:
variable dereferenced before check 'chip->ops' (see line 979)
'chip->ops' is assigned in the beginning of function
in tpmm_chip_alloc->tpm_chip_alloc
and is used before first possible goto to error path.
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/char/tpm/tpm_tis_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index bdcf8f25cd0d0..63f6bed78d893 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -1006,7 +1006,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
return 0;
out_err:
- if ((chip->ops != NULL) && (chip->ops->clk_enable != NULL))
+ if (chip->ops->clk_enable != NULL)
chip->ops->clk_enable(chip, false);
tpm_tis_remove(chip);
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 15/16] gfs2: read-only mounts should grab the sd_freeze_gl glock
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
` (12 preceding siblings ...)
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 14/16] tpm_tis: extra chip->ops check on error path in tpm_tis_core_init Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 16/16] i2c: eg20t: Load module automatically if ID matches Sasha Levin
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Bob Peterson, Sasha Levin, cluster-devel
From: Bob Peterson <rpeterso@redhat.com>
[ Upstream commit b780cc615ba4795a7ef0e93b19424828a5ad456a ]
Before this patch, only read-write mounts would grab the freeze
glock in read-only mode, as part of gfs2_make_fs_rw. So the freeze
glock was never initialized. That meant requests to freeze, which
request the glock in EX, were granted without any state transition.
That meant you could mount a gfs2 file system, which is currently
frozen on a different cluster node, in read-only mode.
This patch makes read-only mounts lock the freeze glock in SH mode,
which will block for file systems that are frozen on another node.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/gfs2/ops_fstype.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index c26c864590cc3..e0c55765b06d2 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -1168,7 +1168,17 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc)
goto fail_per_node;
}
- if (!sb_rdonly(sb)) {
+ if (sb_rdonly(sb)) {
+ struct gfs2_holder freeze_gh;
+
+ error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED,
+ GL_EXACT, &freeze_gh);
+ if (error) {
+ fs_err(sdp, "can't make FS RO: %d\n", error);
+ goto fail_per_node;
+ }
+ gfs2_glock_dq_uninit(&freeze_gh);
+ } else {
error = gfs2_make_fs_rw(sdp);
if (error) {
fs_err(sdp, "can't make FS RW: %d\n", error);
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH AUTOSEL 5.4 16/16] i2c: eg20t: Load module automatically if ID matches
2020-07-08 15:41 [PATCH AUTOSEL 5.4 01/16] drm/msm: fix potential memleak in error branch Sasha Levin
` (13 preceding siblings ...)
2020-07-08 15:41 ` [PATCH AUTOSEL 5.4 15/16] gfs2: read-only mounts should grab the sd_freeze_gl glock Sasha Levin
@ 2020-07-08 15:41 ` Sasha Levin
14 siblings, 0 replies; 16+ messages in thread
From: Sasha Levin @ 2020-07-08 15:41 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Andy Shevchenko, Wolfram Sang, Sasha Levin, linux-i2c
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[ Upstream commit 5f90786b31fb7d1e199a8999d46c4e3aea672e11 ]
The driver can't be loaded automatically because it misses
module alias to be provided. Add corresponding MODULE_DEVICE_TABLE()
call to the driver.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-eg20t.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c
index bb810dee8fb5e..73f139690e4e5 100644
--- a/drivers/i2c/busses/i2c-eg20t.c
+++ b/drivers/i2c/busses/i2c-eg20t.c
@@ -180,6 +180,7 @@ static const struct pci_device_id pch_pcidev_id[] = {
{ PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_I2C), 1, },
{0,}
};
+MODULE_DEVICE_TABLE(pci, pch_pcidev_id);
static irqreturn_t pch_i2c_handler(int irq, void *pData);
--
2.25.1
^ permalink raw reply related [flat|nested] 16+ messages in thread