* [PATCH for-4.15] wireless: create, don't append, to shipped-certs.c
@ 2017-12-19 19:23 Brian Norris
2017-12-19 20:11 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Brian Norris @ 2017-12-19 19:23 UTC (permalink / raw)
To: Johannes Berg
Cc: linux-kernel, linux-wireless, Paul Menzel, Damian Tometzki,
Brian Norris
The current rule for generating the {shipped,extra}-certs.c source files
might create an invalid C source file, containing redefinitions of the
same variables:
CC [M] net/wireless/shipped-certs.o
net/wireless/shipped-certs.c:686:10: error: redefinition of 'shipped_regdb_certs'
const u8 shipped_regdb_certs[] = {
^
net/wireless/shipped-certs.c:2:10: note: previous definition of 'shipped_regdb_certs' was here
const u8 shipped_regdb_certs[] = {
^
net/wireless/shipped-certs.c:1368:14: error: redefinition of 'shipped_regdb_certs_len'
unsigned int shipped_regdb_certs_len = sizeof(shipped_regdb_certs);
^
net/wireless/shipped-certs.c:684:14: note: previous definition of 'shipped_regdb_certs_len' was here
unsigned int shipped_regdb_certs_len = sizeof(shipped_regdb_certs);
^
This can be easily triggered by forcing a rebuild of these files:
$ touch net/wireless/certs/sforshee.x509
$ make
In practice, this is seen often by having a separate source and build
directory, where the build artifacts remain but the source tree changes
(even if Seth's cert doesn't change, it might get created/removed when
checking out different source revisions).
I don't see why this rule should be an append; we're writing the file
all in one go.
Fixes: 90a53e4432b1 ("cfg80211: implement regdb signature checking")
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
This is an error introduced in 4.15-rc1.
I've seen other errors reported by Paul and Damian (CC'd); I think Paul's
failure was fixed already, but Damian might have still been having problems
with not having a "clean" environment. Perhaps he was hitting this bug?
net/wireless/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/wireless/Makefile b/net/wireless/Makefile
index d7d6cb00c47b..b662be3422e1 100644
--- a/net/wireless/Makefile
+++ b/net/wireless/Makefile
@@ -43,7 +43,7 @@ $(obj)/shipped-certs.c: $(wildcard $(srctree)/$(src)/certs/*.x509)
echo "$$allf"; \
echo '};'; \
echo 'unsigned int shipped_regdb_certs_len = sizeof(shipped_regdb_certs);'; \
- ) >> $@)
+ ) > $@)
$(obj)/extra-certs.c: $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR:"%"=%) \
$(wildcard $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR:"%"=%)/*.x509)
@@ -66,4 +66,4 @@ $(obj)/extra-certs.c: $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR:"%"=%) \
echo "$$allf"; \
echo '};'; \
echo 'unsigned int extra_regdb_certs_len = sizeof(extra_regdb_certs);'; \
- ) >> $@)
+ ) > $@)
--
2.15.1.504.g5279b80103-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH for-4.15] wireless: create, don't append, to shipped-certs.c
2017-12-19 19:23 [PATCH for-4.15] wireless: create, don't append, to shipped-certs.c Brian Norris
@ 2017-12-19 20:11 ` Johannes Berg
2017-12-19 20:38 ` Brian Norris
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2017-12-19 20:11 UTC (permalink / raw)
To: Brian Norris; +Cc: linux-kernel, linux-wireless, Paul Menzel, Damian Tometzki
On Tue, 2017-12-19 at 11:23 -0800, Brian Norris wrote:
>
> In practice, this is seen often by having a separate source and build
> directory, where the build artifacts remain but the source tree changes
> (even if Seth's cert doesn't change, it might get created/removed when
> checking out different source revisions).
>
> I don't see why this rule should be an append; we're writing the file
> all in one go.
Yeah, that was an oversight from the code prior to my changes to make
it write it only once.
> Fixes: 90a53e4432b1 ("cfg80211: implement regdb signature checking")
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
> This is an error introduced in 4.15-rc1.
>
> I've seen other errors reported by Paul and Damian (CC'd); I think Paul's
> failure was fixed already, but Damian might have still been having problems
> with not having a "clean" environment. Perhaps he was hitting this bug?
I'm not really sure what that problem was - I think a combination of
missing clean-files and this perhaps? Anyway, I applied another fix for
this today, and it's on the way to Linus's tree, along with the missing
clean-files and a conversion to non-binary files so that patches work
better.
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH for-4.15] wireless: create, don't append, to shipped-certs.c
2017-12-19 20:11 ` Johannes Berg
@ 2017-12-19 20:38 ` Brian Norris
0 siblings, 0 replies; 3+ messages in thread
From: Brian Norris @ 2017-12-19 20:38 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-kernel, linux-wireless, Paul Menzel, Damian Tometzki
On Tue, Dec 19, 2017 at 09:11:30PM +0100, Johannes Berg wrote:
> I'm not really sure what that problem was - I think a combination of
> missing clean-files and this perhaps? Anyway, I applied another fix for
> this today, and it's on the way to Linus's tree, along with the missing
> clean-files and a conversion to non-binary files so that patches work
> better.
Ah, I didn't see that. I guess you just applied it a few hours ago, and
it didn't trickle into -next yet.
Thanks,
Brian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-19 20:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-19 19:23 [PATCH for-4.15] wireless: create, don't append, to shipped-certs.c Brian Norris
2017-12-19 20:11 ` Johannes Berg
2017-12-19 20:38 ` Brian Norris
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).