From: Laura Abbott <hidden> Date: 2018-07-03 23:34:41
Hi,
This is v5 of the series to allow unique build ids in the kernel. As a
reminder of the context:
""
In Fedora, the debug information is packaged separately (foo-debuginfo) and
can be installed separately. There's been a long standing issue where only one
version of a debuginfo info package can be installed at a time. Mark Wielaard
made an effort for Fedora 27 to allow parallel installation of debuginfo (see
https://fedoraproject.org/wiki/Changes/ParallelInstallableDebuginfo for
more details)
Part of the requirement to allow this to work is that build ids are
unique between builds. The existing upstream rpm implementation ensures
this by re-calculating the build-id using the version and release as a
seed. This doesn't work 100% for the kernel because of the vDSO which is
its own binary and doesn't get updated. After poking holes in a few of my
ideas, there was a discussion with some people from the binutils team about
adding --build-id-salt to let ld do the calculation debugedit is doing. There
was a counter proposal made to add in the salt while building. The
easiest proposal was to add an item in the linker script vs. linking in
an object since we need the salt to go in every module as well as the
kernel and vmlinux.
""
v5 uses the approach suggested by Masahiro Yamada which uses the
existing ELF note macro to more easily add the salt (vs previous
approaches which tried to adjust via linker section).
If arch maintainers are okay, I'd like acks for this so this can go
through the kbuild tree.
Thanks,
Laura
Laura Abbott (4):
kbuild: Add build salt to the kernel and modules
x86: Add build salt to the vDSO
powerpc: Add build salt to the vDSO
arm64: Add build salt to the vDSO
arch/arm64/kernel/vdso/note.S | 3 +++
arch/powerpc/kernel/vdso32/note.S | 3 +++
arch/x86/entry/vdso/vdso-note.S | 3 +++
arch/x86/entry/vdso/vdso32/note.S | 3 +++
include/linux/build-salt.h | 20 ++++++++++++++++++++
init/Kconfig | 9 +++++++++
init/version.c | 3 +++
scripts/mod/modpost.c | 3 +++
8 files changed, 47 insertions(+)
create mode 100644 include/linux/build-salt.h
--
2.17.1
From: Laura Abbott <hidden> Date: 2018-07-03 23:34:45
The build id generated from --build-id can be generated in several different
ways, with the default being the sha1 on the output of the linked file. For
distributions, it can be useful to make sure this ID is unique, even if the
actual file contents don't change. The easiest way to do this is to insert
a section with some data.
Add an ELF note to both the kernel and module which contains some data based
off of a config option.
Signed-off-by: Masahiro Yamada <redacted>
Signed-off-by: Laura Abbott <redacted>
---
v5: I used S-o-b here since the majority of the code was written
already. Please feel free to change the tag if you think it's not
appropriate. I also tweaked this to take an ascii string instead of just
a hex value since this makes things much easier on the distribution
side.
---
include/linux/build-salt.h | 20 ++++++++++++++++++++
init/Kconfig | 9 +++++++++
init/version.c | 3 +++
scripts/mod/modpost.c | 3 +++
4 files changed, 35 insertions(+)
create mode 100644 include/linux/build-salt.h
From: Laura Abbott <hidden> Date: 2018-07-03 23:34:47
The vDSO needs to have a unique build id in a similar manner
to the kernel and modules. Use the build salt macro.
Signed-off-by: Laura Abbott <redacted>
---
v5: Switched to using the single line BUILD_SALT macro
---
arch/x86/entry/vdso/vdso-note.S | 3 +++
arch/x86/entry/vdso/vdso32/note.S | 3 +++
2 files changed, 6 insertions(+)
From: Laura Abbott <hidden> Date: 2018-07-03 23:34:52
The vDSO needs to have a unique build id in a similar manner
to the kernel and modules. Use the build salt macro.
Signed-off-by: Laura Abbott <redacted>
---
v5: New approach with the BUILD_SALT macro
---
arch/powerpc/kernel/vdso32/note.S | 3 +++
1 file changed, 3 insertions(+)
From: Laura Abbott <hidden> Date: 2018-07-03 23:35:02
The vDSO needs to have a unique build id in a similar manner
to the kernel and modules. Use the build salt macro.
Signed-off-by: Laura Abbott <redacted>
---
v5: I was previously focused on x86 only but since powerpc gave a patch,
I figured I would do arm64 since the changes were also fairly simple.
---
arch/arm64/kernel/vdso/note.S | 3 +++
1 file changed, 3 insertions(+)
Hi.
2018-07-04 8:34 GMT+09:00 Laura Abbott [off-list ref]:
quoted hunk
The vDSO needs to have a unique build id in a similar manner
to the kernel and modules. Use the build salt macro.
Signed-off-by: Laura Abbott <redacted>
---
v5: I was previously focused on x86 only but since powerpc gave a patch,
I figured I would do arm64 since the changes were also fairly simple.
---
arch/arm64/kernel/vdso/note.S | 3 +++
1 file changed, 3 insertions(+)
I think this works, but
I prefer no-semicolon in assembly files.
For coding consistency,
I want ';' as statement delimiter in .c files.
But, only new line after each statement in .S files.
For example, in arch/x86/xen/xen-head.S
I see no semicolon after ELFNOTE().
I found this:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473k/dom1359731141352.html
It says ';' starts a comment line
although it is not the case of GAS.
Same for 3/4.
--
Best Regards
Masahiro Yamada
Hi.
Thanks for the update.
2018-07-04 8:34 GMT+09:00 Laura Abbott [off-list ref]:
The build id generated from --build-id can be generated in several different
ways, with the default being the sha1 on the output of the linked file. For
distributions, it can be useful to make sure this ID is unique, even if the
actual file contents don't change. The easiest way to do this is to insert
a section with some data.
Add an ELF note to both the kernel and module which contains some data based
off of a config option.
Signed-off-by: Masahiro Yamada <redacted>
Signed-off-by: Laura Abbott <redacted>
---
v5: I used S-o-b here since the majority of the code was written
already.
I think Suggested-by is good enough.
S-o-b is appended as a patch is passed from people to people.
Anyway, this looks good except one bike-shed.
Please feel free to change the tag if you think it's not
appropriate. I also tweaked this to take an ascii string instead of just
a hex value since this makes things much easier on the distribution
side.
---
From: Will Deacon <hidden> Date: 2018-07-04 17:35:41
On Tue, Jul 03, 2018 at 04:34:30PM -0700, Laura Abbott wrote:
The vDSO needs to have a unique build id in a similar manner
to the kernel and modules. Use the build salt macro.
Signed-off-by: Laura Abbott <redacted>
---
v5: I was previously focused on x86 only but since powerpc gave a patch,
I figured I would do arm64 since the changes were also fairly simple.
---
arch/arm64/kernel/vdso/note.S | 3 +++
1 file changed, 3 insertions(+)
If you drop the trailing semicolon, then:
Acked-by: Will Deacon <redacted>
Will
From: Andy Lutomirski <luto@kernel.org> Date: 2018-07-05 15:58:37
On Tue, Jul 3, 2018 at 4:34 PM, Laura Abbott [off-list ref] wrote:
The vDSO needs to have a unique build id in a similar manner
to the kernel and modules. Use the build salt macro.
Looks good to me. I have no idea whose tree these would go through.
quoted hunk
Signed-off-by: Laura Abbott <redacted>
---
v5: Switched to using the single line BUILD_SALT macro
---
arch/x86/entry/vdso/vdso-note.S | 3 +++
arch/x86/entry/vdso/vdso32/note.S | 3 +++
2 files changed, 6 insertions(+)
From: Laura Abbott <hidden> Date: 2018-07-05 19:05:50
On 07/03/2018 08:55 PM, Masahiro Yamada wrote:
Hi.
2018-07-04 8:34 GMT+09:00 Laura Abbott [off-list ref]:
quoted
The vDSO needs to have a unique build id in a similar manner
to the kernel and modules. Use the build salt macro.
Signed-off-by: Laura Abbott <redacted>
---
v5: I was previously focused on x86 only but since powerpc gave a patch,
I figured I would do arm64 since the changes were also fairly simple.
---
arch/arm64/kernel/vdso/note.S | 3 +++
1 file changed, 3 insertions(+)
I think this works, but
I prefer no-semicolon in assembly files.
For coding consistency,
I want ';' as statement delimiter in .c files.
But, only new line after each statement in .S files.
For example, in arch/x86/xen/xen-head.S
I see no semicolon after ELFNOTE().
I found this:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473k/dom1359731141352.html
It says ';' starts a comment line
although it is not the case of GAS.
Same for 3/4.
From: Laura Abbott <hidden> Date: 2018-07-05 19:08:38
On 07/05/2018 08:58 AM, Andy Lutomirski wrote:
On Tue, Jul 3, 2018 at 4:34 PM, Laura Abbott [off-list ref] wrote:
quoted
The vDSO needs to have a unique build id in a similar manner
to the kernel and modules. Use the build salt macro.
Looks good to me. I have no idea whose tree these would go through.
I was intending this to go through kbuild tree. Can I take this
as an Ack?
quoted
Signed-off-by: Laura Abbott <redacted>
---
v5: Switched to using the single line BUILD_SALT macro
---
arch/x86/entry/vdso/vdso-note.S | 3 +++
arch/x86/entry/vdso/vdso32/note.S | 3 +++
2 files changed, 6 insertions(+)
From: Laura Abbott <hidden> Date: 2018-07-05 19:20:37
On 07/03/2018 08:59 PM, Masahiro Yamada wrote:
Hi.
Thanks for the update.
2018-07-04 8:34 GMT+09:00 Laura Abbott [off-list ref]:
quoted
The build id generated from --build-id can be generated in several different
ways, with the default being the sha1 on the output of the linked file. For
distributions, it can be useful to make sure this ID is unique, even if the
actual file contents don't change. The easiest way to do this is to insert
a section with some data.
Add an ELF note to both the kernel and module which contains some data based
off of a config option.
Signed-off-by: Masahiro Yamada <redacted>
Signed-off-by: Laura Abbott <redacted>
---
v5: I used S-o-b here since the majority of the code was written
already.
I think Suggested-by is good enough.
S-o-b is appended as a patch is passed from people to people.
Anyway, this looks good except one bike-shed.
quoted
Please feel free to change the tag if you think it's not
appropriate. I also tweaked this to take an ascii string instead of just
a hex value since this makes things much easier on the distribution
side.
---
From: Andy Lutomirski <luto@kernel.org> Date: 2018-07-05 21:47:31
Sure.
On Thu, Jul 5, 2018 at 12:08 PM, Laura Abbott [off-list ref] wrote:
On 07/05/2018 08:58 AM, Andy Lutomirski wrote:
quoted
On Tue, Jul 3, 2018 at 4:34 PM, Laura Abbott [off-list ref] wrote:
quoted
The vDSO needs to have a unique build id in a similar manner
to the kernel and modules. Use the build salt macro.
Looks good to me. I have no idea whose tree these would go through.
I was intending this to go through kbuild tree. Can I take this
as an Ack?
quoted
quoted
Signed-off-by: Laura Abbott <redacted>
---
v5: Switched to using the single line BUILD_SALT macro
---
arch/x86/entry/vdso/vdso-note.S | 3 +++
arch/x86/entry/vdso/vdso32/note.S | 3 +++
2 files changed, 6 insertions(+)
diff --git a/arch/x86/entry/vdso/vdso-note.S
b/arch/x86/entry/vdso/vdso-note.S
index 79a071e4357e..79423170118f 100644