libera/#eudev/ Tuesday, 2021-12-21

sam_yeah00:11
sam_[09:13:24]  <minime> I have a very bad feeling about how Gentoo is handling this... I'm surprised Gentoo is working so hard to remove eudev noe that the development issue has been solved.00:11
sam_well, someone had to maintain it00:11
sam_(you're welcome to help!)00:12
sam_on our side00:12
sam_i'm sorry you have a bad feeling but in any case i've added 3.2.11 which is what you're now using00:12
sam_i keyworded it last night and i'll be unmasking eudev shortly given it seems to work well now00:12
sam_(3.2.11 is already in the Gentoo repo)00:12
sam_basically: we started planning to drop it, then the new project (this) started, but someone still needed to pick it up on the Gentoo side00:13
sam_nothing nefarious00:13
genr8eoflmerry christmas eudev00:28
sam_yes :)00:30
sam_kurly is to blame here for making sure I got it done00:30
bb|hcbsam_: thanks for the explanation - at least 3 (maybe) different people asked about that recently00:31
sam_no problem bb|hcb, and sorry I'd not been great with communication recently. the last 2 months or so have been pretty rough after my dog got hit by a car and he's been in/out of the vets a lot. he's luckily doing well now but it's been draining and I've only really been able to focus on bare essentials00:32
sam_(it's been draining on everybody in the house, etc)00:32
bb|hcboh, ouch... good to know dogo is fine :)00:33
bb|hcbsam_, let's clarify something - now gentoo offers choice - udev or eudev, right?00:35
sam_yes!00:35
sam_as of a few minutes ago00:35
Arsen<3 thanks for doing my job sam_00:36
sam_you did the real work wrt hwids and stuff, I just updated the ebuilds and tested a bit00:36
sam_I'm sure I can rope you in if anything breaks ;)00:36
Ariadneexcellent00:37
Ariadneat some point, we will rebase on systemd-udev, maybe, or maybe not00:37
kurlyya i'll be around, more like "around-ish" in the next few days but around00:37
bb|hcbvery good - choice is base for freedom :)00:37
Ariadnei have mixed feelings00:37
Ariadnethe systemd codebase is not one i find "good"00:37
sam_one of the things that bothers me is e.g. this hesitancy to properly fix VLA usage00:38
sam_even though people have made PRs for it a few times00:38
bb|hcbVLA?00:38
Ariadnei'm open to seeing what Arsen has in mind in that regard, but00:38
Ariadnei am also kind of in the mindset of "if it's not broken, don't fix it"00:38
Ariadneand there are changes systemd has made to udev that i disagree with, but not strongly enough to say "this is not something we should do"00:39
sam_e.g. https://github.com/systemd/systemd/pull/19973 but variable length arrays (VLAs) are a common C footgun and they were the source of the most recent CVEs for systemd. it'd make more sense to just not bother using alloca rather than trying to make it safe which is harder to do.00:39
sam_yeha00:39
sam_yeah00:39
AriadneVLAs are also bad for portability00:39
Ariadnei mean, admittedly, eudev only targets Linux (and i guess Mangaarm, but that is somebody's toy)00:40
Ariadneso portability to say, MSVC is kind of not interesting00:40
Ariadnebut they are still a GNU-ism00:40
bb|hcbsam_: ok, this one... i agree that unless properly guarded somewhere that is not a good idea00:42
Arsenthe biggest issue with VLAs is that they can't fail nonfatally00:42
bb|hcbanyways that makes verification very hard and bugs may (will) creep in00:43
Ariadnethe biggest issue with VLAs is that they make verifying stack space requirements difficult00:43
Arsenwell, yeah00:43
Arsenthat manifests as fatal failures00:43
Ariadneanyway lets rewrite udev in rust00:44
Ariadnefuck yeah00:44
Arsenlol00:44
Arsensimultaneously drop 3 or 4 arches from the support list00:44
Arsensay they were never supported00:44
Ariadnewhat is anything other than aarch64 or x8600:45
bb|hcbabout compilers, even tcc supports that00:45
bb|hcbseriously, i am not sure which path would be more proper - deviating and rewriting the ugly code parts (parser, greedy_*alloc, etc) or keeping closer to upstream00:48
bb|hcbmy gut feeling says the former, but i may be wrong :P00:49
Arsenlatter + upstreaming seems more maintainable to me00:50
Ariadneformer00:51
Ariadneits ultimately bb|hcb's call, he is doing much of the maintenance :P00:51
Ariadnebut i would prefer to go with his plan of just rewriting the bad code00:51
Ariadneand maybe offering it to systemd, but who cares honestly00:52
bb|hcbdo you really think upstreaming possible? i have doubts; and in case the effort for upstreaming is too much, it is pointless00:52
ArsenI'd not be that pessimistic about it00:52
Arsenwhat code do you mean specifically?00:53
bb|hcbsearch for realloc in the code; then check how in case of NULL there is leak00:53
Arsenthe code that i'd like to keep as close to upstream as possible is only about 16k lines00:53
Arsenyeah, much of this is removed or inside the scope of libsystemd00:54
bb|hcbi tried to merge cdrom_id.c - the version is eudev uses fixed memory to fit the known data in it; upstream that is rewritten to greedy_alloced dynamic array; it is still pending on my list to verify that the old code is not missing some feature00:55
bb|hcb...version in eudev...00:55
bb|hcb...in upstream...00:55
bb|hcbthat adds effort to sync, but the old code is much better; that one makes me doubtful that upstreaming such a change is a no go00:57
bb|hcbor we may talk about parsers and grammars - current code does some quick hack that conforms to no specification, has rough edges (most probably buggy in 1000 ways on edge cases) and can not be verified in any way00:59
bb|hcbfine folks invented yacc in the 60s00:59
Arsensurely, one would accept objectively better code01:10
bb|hcbnow as i read the comments in pull/19973 - the plan is to replace stack allocation with a check + assert, and as far as i see to also introduce a single allocation maximum safe value. then blissfully believe that multiple allocations are not going to cause a crash01:15
sam_yep..01:15
sam_i would prefer they just banned it01:15
sam_it's a microoptimisation01:15
bb|hcband assert in an essential service, yuck...01:15
bb|hcbas far as i am aware no one suffered from udev low performace. but string operations are done in a very suboptimal way... iow  penny-wise and pound-foolish01:19
bb|hcblet me </rant>... ;)01:19
sam_:D01:20
bb|hcb/* If for some reason more than 4M are allocated on the stack, let's abort immediately. It's better than01:27
bb|hcb * proceeding and smashing the stack limits. Note that by default RLIMIT_STACK is 8M on Linux. */01:27
bb|hcb#define ALLOCA_MAX (4U*1024U*1024U)01:27
bb|hcbso 3 by 3M are good to go...01:27
bb|hcbbtw. if someone is willing to propose stack allocation removal patch, that would be more than welcome01:28
bb|hcbthe easiest way would be to #define alloca our_alloc, that keeps track of things and borrows some gc from java in the main loop </joke>01:30
semzgreedy_realloc's overflow checks are completely wrong, aren't they?01:41
bb|hcbnot completely - that is the works for me (tm) area...01:53
sam_bb|hcb: fwiw, built fine (and tests, their small size aside) on amd64/x86/ppc/ppc64/sparc/arm/arm64 for us04:02
sam_not tried some of the other arches04:02
Arsenno define hackeryt10:33
Arsenhackery*10:33

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!