From: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
To: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH] ARM: move body of head-common.S back to text section
Date: Wed, 3 Jul 2013 11:30:12 -0400 [thread overview]
Message-ID: <20130703153012.GK22702@windriver.com> (raw)
In-Reply-To: <20130703100044.GG24642-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
[Re: [PATCH] ARM: move body of head-common.S back to text section] On 03/07/2013 (Wed 11:00) Russell King - ARM Linux wrote:
> On Wed, Jul 03, 2013 at 01:19:07AM -0400, Paul Gortmaker wrote:
> > As an aside, I'm now thinking any __INIT that implicitly rely on EOF for
> > closure are nasty traps waiting to happen and it might be worthwhile to
> > audit and explicitly __FINIT them before someone appends to the file...
>
> That hides a different kind of bug though - I hate __FINIT for exactly
> that reason. Consider this:
Agreed - perhaps masking that it is a ".previous" just hides the fact
that it is more like a pop operation vs. an on/off operation, or per
function as we have in C.
>
> .text
> blah blah blah
> __INIT
> lots of init stuff
> __FINIT
> more .text stuff
>
> Now, someone comes along and modifies this to be:
>
> .text
> blah blah blah
> .data
> something else
Yeah, that would be kind of careless; not putting .data above the .text,
or at least closing with a .previous, but sure it could sneak past
review.
> __INIT
> lots of init stuff
> __FINIT
The presence of the above 3 lines of init block (i.e. here or not)
doesn't really change the fact that the .data guy broke the below .text
code by grandfathering it into .data -- But you could argue that him
seeing the 1st __INIT and that influenced him to decide to not read any
further down into the file -- which probably does happen, though.... :(
> more .text stuff
>
> Now, what is the effect of that __FINIT now? You get the following .text
> emitted into the .data section instead. This is basically the same problem
> you've just encounted.
>
> Maybe:
>
> __FINIT
> .text
>
> is the safest solution - and __FINIT becomes just a no-op marker to avoid
> anyone relying on its properties.
That seems reasonable to me. I can't think of any self auditing that is
reasonably simple to implement. One downside of __FINIT as a no-op vs.
what it is today, is that a dangling __FINIT in a file with no other
previous sections will emit a warning. But that is a small low value
corner case I think.
WARNING: multiple messages have this Message-ID (diff)
From: paul.gortmaker@windriver.com (Paul Gortmaker)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: move body of head-common.S back to text section
Date: Wed, 3 Jul 2013 11:30:12 -0400 [thread overview]
Message-ID: <20130703153012.GK22702@windriver.com> (raw)
In-Reply-To: <20130703100044.GG24642@n2100.arm.linux.org.uk>
[Re: [PATCH] ARM: move body of head-common.S back to text section] On 03/07/2013 (Wed 11:00) Russell King - ARM Linux wrote:
> On Wed, Jul 03, 2013 at 01:19:07AM -0400, Paul Gortmaker wrote:
> > As an aside, I'm now thinking any __INIT that implicitly rely on EOF for
> > closure are nasty traps waiting to happen and it might be worthwhile to
> > audit and explicitly __FINIT them before someone appends to the file...
>
> That hides a different kind of bug though - I hate __FINIT for exactly
> that reason. Consider this:
Agreed - perhaps masking that it is a ".previous" just hides the fact
that it is more like a pop operation vs. an on/off operation, or per
function as we have in C.
>
> .text
> blah blah blah
> __INIT
> lots of init stuff
> __FINIT
> more .text stuff
>
> Now, someone comes along and modifies this to be:
>
> .text
> blah blah blah
> .data
> something else
Yeah, that would be kind of careless; not putting .data above the .text,
or at least closing with a .previous, but sure it could sneak past
review.
> __INIT
> lots of init stuff
> __FINIT
The presence of the above 3 lines of init block (i.e. here or not)
doesn't really change the fact that the .data guy broke the below .text
code by grandfathering it into .data -- But you could argue that him
seeing the 1st __INIT and that influenced him to decide to not read any
further down into the file -- which probably does happen, though.... :(
> more .text stuff
>
> Now, what is the effect of that __FINIT now? You get the following .text
> emitted into the .data section instead. This is basically the same problem
> you've just encounted.
>
> Maybe:
>
> __FINIT
> .text
>
> is the safest solution - and __FINIT becomes just a no-op marker to avoid
> anyone relying on its properties.
That seems reasonable to me. I can't think of any self auditing that is
reasonably simple to implement. One downside of __FINIT as a no-op vs.
what it is today, is that a dangling __FINIT in a file with no other
previous sections will emit a warning. But that is a small low value
corner case I think.
WARNING: multiple messages have this Message-ID (diff)
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
Stephen Boyd <sboyd@codeaurora.org>,
Will Deacon <will.deacon@arm.com>, <linux-kernel@vger.kernel.org>,
Joseph Lo <josephl@nvidia.com>, <linux-tegra@vger.kernel.org>,
Stephen Warren <swarren@nvidia.com>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: move body of head-common.S back to text section
Date: Wed, 3 Jul 2013 11:30:12 -0400 [thread overview]
Message-ID: <20130703153012.GK22702@windriver.com> (raw)
In-Reply-To: <20130703100044.GG24642@n2100.arm.linux.org.uk>
[Re: [PATCH] ARM: move body of head-common.S back to text section] On 03/07/2013 (Wed 11:00) Russell King - ARM Linux wrote:
> On Wed, Jul 03, 2013 at 01:19:07AM -0400, Paul Gortmaker wrote:
> > As an aside, I'm now thinking any __INIT that implicitly rely on EOF for
> > closure are nasty traps waiting to happen and it might be worthwhile to
> > audit and explicitly __FINIT them before someone appends to the file...
>
> That hides a different kind of bug though - I hate __FINIT for exactly
> that reason. Consider this:
Agreed - perhaps masking that it is a ".previous" just hides the fact
that it is more like a pop operation vs. an on/off operation, or per
function as we have in C.
>
> .text
> blah blah blah
> __INIT
> lots of init stuff
> __FINIT
> more .text stuff
>
> Now, someone comes along and modifies this to be:
>
> .text
> blah blah blah
> .data
> something else
Yeah, that would be kind of careless; not putting .data above the .text,
or at least closing with a .previous, but sure it could sneak past
review.
> __INIT
> lots of init stuff
> __FINIT
The presence of the above 3 lines of init block (i.e. here or not)
doesn't really change the fact that the .data guy broke the below .text
code by grandfathering it into .data -- But you could argue that him
seeing the 1st __INIT and that influenced him to decide to not read any
further down into the file -- which probably does happen, though.... :(
> more .text stuff
>
> Now, what is the effect of that __FINIT now? You get the following .text
> emitted into the .data section instead. This is basically the same problem
> you've just encounted.
>
> Maybe:
>
> __FINIT
> .text
>
> is the safest solution - and __FINIT becomes just a no-op marker to avoid
> anyone relying on its properties.
That seems reasonable to me. I can't think of any self auditing that is
reasonably simple to implement. One downside of __FINIT as a no-op vs.
what it is today, is that a dangling __FINIT in a file with no other
previous sections will emit a warning. But that is a small low value
corner case I think.
next prev parent reply other threads:[~2013-07-03 15:30 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-02 22:53 [PATCH] ARM: move body of head-common.S back to text section Stephen Warren
2013-07-02 22:53 ` Stephen Warren
[not found] ` <1372805629-18382-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-07-02 23:22 ` Stephen Boyd
2013-07-02 23:22 ` Stephen Boyd
2013-07-02 23:22 ` Stephen Boyd
[not found] ` <20130702232259.GH11625-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2013-07-03 2:44 ` Stephen Warren
2013-07-03 2:44 ` Stephen Warren
2013-07-03 2:44 ` Stephen Warren
[not found] ` <51D39004.9000907-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-07-03 5:19 ` Paul Gortmaker
2013-07-03 5:19 ` Paul Gortmaker
2013-07-03 5:19 ` Paul Gortmaker
2013-07-03 10:00 ` Russell King - ARM Linux
2013-07-03 10:00 ` Russell King - ARM Linux
[not found] ` <20130703100044.GG24642-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-03 15:30 ` Paul Gortmaker [this message]
2013-07-03 15:30 ` Paul Gortmaker
2013-07-03 15:30 ` Paul Gortmaker
[not found] ` <20130703153012.GK22702-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2013-07-03 17:20 ` Russell King - ARM Linux
2013-07-03 17:20 ` Russell King - ARM Linux
2013-07-03 17:20 ` Russell King - ARM Linux
2013-07-04 0:22 ` Paul Gortmaker
2013-07-04 0:22 ` Paul Gortmaker
2013-07-04 0:22 ` Paul Gortmaker
[not found] ` <20130704002235.GL22702-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2013-07-05 15:10 ` Dave P Martin
2013-07-05 15:10 ` Dave P Martin
2013-07-05 15:10 ` Dave P Martin
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=20130703153012.GK22702@windriver.com \
--to=paul.gortmaker-cwa4wttnnzf54taoqtywwq@public.gmane.org \
--cc=josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=will.deacon-5wv7dgnIgG8@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.