From: Nathan Chancellor <nathan@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Sami Tolvanen <samitolvanen@google.com>,
Kees Cook <keescook@chromium.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>,
x86@kernel.org, linux-kernel@vger.kernel.org,
clang-built-linux@googlegroups.com
Subject: Re: [PATCH 1/2] x86/events/amd/iommu: Fix sysfs type mismatch
Date: Thu, 15 Apr 2021 07:47:22 -0700 [thread overview]
Message-ID: <YHhR+l5Kmdy6OSSL@archlinux-ax161> (raw)
In-Reply-To: <20210415075335.GA1954964@infradead.org>
On Thu, Apr 15, 2021 at 08:53:35AM +0100, Christoph Hellwig wrote:
> On Wed, Apr 14, 2021 at 05:11:11PM -0700, Nathan Chancellor wrote:
> > 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.
>
> While the fix looks fine I think we need to solve this kind of problem
> by better type checking. The fact that we can use the wong type here
> without a compiler warning is the real issue.
I agree. Unfortunately, it seems that is going to be a much longer tail
project because of how pervasive this is (using container_of() +
attributes to get callbacks).
https://lore.kernel.org/r/202006112217.2E6CE093@keescook/
https://lore.kernel.org/r/202104021823.64FA6119@keescook/
Cheers,
Nathan
next prev parent reply other threads:[~2021-04-15 14:47 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 [this message]
2021-04-16 15:01 ` [tip: perf/core] " tip-bot2 for Nathan Chancellor
2021-04-16 17:13 ` 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=YHhR+l5Kmdy6OSSL@archlinux-ax161 \
--to=nathan@kernel.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=clang-built-linux@googlegroups.com \
--cc=hch@infradead.org \
--cc=jolsa@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=samitolvanen@google.com \
--cc=tglx@linutronix.de \
--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