diff options
author | Borislav Petkov <bp@suse.de> | 2020-12-22 18:55:06 +0100 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-12-28 19:36:37 +0100 |
commit | 1865bc71a869ede69098b1f3e65857b4330f0607 (patch) | |
tree | fbcd5f256402d9ee6490577e48490a446473c2ed /drivers/edac/amd64_edac.c | |
parent | 61810096de3c3ec977c71dbb7e00447d70045163 (diff) | |
download | linux-1865bc71a869ede69098b1f3e65857b4330f0607.tar.gz |
EDAC/amd64: Limit error injection functionality to supported hw
Families up to and including 0x16 allow access to the injection
hardware. Starting with family 0x17, access to those registers is
blocked by security policy.
Limit that only on the families which support it.
Suggested-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20201222180013.GD13463@zn.tnic
Diffstat (limited to 'drivers/edac/amd64_edac.c')
-rw-r--r-- | drivers/edac/amd64_edac.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index d55f8ef2240c..9868f95a5622 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -828,9 +828,11 @@ static umode_t inj_is_visible(struct kobject *kobj, struct attribute *attr, int struct mem_ctl_info *mci = container_of(dev, struct mem_ctl_info, dev); struct amd64_pvt *pvt = mci->pvt_info; - if (pvt->fam < 0x10) - return 0; - return attr->mode; + /* Families which have that injection hw */ + if (pvt->fam >= 0x10 && pvt->fam <= 0x16) + return attr->mode; + + return 0; } static const struct attribute_group inj_group = { |