/srv/irclogs.ubuntu.com/2015/03/13/#ubuntu-kernel.txt

=== absk007 is now known as Guest34745
=== absk007_ is now known as absk007
unixistI'm trying to add an additional x509 key to the system keyring, but in order to do so, the new key must be signed with the old key. How do I do this? You can read https://www.kernel.org/doc/Documentation/module-signing.txt and / for "keyctl padd" to see what I'm trying to do01:08
unixist_I d/c'd. Did anybody answer my question about signing and inserting additional public keys into the kernel's system keyring03:11
=== unixist_ is now known as unixist
=== gerald is now known as Guest62279
free1hello #ubuntu-kernel03:42
free1infinity: can you fire a sniper rifle?03:45
smbtseliot, So I filed bug 1431753 as a result of my tests with dkms (in case you have not seen, yet). Turns out the slightly over-eager dkms builds do help to let the nvidia driver get away with bad behaviour. 09:34
ubot5bug 1431753 in nvidia-graphics-drivers-340-updates (Ubuntu) "Nvidia binary driver FTBS due to DKMS layer violation" [High,Confirmed] https://launchpad.net/bugs/143175309:34
tseliotsmb: I've just had a look at it. bbswitch-dkms is not part of the nvidia sources09:37
smbtseliot, Ah ok, minor lapse on my side. It is just always there when I have nvidia driver installed.09:39
smbProbably should have guessed since the version number differs09:39
tseliotsmb: as for UVM, what you suggest might cause some trouble packaging-wise as UVM is only available on amd64 (no armhf or i386), at least in the 346 series09:39
tseliotyes, the nvidia packages recommend bbswitch for hybrid graphics09:40
infinitytseliot: Why would it only being available on amd64 matter?09:40
infinitytseliot: If you package nvidia as a single driver instead of two, the Makefile can surely be smart enough to DTRT for the kernel it's building for.09:41
infinitySingle dkms package, that is.09:41
tseliotinfinity: it would add even more complexity to the packages. I don't know if you remember what the packaging is like... ;)09:41
smbinfinity, I think because you can not declare it only for one arch in the dkms.conf09:41
infinitytseliot: It would reduce complexity...09:41
smbStill one might just do a dummy thing 09:41
tseliotI can definitely look into it but we can probably lower the bug priority09:42
smbtseliot, But touching other modules private parts as you do now is as bad :)09:42
tseliotsmb: I'll get back to you on this. I really need to have a look at the code first though, as I really don't remember how it works09:44
smbtseliot, Ok, right now we are lucky to have working installs most of the time as the multiple dkms autoinstall runs get things done eventually (most of the time). You just can expect appart to go on bitching at you09:46
smbapport even09:46
infinityHrm, all this needs is for DKMS to export $kernel_arch, and we're set.09:47
tseliotsmb: ok, I definitely don't need apport to complain any more than it already does ;)09:47
infinitySince dkms.conf is a shell script.09:47
infinityAnd it might exist as $arch, despite the manpage not documenting it.09:49
smbinfinity, What might not be there is something to tell it a module only will be there for $ARCH==x. Right now I think there is only an array of module name and some where to put those09:50
infinitySo, it might be as simple as doing this:09:51
infinityif [ "$arch" = "x86_64" ]09:51
infinityBUILT_MODULE_NAME[1]=09:51
infinityDEST_MODULE_NAME[1]=09:51
infinity...09:51
infinityfi09:51
infinitysmb: Yeah, if $arch is there, the other bit is easy.09:51
smbinfinity, Ah I see what you mean09:51
infinityYou only add to the array if the arch matches, done.09:51
tseliotI can try that09:51
infinityMake that proper shell syntax (; then), etc.09:52
infinityNot sure if $arch is the right thing, mind you.  This source is messy. :P09:53
tseliotmaybe I won't even need that09:54
tseliotbut yes, I can see what's wrong in the sources now09:54
tseliotI'm not sure I wrote that code though09:55
tseliotsmb: that seems to be an upstream (i.e. NVIDIA) choice. I should probably talk to them before making any changes11:30
smbtseliot, hm ok. Likely behaves as bad for everyone but just we happen to trigger apport if dkms fails. :/11:35
tseliotsmb: right11:35
infinitytseliot: Upstreams aren't always right, and this is clearly wrong.11:38
infinitytseliot: If the dkms packaging comes from them, by all means, tell them they're wrong, but don't do something just because they say so either.11:38
tseliotinfinity: I know. Since we use (more or less) the same packaging scripts, I think it makes sense for me to ask them first. I'm not asking permission. It's about collaboration.11:41
rbasakppisati: we're looking for an equivalent of rdtsc on armhf for porting issues13:03
rbasakppisati: found http://blog.regehr.org/archives/794, but that needs enablement of access to the CPU's cycle counter from kernel space13:03
rbasakppisati: do you know why we don't do this by default anyway, given that INtel permits it? Is there any particular reason, or could we get upstream to enable this by default universally?13:03
rbasakjamespage, ogra_, smb: incidentally the cross-distro list might be a good place to ask, if nobody knows here.13:04
ogra_yeah "13:04
rbasakMany ARM people there, and the patch would only be useful to ceph upstreams if all the distros do the same thing here.13:04
rbasakIIRC there's also a Launchpad project to track arm porting issues.13:05
smbYeah, there might be a reason but I don't know ...13:07
ppisatirbasak: why don't you use the perf infrastructrue for that?13:23
ppisatirbasak: i mean13:23
rbasakppisati: doesn't that involve a system call?13:24
rbasakIn that case we could just use clock_gettime(2)13:24
rbasakjamespage did find http://neocontra.blogspot.co.uk/2013/05/user-mode-performance-counters-for.html which talks about how to use perf13:24
rbasakBut if that was suitable the original code would be using that instead of rdtsc13:25
rbasakI presume the system call overhead is too high13:25
ppisatiah13:26
ppisatibut did you read the comment about that piece of code?13:26
ppisati"Setting the V bit also allows userspace to access the System Validation Operations Register. Among other amusing effects this allows any userspace process to schedule a hard reset of the CPU in N cycles time."13:26
rbasakOh13:26
rbasakSo that'll be the reason then.13:26
rbasakThanks!13:27
rbasakjamespage: ^^ so that'll be the reason it's not enabled by deafult then :)13:27
ppisatirbasak: dude, but i would be interested to hear some more comments on this13:27
ppisatirbasak: so, if you wanna send a msg to the cross distro ml or linux-arm, i'm all for it13:27
ppisatirbasak: i think anything an rdtsc that doesn't involve a syscall might be useful for many people13:28
ppisatijust my 2 cents13:28
rbasakppisati: yeah, but not at the cost of allowing userspaces process to hard reset13:28
ppisatirbasak: of course, but there might be another way13:28
ppisatirbasak: anyhow yes, that thing doesn't sound good :)13:29
pkernHey. Would it be possible to push https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1314653 for trusty as well, for compatibility with the utopic lts backport? Having the governor set to performance makes for a bad experience on laptops with the new kernel.14:27
ubot5Ubuntu bug 1314653 in sysvinit (Ubuntu Trusty) "sysvinit: default cpufreq governor to powersave for intel-pstate driver" [High,Confirmed]14:27
ogra_pkern, the governor is always forced to ondemand 14:44
smbProblem seems to be that ondemand is not available with intel_pstate14:44
ogra_unless pitti broke that with the switch to systemd (it is still a sysvinit job, not sure he ported that)14:44
ogra_oh14:44
smbIt does not sound unreasonable... not sure why we initially said no...14:45
smbI try to remember to ask Colin on Monday ... maybe he remembers14:46
ogra_is that code even still used with systemd ? 14:47
smbogra_, it is in Trusty :)14:47
ogra_ah14:48
pkernondemand is gone with intel-pstate on trusty with the utopic kernel.14:49
pkernsmb: Yeah, it was a bit sad not to see a rationale.14:49
pkernI guess because it wasn't urgent at the time with the trusty kernel, only with 3.16+ it's now relevant.14:49
smbpkern, Agreed. And since the additional powersave is lower prio in the case statement it should not harm the other cases14:50
pkernsmb: ACK.14:51
pkernsmb: That might sound weird, but mind to take the issue in the meantime or assign it? ;-)14:55
smbpkern, Totally weird. Why would I want to do that. :-P Yeah, done14:55
pkernsmb: Thanks!15:02
zequenceinfinity: currently building15:17
infinityzequence: I saw, thanks. :)15:18
free1Do you retain logs?15:28
Pwnnadoes anyone know how the configs from the mainline builds are generated?16:29
apwPwnna, yes, i do16:33
Pwnnaapw: we left off of the CONFIG_MEMCG discussion. i had to go sleep16:34
Pwnnaspecifically http://pastebin.ubuntu.com/10582239/16:34
unixistI'm trying to add an additional x509 key to the system keyring, but in order to do so, the new key must be signed with the old key. How do I do this? You can read https://www.kernel.org/doc/Documentation/module-signing.txt and / for "keyctl padd" to see what I'm trying to do16:35
mozmckWhat is different between the vivid kernel and the trusty lts-backport-vivid kernel?16:35
infinitymozmck: Very little, except for the repository it's published in and the name of the metapackages.16:45
infinityunixist: You can't, not without rebuilding the kernel.  The key we use to sign modules is generated and thrown away during the build.16:47
apwunixist, yep, waht infinity said, the key never persists, it is gone17:03
mozmckinfinity: thanks.  Now how do I find the closest release to 3.18.9 in the repository?  I see commits like "Ubuntu-lts-3.18.0-14.15~14.04.1", but the makefile at that point says 3.19.x17:05
infinitymozmck: That's a question for apw, though it seems odd that a 3.18 tag would be 3.1917:07
free1mislabeled?17:08
apwmozmck, ok they moved the MEMCG things into a new section RESOURCE_COUNTERS which defaults off ... so we default it off17:10
unixistapw: hm?17:10
apwmozmck, and that makes the others go away17:10
apwthe "things which are new" logic is very simplistic in the test build generator17:10
free1apw: Who is "they" that moved the memcg?17:11
apwupstream17:11
apwthey moved that option and a few others under a new menu option, and that new option defaults off17:11
apwand so they get lost17:11
apwbecause the config doesn't come with a schema migration plan, like it needs17:12
free1apw: any identity for "upstream"?17:12
infinityfree1: Not everything is a conspiracy theory.17:12
infinityShockingly.17:12
Pwnnahm17:14
infinityunixist: Maybe you missed my response that apw was referring to...17:14
infinityunixist: You can't, not without rebuilding the kernel.  The key we use to sign modules is generated and thrown away during the build.17:14
apwmozmck, in theory this list http://people.canonical.com/~kernel/info/kernel-version-map.html has the upstream to ubuntu mapping17:14
apwmozmck, and if i checkout that tag, i get:\VERSION = 317:15
apwPATCHLEVEL = 1817:15
apwSUBLEVEL = 717:15
apwa 3.18.7 based kernel ?17:15
tseliotsmb: I've just spoken with upstream, and I'm ready to make the required changes. Just FYI17:15
free1infinity: Is it possible there is no crime involved? Then it is not a conspiracy.17:16
unixistinfinity: My question happens to pertain to custom-built kernels. If the key were maintained, then how would sign and add subsequent keys?17:16
apwunixist, in the packaging we manually re-sign our own packages so you should be able to do the same if you keep the key17:17
infinityunixist: So, for custom-built kernels, you just want to use a real key for the master signing key, not a throwaway.  And then use that to sign subsequent keys.17:18
apwi doubt we let you do that, but hey :)17:18
unixistinfinity: apw: Gotcha. My question is how exactly to do that. I tried using something like: scripts/sign-file sha512 old.key old.x509 new.x50917:18
unixistto no avail17:18
mozmckthanks for the info.  I see that tag, but I was also seeing the other commits which I don't understand.  Anyhow, I'll try the 3.18.7 tag.17:19
infinityapw: By "we", you mean the Ubuntu packaging?  Almost certainly not.17:19
apwinfinity, indeed that17:19
infinityMight be friendly to allow one to plug in path-to-key in debian/rules or some such.17:19
infinityAnd use it if it's set.17:19
apwmozmck, well to be honest you might as well just resign everything with your own key and not have a magrathea key at all17:19
free1I only ask if there is an identity.17:20
free1Why sign kernel "downstream" for identity or just for nothing?17:20
apwinfinity, and yes we should17:20
infinityunixist: ^ :P17:20
mozmckapw: I think you are talking to unixist about that?17:20
infinitymozmck: He was.  He's old, he forgets.17:20
apwi might be, i think i should just put both your names on everything and let you filter, cause i am not getting them right at all17:20
mozmckhaha!  me too and I'm not that old.  tab completion messes me up sometimes.17:21
apwinfinity, old enough to forget your birthday i am sure17:21
free1Of course if there were only 1 committing the crime it is neither conspiracy. That is called meditation.17:21
infinityfree1: Do you honestly believe any of this is a useful contribution to the conversations taking place?17:22
unixistapw: This is for key rotation. If the signing key is compromised, I'm screwed until I rebuild and deploy to the entire fleet. That takes lots of time17:22
unixistI read somewhere in the key retention service's documentation about revocation. I plan to read more about that since part of what I want to do is predicated on being able to revoke the initial signing key17:22
free1Yes. Why do you want to identify anything?17:22
infinityunixist: So, the kernel always has at least one key baked in.  That's the only way it can validate subsequent keys.17:23
infinityunixist: If you lose that one, you pretty much have to shut down the world and roll out new kernels.  So, uhm, don't do that.17:23
apwinfinity, it has one ca chain built in ... right, so it could have the master master key in it, and veryify the chains from there17:25
apwi think17:25
infinityRight.17:25
apwand use "this months" kernel siging key17:26
apwsigned with that, or something17:26
infinityBut that top master either needs to be ephemeral or super secret.17:26
unixistinfinity: gah I see. the problem would then be a race to revoke-and-replace-original-key17:26
apwbut ... given your h/w and your bootloader are about as secure as a wet paper bag, this is mostly moot17:26
free1IBM was the first to sell identity systems to nazi germany. So the story goes.17:26
free1Crackheads break into your house.17:26
free1Identify them?17:26
infinityAnd if it's ephemeral, you could use it to sign a subsequent rotating module key at build time before you throw it away, and roll out revocations of THAT key.17:26
apwa master master key shouldn't exist in one part "ever"17:27
free1Everywhere.17:27
apwso it cannot be stolen17:27
free1No need to key anything.17:27
free1Just look out the window.17:27
free1Sodomites everywhere.17:27
* unixist ignores free1 ;)17:27
* unixist ignore free117:27
infinityapw: Sure a proper CA master in fragments that produces chained authorities that sign kernels works fine.  But you still can't revoke the key embedded in the kernel without also disabling signed module loading.17:28
apwinfinity, well you can't reall revoke it either because well it doesn't have any way to get the revokation into the kernek17:29
unixistinfinity: you could insert-new-and-revoke-old in a single operation17:29
apwmodule signing is almost as badly designed as secure boot17:29
infinityunixist: Honestly, I'd just go lockdown in a suspected compromise situation.  "echo 1 > /proc/sys/kernel/modules_disabled" and call it done.17:30
infinityapw: Exactly.17:30
apwinfinity, and you should be there after boot on all your critical boxes, and living on the moon in a steel cage17:30
infinityapw: I *am* living on the moon in a steel cage, are you not?17:31
apwinfinity, you arn't in my cage, i hope17:31
* infinity elbows apw.17:31
apwinfinity, but if you are in that cage you forgot to disconnect those insecure network thingies17:31
infinityunixist: In theory, that would be lovely.  In practice, I don't think that's possible.17:31
unixistinfinity: bleh that's hawrd. rebooting all boxen after such a case is infeasible. Admittedly what I'm looking for is to walk the thin line between productivity and security. Therein lie the difficult and fun problems17:32
infinityunixist: And as long as the attackers can trigger a reboot, you've lost anyway, because baked in is baked in.  Any modifications you do to the in-memory keyring at run time are, well, in memory.17:32
unixistinfinity: true. I guess I'd have to treat reboot as a "reprovision" during lockdown17:33
infinity(And it's usually much easier to trigger a reboot than to gain enough privs to insert a module)17:33
unixistand that pre-supposes that I always know when I'm compromised17:33
unixistinfinity: ya totally17:33
infinityI haven't really looked into what improvements have gone into signed modules since the Plumbers two years ago when we had a nice long BoF about how much it sucked, but it really feels like it was just implemented as a bullet point feature with not much attention to actual security.17:37
infinitySadly.17:37
infinityBut with good key management practices, you can make it still be useful.17:38
infinityThe pain point is that your signing key can't be fragmented, because you need to sign all your kernels with it, so a bit of a catch-22 on the "good key management" front.17:38
infinityErm, well, maybe not.  I guess you could have a CA key fragmented, dump the public key in the keyring, sign an ephemeral key with that, and use it for all your module signing, and push revocations to live machines.  But then you lose all your modules, even the ones you kinda like.17:40
infinitySo, you'd need to build everything in that you actually need at runtime.17:40
infinityAt which point, why are  you allowing module loading at all?17:40
unixistinfinity: lose all the modules? they'd just have to be re-signed, right?17:41
unixistI mean, not fun, but not lost17:42
infinityunixist: Sure, you'd have to re-sign them all and push the new ones along with your revocation.  That's starting to look like almost as much work as just rebuilding a kernel and pushing it, though.17:42
unixistinfinity: what I want to avoid is a reboot17:42
unixistinfinity: that means cold rolling cache, minutes of downtime for each host, very slow across many hosts, etc.17:43
infinityunixist: Fair.  I suspect you're optimising for a weird attack vector, though.  But no criticism here for wanting to cover your bases.17:44
infinityunixist: So, yes, a "key of the month club", signed by your fragmented CA that you assemble only to sign those monthly keys would do the trick.17:45
infinityModules get signed by key-of-the-month on the build machine, cert chain is put in the keyring, and  you can revoke the subordinate key.17:45
infinityAssuming the kernel keyring actually supports revocation. :P17:46
infinityWhich I'd like to think it should.17:46
unixistinfinity: word17:46
infinityThat said, if I can access your build machine to get your subordinate key, I can also poison your builds.17:47
infinitySo you'd have to make sure you have backups and signed hashes and the like, or you're re-signing trojans and pushing them out.17:47
unixistThere'd have to be something like signed version control and two-factor auth'd build kickoffs17:48
unixistsounds like amazing pain^H^H^Hlan17:49
infinityunixist: Yes.  I've been considering a nice career in the field of NOTHING TO DO WITH COMPUTERS for a while now.17:50
unixistinfinity: :)17:50
mjg59infinity: Or just go with an HSM rather than fragmented keys18:39
free1jsalisbury: when did you become op?19:46
jsalisburyfree1, a few years ago19:47
free1jsalisbury: and how do you identify freenode?19:49
jsalisburyfree1, I'm not sure I understand the question19:50
free1when is the last time a cop jumped in front of a bullet for you?19:51
free1jsalisbury: do you just sign on and assume that it is the same freenode you signed on to the last session?19:52
free1do the cops pro-kick you?19:53
free1jsalisbury: answer the question19:59
infinityfree1: None of those is on topic for #ubuntu-kernel.  At all.20:00
free1What about at one?20:02
* hggdh waits for the hammer20:20
free11jsalisbury: still connected?21:11

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!