-
RhodiumToad
hm. well, I can't see any issue from just reading the code
-
RhodiumToad
are you able to compile a small linux binary to test with?
-
gzar
I guess
-
RhodiumToad
sec, I'll write something
-
gzar
i'd have to switch kernels back and forth tho
-
gzar
can't a macro be at fault? with clang and gcc behaving differently when expanding it?
-
RhodiumToad
-
VimDiesel
Title: dpaste/Cj4rR (Plain Code)
-
RhodiumToad
compile as a linux binary and run it inside and outside the chroot
-
RhodiumToad
all sorts of things could be at fault
-
gzar
in this working kernel, both return the value 0
-
gzar
both in chroot and non-chroot
-
gzar
i will now reboot into the faulty kernel, and report back
-
RhodiumToad
the address isn't the right one for the working kernel, it's based on the non-working one
-
gzar
RhodiumToad: [0x7fffffffe928] = 7fff00000000
-
gzar
inside chroot
-
gzar
and also outside chroot
-
gzar
(sh works but not bash, so i was able to chroot and run it from inside too)
-
gzar
both report the same large value
-
gzar
it looks to me like a register is not being fully set to 0
-
gzar
clang sets it and gcc does not
-
RhodiumToad
no
-
RhodiumToad
the value is supposed to be 7fffffffxxxx for some xxxx which I can't easily predict
-
gzar
ooh
-
RhodiumToad
it was 0 on the working kernel because the address is wrong there, since the code sizes change
-
RhodiumToad
I picked the address out of your gdb output
-
gzar
oooh
-
RhodiumToad
I don't understand why the chroot makes any difference though
-
gzar
you're right, it doesnt
-
RhodiumToad
though from this output, it seems like the bug is present outside the chroot too, it's just not being hit
-
gzar
segfaults without a chroot too...
-
RhodiumToad
aha
-
RhodiumToad
progress.
-
gzar
thats weird, when i ran a linux java runtime no problems happened
-
RhodiumToad
maybe a static binary?
-
gzar
possibly
-
RhodiumToad
this problem _probably_ only hits dynamic binaries
-
gzar
yeah
-
gzar
well if you want core file i can generate plenty
-
gzar
s
-
RhodiumToad
core files are not much use now. the next question is why is the value not being set, and that's going to need kernel debugging
-
RhodiumToad
actually before that, there is one check that can be done
-
RhodiumToad
let me write a quick program for you
-
gzar
alright, but i gotta be going to bed soon
-
gzar
i have aslr enabled, if thats important
-
RhodiumToad
-
VimDiesel
Title: dpaste/eazw2 (Plain Code)
-
RhodiumToad
compiled and run for linux, that should dump out the linux vdso to a file "dump.out" in the current dir
-
RhodiumToad
that should allow inspecting the ELF headers and symbol table of the vdso to see if anything is incorrect
-
gzar
alright well, this kernel has a non-working linux compat
-
gzar
so i'll leave this for tommorow if thats ok
-
gzar
really need to head off to bed
-
RhodiumToad
if it runs ok, can you pastebin both hd dump.out and b64encode dump.out dump.out
-
RhodiumToad
ok, whenever
-
gzar
yeah alright, i'll do it tommorow and let you know
-
gzar
thanks, it was fun
-
trev
ok, i am going to wipe current and go back to release. wish me luck
-
la_mettrie
bonam fortunam habetis!
-
Lovis_IX
Whaou, we need to speak and write latin to FreeBSD now? Need to learn it before.
-
RhodiumToad
Quidquid latine dictum sit, altum videtur
-
RhodiumToad
("Whatever is said in latin, seems profound")
-
trev
do more, do more!
-
paulf
whatever is said in latin, sounds like that total twat Rees-Mogg
-
meena
καὶ σὺ τέκνον τῆς ἀρχῆς ἡμῶν παρατρώξῃ.
-
RhodiumToad
and now I don't know whether that's just a lot of ?s or whether it's something my irc client can't decode
-
meena
RhodiumToad: it's Greece
-
meena
Greek, even
-
meena
You too, son, will take a bite of my rule. / You too, son, will take a taste of my power.
-
meena
this is where the "you too, my son" from Caesar's last words comes from
-
gzar
-
VimDiesel
Title: dpaste: broken_linux_ko.dump.b64.txt
-
gzar
-
VimDiesel
Title: dpaste: broken_linux_ko.dump.hd.txt
-
RhodiumToad
gzar: oh, and can you also run the same program under the working kernel?
-
gzar
oh yeah, i did, was about to ask if you want the working ones too
-
gzar
-
VimDiesel
Title: dpaste: working_linux_ko.dump.hd.txt
-
gzar
-
VimDiesel
Title: dpaste: working_linux_ko.dump.b64.txt
-
gzar
if desired i can also tar-up the kernel, modules and symbols and upload it somewhere
-
RhodiumToad
that wouldn't be useful to me at present
-
RhodiumToad
hm. interesting.
-
RhodiumToad
so the way this is supposed to work is that the linux vdso is mapped at 0x7fffffffe000-0x7fffffffffff,
-
RhodiumToad
and the freebsd shared page at 0x7fffffffd000 (i.e. the previous page)
-
RhodiumToad
(this is for linux images, obviously, for freebsd images there's just the freebsd page at 0x7ffffffff000 or 0x7fffffffe000 depending on cpu type)
-
RhodiumToad
so, the linux vdso has to have a pointer to the freebsd shared timer info (in the freebsd page),
-
RhodiumToad
and it's exactly that pointer which is broken
-
RhodiumToad
here it is in the good image:
-
RhodiumToad
09a0 10d6ffff ff7f0000
-
RhodiumToad
and here in the broken one:
-
RhodiumToad
0920 00000000 00000000 00000000 ff7f0000
-
RhodiumToad
(it's at offset 928 in the broken one)
-
gzar
thats the value that is in RSI before it segfaults
-
RhodiumToad
yes
-
RhodiumToad
so the next question is why is it not filled in correctly
-
gzar
the weirder thing is, why is it correct when compiled with clang and not when compiled with gcc
-
RhodiumToad
the entry in the dynamic symbol table looks the same on both
-
gzar
could the linker somehow botch this up?
-
RhodiumToad
I don't think so.
-
gzar
then how come the same code produces different results with different compilers? could the optimizer be at fault?
-
RhodiumToad
what happens is that the vdso is compiled separately to a .so file, and then that's included into the linux module as a data blob
-
RhodiumToad
the kernel is responsible for doing the adjustment of the pointer to point to the right place, and clearly it's not happening
-
gzar
well, it is when clang is used
-
RhodiumToad
right
-
gzar
unless the fact that it works happens to be a lucky coincidence due to some offset/alignment happenstance
-
RhodiumToad
can you do objdump -x linux64.ko | grep kern_timekeep_base on the bad kernel's linux64.ko
-
gzar
yeah, one sec
-
gzar
-
VimDiesel
Title: dpaste: E7MBXK64G
-
meena
11:33 <gzar> well, it is when clang is used ⬅️ that seems like a pretty bad bug
-
gzar
yeah but i cant help but blame the compiler, since thats the only difference between a working linux64.ko and a busted one
-
RhodiumToad
gzar: can you get a disassembly of linux_exec_sysvec_init from kgdb linux64.ko (make sure the /usr/lib/debug subdirs are in the correct places as before)
-
gzar
yeah, one sec
-
RhodiumToad
unless I'm misreading this code, there are two separate places that both think it's their job to be initializing this,
-
RhodiumToad
and they may not be actually doing the same thing
-
gzar
-
VimDiesel
Title: dpaste: DLUMPVS9D
-
RhodiumToad
but without instrumenting the kernel to get details it's hard to tell
-
gzar
that is why i asked if you wanted the busted compiled kernel binaries and modules
-
gzar
do run through qemu or bhyve
-
RhodiumToad
I'd have to modify the code anyway, so having your compiled version wouldn't help much
-
RhodiumToad
maybe someone else would use a different approach
-
meena
RhodiumToad: dtrace kinst not Good enough?
-
RhodiumToad
that's in -current, no? (I have not been using dtrace)
-
gzar
i dont think i have dtrace support enabled
-
meena
it's in current, yes, not sure it's been MFC'd
-
meena
gzar: 😒
-
meena
if you're building an adventures new system, you better enable all the bells and whistles to make it debugable
-
gzar
i got a bunch of undefined symbol errors and i didnt expect gcc to break the kernel
-
gzar
its a generic kernel, i didnt consider switching a compiler would cause anything
-
gzar
to malfunction
-
meena
do you know how long Linux took to build under clang?
-
gzar
no
-
rustyaxe
about 12 minutes?
-
meena
I mean, how long did Linux devs work on making Linux build with clang
-
gzar
i have no idea, honestly. Its the same language and both compilers should produce code that behaves the way it is described in the .c file
-
gzar
and besides the linux compat, the rest of the system seems fine
-
meena
C is a weird language. and C compilers are very complex machinery
-
rustyaxe
doesnt help linux kernel uses a lot of gcc extension :)
-
RhodiumToad
freebsd uses a lot of clang-extensions-copied-from-gcc
-
RhodiumToad
gzar: I probably won't be able to do more on this today.
-
gzar
its fine RhodiumToad , i didnt expect anything at all from this
-
RoyalYork
Is there a way I can automate or manage FreeBSD upgrades in a better way? I have 2 VPS plus one local server running FreeBSD. When 13.2-RELENG was released, I had to upgrade all three servers manually. Is there a better way to upgrade/update my machines? The names of programs or directions to man pages would be great
-
vkarlsen
RoyalYork: I like to use tmux-xpanes when I want to make the same mistake on several servers at the same time
-
RoyalYork
😂
-
RoyalYork
;-)
-
RoyalYork
So you're saying manual is better?
-
vkarlsen
I find that manually using freebsd-update isn't too much work, and I don't trust an automated process out of the box here because manual intervention is sometimes necessary to merge changed files
-
RoyalYork
Understod. I'm not a sysadmin or network expert (just some shlep interest in BSD). In the real world, so sysadmins manualy update each server?
-
vkarlsen
And that running freebsd-update between releases doesn't take up a lot of my time
-
vkarlsen
It depends on many things. Try pinging AllanJude if you want to hear how he manages large amounts of servers, I remember him having a clever way of doing this
-
RoyalYork
Was just wondering out of curiosity. But I hear your point. A few servers, doesn't take a lot of time.
-
meena
RoyalYork: if instead of 3 servers, you had 30, i would recommend to reimage then. but 3 is like pets, not a cattle farm, so you can do whatever you want
-
meena
I was gonna link that three minutes gif titled running your blog in kubernetes, that has someone build a sandwich with heavy duty tools in a carpentry shop
-
meena
but all I'm finding is just graphs of the architecture of a blog run in kubernetes, so that joke is now reality
-
meena
tho, for me, personally, the cutoff point isn't 30, it's more like 4
-
RoyalYork
thanks meena
-
gzar
hello, i am once again asking for your support. I can't load vboxdrv kernel module, the error i am getting is this: linker_load_file: /boot/modules/vboxdrv.ko - unsupported file type
-
meena
gzar: what's the file type? and what are the other modules' file type(s)?
-
gzar
/boot/modules/vboxdrv.ko: ELF 64-bit LSB relocatable, x86-64, version 1 (FreeBSD), BuildID[sha1]=bc1e7274194b94bd7aad4f7fd11747772e907271, not stripped
-
gzar
/boot/modules/nvidia.ko: ELF 64-bit LSB relocatable, x86-64, version 1 (FreeBSD), BuildID[sha1]=75b022797682ef490cf72ef03e54f0cee20fea17, not stripped
-
meena
that looks very much the same, tho
-
gzar
i know
-
gzar
i'll try compiling it from ports
-
gzar
alright, it worked
-
gzar
the message indicates that the module wont load on different kernel versions
-
gzar
this is exactly why i like freebsd
-
gzar
or just bsds in general
-
meena
unsupported file type isn't very intuitive
-
luna_
-
yuripv
looks like... linux
-
luna_
yuripv: so it is sorry but the talk is about BSD atleast
-
luna_
-
VimDiesel
Title: Profesjonell bruk av fri programvare med Peter Hansteen - YouTube
-
meena
luna_: what's it mean?
-
polyex
what's best simple image viewer?
-
polyex
like jpg gif
-
schillingklaus
feh is simple
-
luna_
+1 for feh
-
meena
display from imagemagick?
-
la_mettrie
i often use browser
-
schillingklaus
maybe somethiong on the lines of professional usage of free software
-
luna_
schillingklaus: yep in norweigan
-
meena
Indo-European.