From: David Laight <David.Laight@ACULAB.COM>
To: 'Peter Zijlstra' <peterz@infradead.org>,
Christoph Hellwig <hch@infradead.org>
Cc: "x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"alyssa.milburn@intel.com" <alyssa.milburn@intel.com>,
"scott.d.constable@intel.com" <scott.d.constable@intel.com>,
"joao@overdrivepizza.com" <joao@overdrivepizza.com>,
"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
"jpoimboe@kernel.org" <jpoimboe@kernel.org>,
"alexei.starovoitov@gmail.com" <alexei.starovoitov@gmail.com>,
"ebiggers@kernel.org" <ebiggers@kernel.org>,
"samitolvanen@google.com" <samitolvanen@google.com>,
"kees@kernel.org" <kees@kernel.org>
Subject: RE: [PATCH 1/8] x86,kcfi: Fix EXPORT_SYMBOL vs kCFI
Date: Sat, 9 Nov 2024 09:14:32 +0000 [thread overview]
Message-ID: <c8d6b89093bc4d82bda15aa9d9fe6f88@AcuMS.aculab.com> (raw)
In-Reply-To: <20241105145842.GH10375@noisy.programming.kicks-ass.net>
From: Peter Zijlstra
> Sent: 05 November 2024 14:59
>
> On Tue, Nov 05, 2024 at 06:32:12AM -0800, Christoph Hellwig wrote:
> > On Tue, Nov 05, 2024 at 03:27:20PM +0100, Peter Zijlstra wrote:
> > > > I don't think that is the case at all. The is a relatively small number
> > > > of exported symbols that are called indirectly. I'd much rather mark
> > > > those explicitly.
> > >
> > > I'm not claiming they have their address taken -- just saying that
> > > traditionally this has always been a valid thing to do.
> > >
> > > Anyway, I raised this point last time, and I think back then the
> > > consensus was to explicitly mark those you should not be able to call.
> >
> > Who came to that consensus? There really is just a relatively well
>
> The people who found that thread.
>
> > bounded number of functions that are used as either default methods
> > or as ready made callbacks. Everything else has no business being
> > called indirectly. While disallowing this might be a bit of work,
> > I think it would be a great security improvement.
>
> Well, we don't disagree. But since most of the EXPORT'ed functions are
> done in C, we need something that works there too.
>
> I think the idea was that we add EXPORT_SYMBOL{,_GPL}_SEALED() and go
> convert everything over to that.
Don't you really need a compiler attribute that makes a function
indirectly callable?
(Instead of the compiler trying to sort it out itself?)
With the default being 'not indirectly callable' unless the function
address is taken in the same compilation unit as its definition.
If added to the declaration (in the .h file) the compiler would be
able to error code that takes the address of such functions.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2024-11-09 9:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 11:39 [PATCH 0/8] x86: kCFI and IBT cleanups Peter Zijlstra
2024-11-05 11:39 ` [PATCH 1/8] x86,kcfi: Fix EXPORT_SYMBOL vs kCFI Peter Zijlstra
2024-11-05 14:16 ` Christoph Hellwig
2024-11-05 14:27 ` Peter Zijlstra
2024-11-05 14:32 ` Christoph Hellwig
2024-11-05 14:58 ` Peter Zijlstra
2024-11-05 15:41 ` Christoph Hellwig
2024-11-05 15:47 ` Peter Zijlstra
2024-11-05 16:11 ` Peter Zijlstra
2024-11-09 9:14 ` David Laight [this message]
2024-11-05 11:39 ` [PATCH 2/8] x86/cfi: Clean up linkage Peter Zijlstra
2024-11-05 11:39 ` [PATCH 3/8] x86/boot: Mark start_secondary() with __noendbr Peter Zijlstra
2024-11-05 11:39 ` [PATCH 4/8] x86/alternative: Simplify callthunk patching Peter Zijlstra
2024-11-05 11:39 ` [PATCH 5/8] x86/traps: Cleanup and robustify decode_bug() Peter Zijlstra
2024-11-05 15:19 ` Andrew Cooper
2024-11-05 11:39 ` [PATCH 6/8] x86/ibt: Clean up is_endbr() Peter Zijlstra
2024-11-05 11:39 ` [PATCH 7/8] x86/ibt: Clean up poison_endbr() Peter Zijlstra
2024-11-05 11:39 ` [PATCH 8/8] x86/early_printk: Harden early_serial Peter Zijlstra
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=c8d6b89093bc4d82bda15aa9d9fe6f88@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=alexei.starovoitov@gmail.com \
--cc=alyssa.milburn@intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=ebiggers@kernel.org \
--cc=hch@infradead.org \
--cc=joao@overdrivepizza.com \
--cc=jpoimboe@kernel.org \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=samitolvanen@google.com \
--cc=scott.d.constable@intel.com \
--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
Powered by JetHome