From: "tip-bot2 for Nathan Chancellor" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Nathan Chancellor <nathan@kernel.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: perf/core] x86/events/amd/iommu: Fix sysfs type mismatch
Date: Fri, 16 Apr 2021 15:01:47 -0000 [thread overview]
Message-ID: <161858530728.29796.17592838141405180153.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20210415001112.3024673-1-nathan@kernel.org>
The following commit has been merged into the perf/core branch of tip:
Commit-ID: bccae9d7b013bd708ece414f74defaee56790e1d
Gitweb: https://git.kernel.org/tip/bccae9d7b013bd708ece414f74defaee56790e1d
Author: Nathan Chancellor <nathan@kernel.org>
AuthorDate: Wed, 14 Apr 2021 17:11:11 -07:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 16 Apr 2021 16:32:44 +02:00
x86/events/amd/iommu: Fix sysfs type mismatch
dev_attr_show() calls _iommu_event_show() via an indirect call but
_iommu_event_show()'s type does not currently match the type of the
show() member in 'struct device_attribute', resulting in a Control Flow
Integrity violation.
$ cat /sys/devices/amd_iommu_1/events/mem_dte_hit
csource=0x0a
$ dmesg | grep "CFI failure"
[ 3526.735140] CFI failure (target: _iommu_event_show...):
Change _iommu_event_show() and 'struct amd_iommu_event_desc' to
'struct device_attribute' so that there is no more CFI violation.
Fixes: 7be6296fdd75 ("perf/x86/amd: AMD IOMMU Performance Counter PERF uncore PMU implementation")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210415001112.3024673-1-nathan@kernel.org
---
arch/x86/events/amd/iommu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c
index be50ef8..6a98a76 100644
--- a/arch/x86/events/amd/iommu.c
+++ b/arch/x86/events/amd/iommu.c
@@ -81,12 +81,12 @@ static struct attribute_group amd_iommu_events_group = {
};
struct amd_iommu_event_desc {
- struct kobj_attribute attr;
+ struct device_attribute attr;
const char *event;
};
-static ssize_t _iommu_event_show(struct kobject *kobj,
- struct kobj_attribute *attr, char *buf)
+static ssize_t _iommu_event_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct amd_iommu_event_desc *event =
container_of(attr, struct amd_iommu_event_desc, attr);
next prev parent reply other threads:[~2021-04-16 15:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-15 0:11 [PATCH 1/2] x86/events/amd/iommu: Fix sysfs type mismatch Nathan Chancellor
2021-04-15 0:11 ` [PATCH 2/2] perf/amd/uncore: " Nathan Chancellor
2021-04-16 15:01 ` [tip: perf/core] " tip-bot2 for Nathan Chancellor
2021-04-16 17:13 ` tip-bot2 for Nathan Chancellor
2021-04-15 7:53 ` [PATCH 1/2] x86/events/amd/iommu: " Christoph Hellwig
2021-04-15 14:47 ` Nathan Chancellor
2021-04-16 15:01 ` tip-bot2 for Nathan Chancellor [this message]
2021-04-16 17:13 ` [tip: perf/core] " tip-bot2 for Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=161858530728.29796.17592838141405180153.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).