Commit in question: https://lkml.org/lkml/2018/9/27/647
Device tested on: OnePlus 5
Android Version: 9, Pie
Kernel Version: 4.4.177 (Personal Kernel)
This patch seems to break Bluetooth connectivity for DualShock 4
controllers on 4.4. Reverting it fixes the issue, reported and
confirmed by one of my users.
I've confirmed that this happens on other devices of the same kernel
version (4.4.y) - Redmi Note 5 Pro and other OnePlus 5/5T's for
kernels that have this commit.
On Mon 25-03-19 00:38:20, Sasha Levin wrote:
> Hi,
>
> [This is an automated email]
>
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: b2770da64254 mm: add vm_insert_mixed_mkwrite().
>
> The bot has tested the following trees: v5.0.3, v4.19.30, v4.14.107.
>
> v5.0.3: Build OK!
> v4.19.30: Failed to apply! Possible dependencies:
> f2c57d91b0d9 ("mm: Fix warning in insert_pfn()")
>
> v4.14.107: Failed to apply! Possible dependencies:
> f2c57d91b0d9 ("mm: Fix warning in insert_pfn()")
>
>
> How should we proceed with this patch?
I'd say apply also f2c57d91b0d9 to both trees. Nice automation BTW :).
Honza
--
Jan Kara <jack(a)suse.com>
SUSE Labs, CR
Commit 240730437deb ("KEYS: trusted: explicitly use tpm_chip structure from
tpm_default_chip()") changed the tpm_chip argument of every TPM function
from NULL to a pointer that is retrieved at module initialization time.
Unlike before this patch, the trusted module cannot be loaded if no TPM is
available. Unfortunately, this causes a dependency problem because the
encrypted key type requires the 'key_type_trusted' symbol when
CONFIG_TRUSTED_KEYS is defined.
This patch fixes the issue by deferring the execution of TPM-specific code
until a new trusted key is instantiated: init_tpm(), to obtain a tpm_chip
pointer; init_digests(), introduced by commit 0b6cf6b97b7e ("tpm: pass an
array of tpm_extend_digest structures to tpm_pcr_extend()"), to get random
bytes from the TPM to lock a PCR.
Cc: stable(a)vger.kernel.org
Fixes: 240730437deb ("KEYS: trusted: explicitly use tpm_chip structure from tpm_default_chip()")
Reported-by: Dan Williams <dan.j.williams(a)intel.com>
Signed-off-by: Roberto Sassu <roberto.sassu(a)huawei.com>
---
security/keys/trusted.c | 89 +++++++++++++++++++++++------------------
1 file changed, 50 insertions(+), 39 deletions(-)
diff --git a/security/keys/trusted.c b/security/keys/trusted.c
index ecec672d3a77..c5162ca9c944 100644
--- a/security/keys/trusted.c
+++ b/security/keys/trusted.c
@@ -946,6 +946,44 @@ static struct trusted_key_payload *trusted_payload_alloc(struct key *key)
return p;
}
+static int init_tpm(void)
+{
+ if (chip)
+ return 0;
+
+ chip = tpm_default_chip();
+ if (!chip)
+ return -ENODEV;
+
+ return 0;
+}
+
+static int init_digests(void)
+{
+ u8 digest[TPM_MAX_DIGEST_SIZE];
+ int ret;
+ int i;
+
+ if (digests)
+ return 0;
+
+ ret = tpm_get_random(chip, digest, TPM_MAX_DIGEST_SIZE);
+ if (ret < 0)
+ return ret;
+ if (ret < TPM_MAX_DIGEST_SIZE)
+ return -EFAULT;
+
+ digests = kcalloc(chip->nr_allocated_banks, sizeof(*digests),
+ GFP_KERNEL);
+ if (!digests)
+ return -ENOMEM;
+
+ for (i = 0; i < chip->nr_allocated_banks; i++)
+ memcpy(digests[i].digest, digest, TPM_MAX_DIGEST_SIZE);
+
+ return 0;
+}
+
/*
* trusted_instantiate - create a new trusted key
*
@@ -967,6 +1005,14 @@ static int trusted_instantiate(struct key *key,
size_t key_len;
int tpm2;
+ ret = init_tpm();
+ if (ret < 0)
+ return ret;
+
+ ret = init_digests();
+ if (ret < 0)
+ return ret;
+
tpm2 = tpm_is_tpm2(chip);
if (tpm2 < 0)
return tpm2;
@@ -1218,58 +1264,23 @@ static int __init trusted_shash_alloc(void)
return ret;
}
-static int __init init_digests(void)
-{
- u8 digest[TPM_MAX_DIGEST_SIZE];
- int ret;
- int i;
-
- ret = tpm_get_random(chip, digest, TPM_MAX_DIGEST_SIZE);
- if (ret < 0)
- return ret;
- if (ret < TPM_MAX_DIGEST_SIZE)
- return -EFAULT;
-
- digests = kcalloc(chip->nr_allocated_banks, sizeof(*digests),
- GFP_KERNEL);
- if (!digests)
- return -ENOMEM;
-
- for (i = 0; i < chip->nr_allocated_banks; i++)
- memcpy(digests[i].digest, digest, TPM_MAX_DIGEST_SIZE);
-
- return 0;
-}
-
static int __init init_trusted(void)
{
int ret;
- chip = tpm_default_chip();
- if (!chip)
- return -ENOENT;
- ret = init_digests();
- if (ret < 0)
- goto err_put;
ret = trusted_shash_alloc();
if (ret < 0)
- goto err_free;
+ return ret;
ret = register_key_type(&key_type_trusted);
if (ret < 0)
- goto err_release;
- return 0;
-err_release:
- trusted_shash_release();
-err_free:
- kfree(digests);
-err_put:
- put_device(&chip->dev);
+ trusted_shash_release();
return ret;
}
static void __exit cleanup_trusted(void)
{
- put_device(&chip->dev);
+ if (chip)
+ put_device(&chip->dev);
kfree(digests);
trusted_shash_release();
unregister_key_type(&key_type_trusted);
--
2.17.1
On Mon, Mar 25, 2019 at 12:38:33AM +0000, Sasha Levin wrote:
> Hi,
>
> [This is an automated email]
>
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: all
>
> The bot has tested the following trees: v5.0.3, v4.19.30, v4.14.107, v4.9.164, v4.4.176, v3.18.136.
>
> v5.0.3: Build OK!
> v4.19.30: Build OK!
> v4.14.107: Build OK!
> v4.9.164: Build OK!
> v4.4.176: Failed to apply! Possible dependencies:
> 238bcbc4e07f ("kbuild: consolidate Clang compiler flags")
> dbe27a002ef8 ("kbuild: add -no-integrated-as Clang option unconditionally")
>
> v3.18.136: Failed to apply! Possible dependencies:
> 238bcbc4e07f ("kbuild: consolidate Clang compiler flags")
> 35288e30ebca ("Kbuild: fix file name in comment about extra gcc checks")
> 5631d9c42985 ("kbuild: Fix clang detection")
> 665d92e38f65 ("kbuild: do not add $(call ...) to invoke cc-version or cc-fullversion")
> 785f11aa595b ("kbuild: Add better clang cross build support")
> 92d6cf2dab83 ("powerpc: Don't use -mno-strict-align on clang")
> a37c45cd82e6 ("kbuild: clang: add -no-integrated-as to KBUILD_[AC]FLAGS")
> ae6b289a3789 ("kbuild: Set KBUILD_CFLAGS before incl. arch Makefile")
> bb3f38c3c5b7 ("kbuild: clang: fix build failures with sparse check")
> bfb38988c51e ("kbuild: clang: Disable 'address-of-packed-member' warning")
> dd33c03b18b3 ("kbuild: fix cc-ifversion macro")
> e79c8385c878 ("powerpc: Don't do gcc version checks if we're building with clang")
> ee4eb20dbce9 ("Makefile: Fix detection of clang when cross-compiling")
> ef8c4ed9db80 ("kbuild: allow to use GCC toolchain not in Clang search path")
>
>
> How should we proceed with this patch?
>
> --
> Thanks,
> Sasha
Hi Sasha,
This patch will not be picked up, Nick's patch is a much better fix,
which should apply cleanly to all stable branches after it makes it into
mainline.
https://lore.kernel.org/lkml/20190313211335.165605-1-ndesaulniers@google.co…
Thanks for letting us know!
Nathan
On Mon, Mar 25, 2019 at 12:38:23AM +0000, Sasha Levin wrote:
> Hi,
>
> [This is an automated email]
>
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: 2e2ba09e48b7 IB/rdmavt, IB/hfi1: Create device
> dependent s_flags.
This patch hasn't even been accepted to any trees yet. Why are you
looking at it?
Jason
ACPI specifications stat that if the "Guaranteed Performance Register" is
not implemented, OSPM assumes guaranteed performance is always equal to
nominal performance. So for invalid and unimplemented guaranteed
performance register, use nominal performance as guaranteed performance.
This change will fallback to nominal_perf when guranteed_perf is invalid.
If nominal_perf is also invalid, then fallback to existing implementation,
which is to read from HWP Capabilities MSR.
Fixes: 86d333a8cc7f ("cpufreq: intel_pstate: Add base_frequency attribute")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada(a)linux.intel.com>
Cc: 4.20+ <stable(a)vger.kernel.org> # 4.20+
---
drivers/cpufreq/intel_pstate.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 7b4b0a7ac68b..e16dea241c55 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -385,6 +385,9 @@ static int intel_pstate_get_cppc_guranteed(int cpu)
if (ret)
return ret;
+ if (!cppc_perf.guaranteed_perf)
+ return cppc_perf.nominal_perf;
+
return cppc_perf.guaranteed_perf;
}
--
2.17.2
On Mon, Mar 25, 2019 at 12:38:21AM +0000, Sasha Levin wrote:
> Hi,
>
> [This is an automated email]
>
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: all
>
> The bot has tested the following trees: v5.0.3, v4.19.30, v4.14.107, v4.9.164, v4.4.176, v3.18.136.
>
> v5.0.3: Build OK!
> v4.19.30: Build OK!
> v4.14.107: Build OK!
> v4.9.164: Build OK!
> v4.4.176: Failed to apply! Possible dependencies:
<snip>
> v3.18.136: Failed to apply! Possible dependencies:
<snip>
> How should we proceed with this patch?
I've haven't looked into 4.4 and 3.18 amd_iommu code, but not counting
comment, patch is one-liner, so should be trivial to backport it manually.
Stanislaw