Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] [PATCH] linux-mod.eclass: support module signing
Date: Mon, 27 Jun 2022 19:50:05
Message-Id: CAJ0EP42q3TV5AeN42A5FdS7nG9c8wfx2rUwprX1pFxF659mR1A@mail.gmail.com
In Reply to: Re: [gentoo-dev] [PATCH] linux-mod.eclass: support module signing by Georgy Yakovlev
1 On Mon, Jun 27, 2022 at 3:42 PM Georgy Yakovlev <gyakovlev@g.o> wrote:
2 >
3 > On Mon, 2022-06-27 at 14:56 -0400, Mike Gilbert wrote:
4 > > On Mon, Jun 27, 2022 at 2:35 PM Kenton Groombridge
5 > > <concord@g.o> wrote:
6 > > > > so looks like we need to combine both methods and do the
7 > > > > following:
8 > > > > - if signing requested without compression - sign in
9 > > > > pkg_preinst.
10 > > > > - if signing requested with compression - sign in src_install
11 > > > >
12 > > >
13 > > > Why can't we do both in pkg_preinst? I am thinking it would be best
14 > > > if
15 > > > we drop the current compression implementation and rework your old
16 > > > code
17 > > > to handle both compression and signing since the signing code is
18 > > > more or
19 > > > less already complete.
20 > >
21 > > Signing modules in pkg_preinst seems like a bad idea to me. That
22 > > means
23 > > you need to copy your private keys around to every host where the
24 > > package might be installed.
25 > >
26 > > If you sign in src_compile or src_install, you only need private keys
27 > > on the system building your binpkg.
28 > >
29 >
30 > unfortunately portage will unconditionally strip .ko objects, rendering
31 > modules unloadable by stripping signature, unless we do dostrip -x
32 > (requires EAPI7+, which should not be a problem nowadays, but was a
33 > problem back in 2018), which can be quite unfortunate on debug enabled
34 > kernels.
35
36 Sounds like something to fix/change in Portage. It could probably be
37 updated to not strip the signature. However, I would guess the
38 signature needs to be updated after the binary is modified in any
39 case.
40
41 Or as a workaround you could disable automatic striping via dostrip -x
42 and run the proper commands to strip the modules in src_install as
43 well.

Replies

Subject Author
Re: [gentoo-dev] [PATCH] linux-mod.eclass: support module signing Georgy Yakovlev <gyakovlev@g.o>