-
cracauer
-
cracauer
I wonder whether I should try putting my own mutex around that line.
-
kevans
there's the problem, I bet
-
kevans
if you trace back through call sites, you land at elf_startup_loaded_object_callback
-
kevans
that itself is the result of startup_register_loaded_objects() calling dl_iterate_phdr
-
kevans
so you end up recursing on the lock, which we don't allow (but Linux does)
-
cracauer
Ah.
-
cracauer
There are 3 call sites in that file alone. I didn't notice that before.
-
cracauer
Thank you, I know what to try.
-
kevans
yup, good luck
-
cracauer
This exposes that I don't understand what the nested walking is supposed to accomplish...
-
kevans
the last time I had to deal with recursing in dl_iterate_phdr(), it's because they wanted the outer layer to ensure that nothing else was simultaneously loading objects
-
kevans
but that made more sense because it was a sanitizer runtime that knows nothing about what it's being used in
-
vext01
morning
-
vext01
a fantastic way to start my weekend -- broke my freebsd server
-
vext01
ran 'zpool upgrade' but forgot to upgrade the efi bootcode
-
vext01
system didn't boot, saying something about unsupported zfs capabilities
-
ivy
vext01: you need to boot from external media (e.g., installer), mount the EFI msdos partition and copy the new /boot/loader.efi into it
-
vext01
so booted a live usb stick and ran the 'gpart bootcode ...' command from the manpage
-
ivy
no don't do that!
-
vext01
am i hosed?
-
ivy
well, no, but gpart bootcode won't fix your problem, that's for old BIOS/CSM boot method
-
ivy
for UEFI the firmware loads the loader from the msdos partition
-
ivy
2!hemlock ~# ls -l /boot/loader.efi /boot/efi0/efi/boot/bootx64.efi
-
ivy
-rwxr-xr-x 1 root wheel 663040 Feb 17 11:00 /boot/efi0/efi/boot/bootx64.efi*
-
ivy
-r-xr-xr-x 2 root wheel 663040 Feb 28 17:08 /boot/loader.efi*
-
vext01
ok, before we continue, should i be worried that 'zpool status' dosn't show anything?
-
ivy
you need to copy the second file to the first file, basically
-
ivy
vext01: that's normal, you probably need to run 'zpool import'
-
vext01
oh phew
-
ivy
(maybe need zpool import -f)
-
vext01
i see my pools
-
vext01
right so i need to locate the msdos partition, is that with gpart?
-
ivy
yeah, so import your root pool, you need that to get the new loader.efi, but import it with an altroot: zpool import -f -R /mnt zroot
-
ivy
and yes, use gpart to locate the efi partition, it will look like this:
-
ivy
4!hemlock ~# gpart show ada0
-
ivy
=> 40 1953525088 ada0 GPT (932G)
-
ivy
40 2008 - free - (1.0M)
-
ivy
2048 532480 1 efi (260M)
-
ivy
if your zroot is on ada0 (or whatever) then the EFI partition is probably the first partition on the same disk
-
ivy
then mount it: mkdir /efi; mount -t msdos /dev/ada0p1 /efi # replace ada0p1 with the actual device
-
vext01
read only filesystem apparently
-
ivy
hm, try mount -u -orw /
-
vext01
ah, ill mount on /mnt
-
ivy
you can mount it on /mnt but then don't mount the zpool on /mnt as well :-)
-
ivy
if you want to do that, import the zpool first, then mount the msdos filesystem on /zroot/ROOT/default/boot/efi or something
-
ivy
(you may need to manually 'zfs mount zroot/ROOT/default' first)
-
vext01
i won't mount the zpool at all for now
-
ring0_starr
-
vext01
ivy: so the efi partition is index 1 of ada0, i ran 'mount -t msdos /dev/ada0p1 /mnt' and got 'mount_msdosfs: /dev/ada0p1 :invalid argument'
-
vext01
(having to type all this my hand :P )
-
vext01
could be because the fs is ro still?
-
ivy
it shouldn't, if /mnt exists you can mount on it
-
vext01
hrm
-
vext01
maybe my 'gpart bootcode' thing broke the partition?
-
ivy
vext01: maybe you need to 'kldload msdosfs'?
-
ivy
although that should be in GENERIC
-
vext01
says its already loaded
-
ivy
what gpart bootcode command did you run exactly?
-
vext01
the one from the manpage, let me type it out
-
ivy
also check dmesg, there may be a more informative error there
-
vext01
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
-
ivy
well, since your system is broken anyway and the EFI partition only contains a single file, you can just create a new filesystem there: newfs_msdos /dev/ada0p1 # make sure this is really your EFI partition before you do this, and not (say) your zroot
-
vext01
right
-
vext01
1 efi (260M)
-
vext01
^ sounds like the one
-
ivy
yeah, that seems right
-
vext01
ivy: by the way, i really appreciate this help
-
vext01
you are rescuing my weekend as we speak
-
ring0_starr
wouldn't it be a better idea to figure out what's wrong with the current partition first
-
vext01
ok, new fs is mounted on /mnt
-
ivy
ring0_starr: i assume it was broken by installing BIOS bootcode, you're meant to install that on the freebsd-boot partition, not a FAT filesystem
-
vext01
makes sense
-
ivy
vext01: ok, mkdir /mnt/efi/boot; cp /boot/loader.efi /mnt/efi/boot/
-
GoSox
my big fear about switching to freebsd for my server is that if i break thing, i'll have no idea how to fix them
-
ivy
assuming you're using installer media that's new enough
-
GoSox
ive been using Macs for 35 years but freebsd, all i can really do is follow instructions
-
vext01
ivy: file copied
-
vext01
unmount and reboot?
-
ring0_starr
huh
-
ivy
vext01: no, i gave you the wrong filename, sorry
-
ivy
vext01: it should be called /mnt/efi/boot/bootx64.efi
-
ring0_starr
bootcode goes in the first sector of a FAT filesystem
-
ivy
(some firmwares might be able to load it from loader.efi but bootx64.efi is the standard name)
-
ring0_starr
the first three bytes are defined by the FAT standard to be an x86 jmp instruction
-
ring0_starr
lol
-
vext01
ok, renamed
-
ivy
vext01: you should be okay to reboot then
-
vext01
ok,here goes
-
vext01
pray for me
-
ring0_starr
bootcode would have nothing to do with it. EFI looks for the GPT header at 0x1000
-
vext01
kernel booting...
-
ring0_starr
there's still the pMBR in case somebody tries to legacy boot the disk to tell the user that they goofed up
-
vext01
ivy: you are my hero!
-
ivy
ring0_starr: i think the freebsd bootloader is too large to fit into a single FAT sector, it's meant to be installed on a dedicated partition
-
ring0_starr
when you say bootloader you mean stage 3 zfsloader
-
vext01
ivy: you have literally saved my weekend
-
vext01
thank you, thank you
-
ring0_starr
look at stand/i386... there's many bootloaders in various stages
-
ivy
ring0_starr: no, boot2
-
ring0_starr
oh that's for ufs i think
-
ring0_starr
wow bootloader situation on fbsd is confusing
-
ring0_starr
there's so many versions of approximately the same thing
-
ivy
right, i think for zfs you use zfsboot instead of boot2? i try to avoid CSM boot as much as possible so i'm not 100% sure how this works
-
ring0_starr
and uefi was supposed to take over as the bootloader
-
vext01
ok, i can now go back to what i was initially trying to fix all along
-
vext01
i have a directory on a zfs partition that is empty, but cannot be deleted
-
vext01
input/output error
-
vext01
zpool status lists this file as being corrupt also
-
vext01
what are my options?
-
vext01
i believe the hardware is OK, nothing in dmesg about failing disks
-
vext01
it's on a zfs mirror
-
ivy
you may need to ask fs@ about that, but zfs errors are generally fairly opaque and difficult/impossible to fix
-
vext01
yikes
-
vext01
i suppose i can start by scrubbing to see if anything else is busted
-
ivy
although, on the off chance you use zfs native encryption, this is expected due to a long-standing zfs bug that no one knows how to fix
-
ring0_starr
oh, ez, just learn all about ZFS internal structure, do a deep dive into ZFS code, set up a kernel debugging environment, break on that error log, and get to it! so easy
-
vext01
so ez
-
ring0_starr
shit's overcomplicated well past the point an actual human being can troubleshoot an issue like this
-
ring0_starr
this specific zfs issue might be rare, but the probability of encountering any opaque issue while interacting with some kind of deep system is high
-
ring0_starr
and they all require you to drop everything and go learn about some specific advanced niche topic
-
vext01
if i don't care about the corrupted file (i have a backup), can i just use `zfs destroy`?
-
vext01
it sounds like that would delete a whole filesystem, not the individual file
-
vext01
-
vext01
oh, it's waiting approval of course...
-
ring0_starr
is there any way i can install unmet dependencies of a port using pkg, and install the port itself that i wish to make using ports?
-
ring0_starr
somehow i always end up compiling perl
-
ring0_starr
i'm really sick of those cutesy little p5- packages, by the way
-
nimaje
pkg install <package>; pkg remove <package> and then build the port?
-
ring0_starr
oh, scripting language dependency can get installed through the scripting language's manager
-
ring0_starr
but there's system versions of the same thing
-
ring0_starr
and mixing the two cause problems
-
ring0_starr
i don't know how anybody has a functional computer
-
ring0_starr
this chaos is unsustainable
-
ring0_starr
agh
-
nimaje
datasets in zfs are pretty cheap, so you can create them instead of directories and then zfs destroy would be the tool to delete it, but not sure if it works with datasets containing corrupted files, I guess it should, but that would have needed to decide on that setup before hand and probably fideling with zfs allow, if you want to do that for your user and not only for system directories
-
ring0_starr
nimaje, that would work but the deps for building are different for runtime deps
-
nimaje
use the build-depends-list target of the port
-
ring0_starr
wait how would i get a list of deps from that
-
ring0_starr
oh it literally does that nevermind
-
ring0_starr
thanks
-
vext01
nimaje: i'd just really like to be able to delete that directory
-
vext01
like i say, i have a backup, but i don't want to restore the whole fs if only that dir is bust
-
dvl
I find edge cases. On an scp over a VPN, I get: ssh_ssh_dispatch_run_fatal: Connection to 10.1.0.17 port 22: message authentication code incorrect
-
martinrame
Hi, I'm trying to find which program opened the port 2222 on one of my jails. If from the host I do a: sockstat -4 -l|grep 2222 I don't get anything. But I can do a telnet <IP> 2222 and it responds, but I don't know which protocol it uses, because I cannot ssh, nor http to that IP:Port
-
mzar
martinrame: hello, try "sockstat -l -j jid
-
mzar
on the host
-
martinrame
Hi mzar I found that my host is connected to that IP:PORT, now I need to find which program is connected.
-
Dooshki
Hey there! I wonder, when using blacklistd with a VNET jail, I presume I should have blacklistd running in the jail too? As opposed to jails that share networking with the host system and can just link up to the host system's blacklistd socket
-
mzar
OK, then check just "sockstat -j jid"
-
mzar
Dooshki: so it is jail without vnet, with firewall on the host and blacklistd running on the host ?
-
Dooshki
mzar: No, a jail with vnet, with a firewall in each jail
-
mzar
Dooshki: if the jail has own TCP stack and firewall (VNET jail), then you manage this firewall from the jail and you have to run blacklistd inside this jail
-
Dooshki
Alright, thanks for the pointer!
-
mzar
jail with VNET adds overhead, has slower network performance and consumes more CPU cycles
-
mzar
do you really need this VNET Dooshki ?
-
Dooshki
I'm not about to spend the entire weekend re-doing my entire home server :P
-
mzar
OK
-
mzar
I am running a lot of jails, and only few are VNET ones
-
mzar
dvl: I responded via e-mail, I hope it will help you to troubleshoot this issue
-
mzar
Happy International Women’s Day, for those who celebrate !
-
Dooshki
mzar: I believe the reason why I went for VNET jails when I set them up a year ago was to have fine-grained control over what sort of networking capabilities compromised applications within the jails could have
-
Dooshki
Phew, it works! Didn't need to spend the entire weekend on it :)
-
vext01
ivy: about that file i can't delete. Do you think making a new dataset and copying everything over, then restoring the corrupted file from backup will work?
-
martinrame
Hi again mzar, it looks like there are no jails opening the 2222 port. I wonder why when I call telnet <IP> 2222 I get a response, can that be the firewall, pf in this case.
-
martinrame
I stopped the jail with problems and now there's no telnet to it. Now I'm running Sniffnet in the host and I see there's still showing connections to the IP of that jail...
-
mzar
maybe it's something listening on the host on port 2222
-
martinrame
with telnet I cannot reach that port on the IP (nor the loopback) of the host.
-
mzar
if the jail shares TCP stack with the host (non-VNET jail), then it can behave this way
-
mzar
interesting story
-
martinrame
yes I wonder if Sniffnet caches resultsd
-
martinrame
mzar: I restarted it and that IP is no longer showing
-
mzar
OK
-
martinrame
now there's a jail connected to the outside, how can I know which program is doing that?
-
Dooshki
Excellent, it's working even after a reboot :D
-
mzar
why it wouldn't ?
-
Dooshki
mzar: most likely something wrong with the three different instances of /etc/rc.conf
-
Dooshki
(one host, two jails)
-
mzar
that's 100% correct
-
Dooshki
And yeah, thanks again for pointing me in the right direction!
-
dvl
mzar: email regarding openvpn and scp issues?
-
polarian
hmmm so after playing with the installer it appears for FDE with keyfile on a usb you got to drop into the shell
-
polarian
and also manually partition
-
polarian
orrr I believe instead could set the keyfile after install
-
polarian
that would likely be the better option
-
polarian
I am going to just do the latter, although I would be curious to do an install without bsdinstall to learn more indepth the freebsd system, anyone got any guides/articles on bsdinstall-less install?
-
polarian
arch linux style :P
-
dvl
mzar: I updated one client from FreeBSD 14.1 to FreeBSD 142 - problem seems to have gone away.
-
dvl
mzar: I'll work on upgrading the other hosts soon. It would be good to know WHY this upgrade fixes the issue.
-
ivy
do we have "gretap" (Ethernet encap over GRE) in FreeBSD?
-
ivy
looks like no, i guess vxlan(4) is the alternative
-
martinrame
I'm trying to secure one internet exposed jail with pf and found when I check a port using: telnet <ip> <port> it shows the message "Connected to ....Escape character is..", how can I block that?
-
martinrame
It doesn't matter which port I point, even non existent ports, it always returns that connection message.
-
martinrame
I have a block in rule and only allow access (tcp and udp) to two specific ports.