IRC channel logs

2021-08-10.log

back to list of logs

<oriansj>stikonas: merged
<stikonas>ok, thanks
<stikonas>oriansj: quick question, in hex2_word.c::DoByte you call hex(c, source_file) quite a few times. Can't you just call it at the beginning of the file and store the result?
<stikonas>or am I missing something
<stikonas>well, hex does consume the whole comment but that should be fine
<Hagfish>stikonas: if it's anything like Trillian (another new project which Google is backing), it will work like Certificate Transparency
<Hagfish> https://github.com/google/trillian
<Hagfish>i'm not sure that using a blockchain (maybe ethereum) would be a bad idea, but i don't think we have enough data on possible attacks to decide what a realistic threat model is yet
<oriansj>stikonas: because https://github.com/oriansj/mescc-tools/blob/master/hex2_linker.c#L352 it just reads one char from the source file at a time (Or an entire line comment)
<stikonas>well, that function either reads 0 or entire line, we read character earlier and just pass it to that fucntion
<oriansj>stikonas: yep
<oriansj>and updates the line_number so that error messages can have an accurate line number in the message
<oriansj>and yes we could do caching of the input (or the generated hex) but that would add complexity to any implementation in assembly.
<stikonas>oh yes, ok I was ignoring that line_number because I don't need it for hex1
<stikonas>trying to keep hex1 as short as possible
<stikonas>so non-essential features can go to hex2
<stikonas>anyway, more work on hex1 will have to wait for another day
<oriansj>stikonas: which format do you tend to you for jumps and function calls?
<stikonas>it's jal for function calls so J-type
<stikonas>and B for other branch jumps
<stikonas>those are most common
<oriansj>because you could limit hex1 to just @ or $
<oriansj>(or both if you need both a bunch)
<oriansj>and single character labels
<stikonas>oh yes, definitely single character labels
<stikonas>we'll see regarding other encodings, they might not be too bad
<stikonas>anyway, going to sleep now
<oriansj>and you can collapse UpdateShiftRegister if you can find a way to just use one of the type formats
<oriansj>(skip !, ~, ., %, & and > entirely for hex1)
<oriansj>probably can skip < and ^ too (I don't think we even use ^ in RISC-V yet)
<stikonas[m]>Yeah, none of < ^ were used up to now
<oriansj>and DoByte needs only handle hex so that can be seriously simplified
<stikonas[m]>Yeah, I'm only doing hex part
<stikonas[m]>And no "update" in it
<stikonas[m]>That's only used with .
<oriansj>and you can even reduce line comment support to just # or ;
<oriansj>which will not be needed in hex1
<stikonas[m]>Well, that's just one branch statement...
<stikonas[m]>I would lean towards leaving both...
<oriansj>and Throwaway_token and consume_token can be reduced to a single fgetc
<oriansj>and no need to clear scratch
<stikonas[m]>Yes, throwaway token is already done
<stikonas[m]>And most if do_byte
<oriansj>using a 256 element array is all one needs for label address lookups and storage
<stikonas[m]>Anyway, both comments were already done before
<oriansj>just read the char after : and << 2 + base_address of table to store to read the address relating to the :l
<stikonas[m]>(I started by cleaning up my hex1_x86.S and building on top of that, some parts are now changed, but comment implementation is already there)
<oriansj>I trust you'll find the minimal subset so that you will not have to deal with jump and/or call offsets when dealing with hex2
<pabs3>Hagfish: re "everyone will keep using language-specific package managers", do you see a way to change that trend?
<Hagfish>i'm wondering if they might all converge towards a standard package format + security model
<Hagfish>The Update Framework are doing some good work in that area
<Hagfish>i can see the argument that there should be multiple competing tools for downloading packages and maintaining repos, etc.
<Hagfish>and there should be multiple organisations who decide what is allowed in each repo
<Hagfish>so some amount of "fragmentation" is healthy
<Hagfish>i think the biggest cultural divide is how much an ecosystem values stability and long-term support
<Hagfish>i don't know if the technology itself can help much with that
<pabs3>I think language-specific package managers arose because the Linux package managers weren't targetted at proprietary OSes like Windows/macOS, and any cross-language package manager would need this to have any chance of replacing them. also I think people often want the tools for the language to be written in the language so they can understand/modify them
<siraben>pabs3: I think Nix has been a great way to reduce reliance for me on language-specific package managers
<siraben>In particular, ecosystems like Python are a mess in terms of reproducibility
<pabs3>which OSes are you using it on?
<siraben>macOS and NixOS and other distros
<siraben>My home configuration is the same across all of them
<pabs3>during the next Debian cycle I want to try to wean Debian off using source artefacts from packaging ecosystems like PyPI and move towards upstream git repos
<pabs3>the discussion the Debian Python team had about this was interesting: https://lists.debian.org/debian-python/2021/06/threads.html#00026
<siraben>drakonis suggests Guix which is the same idea as Nix
<siraben>but it's more restrictive for me because no macOS support
<pabs3>it highlighted that just switching to upstream git isn't enough, we should audit the diffs between the two
<siraben>Yeah, there can be differences between upstream git and pypi
<siraben>which is annoying
<pabs3>same in the Rust ecosystem. the diffs in the browser extension ecosystem can be much much worse though
<siraben>Nix prefixes store entries with a hash of the derivation (build recipe) so if anything changes in the underlying derivation, the hash does as well and so do all the reverse dependenncies
<pabs3>in one particular case, the Rust crate shipped some pre-generated stuff and didn't ship the source/tool needed to re-generate it, which were in the git repo though
<siraben>Also in doing so it makes it safe to get from the cache instead of rebuilding
<siraben>For Rust packages we prefer upstream git repos and have a vendor sha hash
<siraben>e.g. https://github.com/siraben/nixpkgs/blob/9bda04939e74610cadee2c53b2cf448e28e4b45b/pkgs/development/tools/knightos/regenkfs/default.nix
<siraben>pabs3: that sounds nasty, oof
<pabs3>I've pretty much given up on devs doing the right thing when it comes to choosing their source and actually building from source
<drakonis>rust hellworld
<drakonis>siraben: has nix's packaging quality improved in the past several months?
<siraben>drakonis: how would I measure that
<siraben>we're still more up to date than any other distro and almost as large as AUR
<drakonis>that's a measurement of quantity here
<drakonis>perhaps the best way to measure quality is whether they follow a certain level of cleanliness?
<siraben>Sounds subjective, heh.
<siraben>There's people fixing cross-compilation issues, broken packages get fixed, reproducibility fixes, etc.
<drakonis>very
<siraben>So I think the quality is getting better all the time
<siraben>we're deprecating phases and other legacy things
<siraben> https://github.com/NixOS/nixpkgs/issues/28910
<drakonis>phases?
<drakonis>wait what.
<siraben>explicit setting of phases
<drakonis>oh
<siraben>you don't use nix currently?
<drakonis>i have been out of it for some time now
<siraben>IMO quality and quantity are always improving for Nixpkgs
<siraben>What's the situation like on Guix?
<drakonis>ever marching forward
<drakonis>upstreaming work on the home manager equivalent still ongoing
<siraben>I wish I could use Guix to get some ideas from it
<drakonis>added a nicer way to look up inputs
<drakonis>package inputs
<drakonis>let's see
<drakonis>better setuid support
<drakonis>python still in better condition than nixpkgs
<siraben>ooh, how so?
<drakonis>as guix does not rely on scripts for generating language specific environment on the fly
<drakonis>it has packaged things in a way that if you install them or invoke a regular environment, the packages are visible to the resulting environment
<drakonis>oh yeah i almost forgot
<drakonis>it was sped up recently
<drakonis>grafts were sped up, that is
<drakonis> https://git.savannah.gnu.org/cgit/guix.git/commit/?id=898238b9f5199aaebffa508f62a2a00854370048
<drakonis>build against this
<drakonis>and it should be exposed to further python invocations
<drakonis>anyways you get the idea
<drakonis>siraben: anyhow, the next release will be plenty interesting
<siraben>I still have the urge to reduce Nixpkgs' bootstrap
<drakonis>would be impressive
<drakonis>since there isnt exactly a huge drive to do it
<drakonis>ie: not a community wide concern
<drakonis>maybe i should hit up the matrix channels
<siraben>drakonis: join us
***ChanServ sets mode: +o oriansj
<Hagfish>pabs3: coincidentally, given our recent chat: https://news.ycombinator.com/item?id=28122779
<Hagfish>"Maybe the solution is some kind of standard spec for how package management should work, and the manifest formats, etc, and then each language ecosystem implements that standard."
<Hagfish>that's basically what i was thinking
***jackhill_ is now known as jackhill
<gforce_de1977>dear lovely hackers, time is flying here, and i dont have enough time for hacking 8-) just a friendly hello, saying that some checksums seems wrong: http://intercity-vpn.de/bootstrap/log_fosslinux__master-f9ebb33-i686_kernel3.18.140.txt - can somebody confirm that?
<siraben>FYI GitHub is currently down
<stikonas>gforce_de1977, might be due to 32-bit kernel, not sure if fossy tested it with it
<stikonas>gforce_de1977: running with a 32-bit kernel is a bit on hold right now anyway
<stikonas>until fossy finishes kernel building work
<stikonas>since we can't fit in 4 GB of RAM
<oriansj>The 3 failures seems related to perl 5.32.1
<oriansj>Hagfish: in regards to sigstore. I don't quite see how it improves things. If anything I can see ways it can be abused to make things far worse. FLOSS at its heart is a people sharing code with friends and the community; with curation occuring at the distro level.
<oriansj>^things things^things worse^
<oriansj>but perhaps that is because I am doing a compare against what NIX and Guix provide out of the box.
<Hagfish>oriansj: yeah, i think the value proposition is much smaller for ecosystems like Guix/Nix
<Hagfish>it's probably supposed to appeal to ecosystems that want to keep doing things their own way, but still get the benefit of signed releases
<Hagfish>i do like the idea, though, that a package manager could check an append-only log, to ensure that the software you are downloading has been publicly announced (and hasn't been specially crafted to exploit you)
<Hagfish>of course a malicious update could contain a branch like "if MAC address == ...", but that should be hard to explain to an auditor
<xentrac>Hagfish: I recall that one of the Underhanded C Contest winners would falsify votes only on Wednesdays
<xentrac>because formatting a date with a Wednesday in it would overflow a buffer
<xentrac>the certificate transparency benefit sounds pretty significant
<Hagfish>i wonder what the limits of static analysis are in terms of security
<Hagfish>i like the fact that ecosystems are starting to think about making apps state up front which permissions they need
<Hagfish>obviously apps do that, and browser extensions, but i think Deno does that for javascript packages
<Hagfish>Endo is another (more experimental) technology that tries to give capability security to javascript modules
<Hagfish>and obviously there are attempts like SELinux and similar which try to apply this to existing desktop apps (somewhat awkwardly)
<Hagfish>just being able to say "the code in this library will never be able to start a new process, or access the network, or the filesystem" is a really useful primitive to have when pulling in a dependency
<Hagfish>developers probably need to get used to putting "guards" into their test suites, to detect if code is trying to exfiltrate data
<Hagfish>assert that no network connections are made, or unexpected files written to or read, when the feature/unit test suite is run
<Hagfish>i've read discussions of interesting theoretical approaches of code detecting when it is run in a production environment, versus in a test
<Hagfish>one of the things you need to lock down is access to the current time, so that a function can't become malicious after a certain date
<Hagfish>also not allowing access to randomness, otherwise it could execute its payload only one in a billion invocations
<Hagfish>these are all defences in depth that increase the cost to the attacker (and make it harder for someone to claim that a security issue is accidental)
<Hagfish>security doesn't have to be perfect, it just has to raise the cost of the attack above the value to the attacker
<xentrac>you can guarantee that sort of limitation either statically or dynamically
<xentrac>SELinux has a hard time because it's working at process granularity
<xentrac>while technically it's true that "security doesn't have to be perfect, it just has to raise the cost of the attack above the value to the attacker" nearly every inference you could make from this requires knowing both the cost of the attack and the value to the attacker, at least roughly
<xentrac>but it's easy to make errors of literally ten orders of magnitude in those estimates
<xentrac>because the same code may be safeguarding resources that are worth a microdollar or a teradollar, and an exploit, once developed, may be used against one device or against ten billion devices
<xentrac>so in general I am very skeptical of reasoning that invokes "defences in depth that increase the cost to the attacker"
<xentrac>the traditional term for such things is "snake oil security" or "security by obscurity". when it's all you've got, well, might as well make it good, but having actual Kerckhoffs-compliant security is a lot better
<xentrac>6