• [gentoo-dev] Current unavoidable use of xz utils in Gentoo

    From Eddie Chapman@21:1/5 to All on Sat Mar 30 04:10:01 2024
    Given what we've learnt in the last 24hrs about xz utilities, you could
    forgive a paranoid person for seriously considering getting rid entirely
    of them from their systems, especially since there are suitable
    alternatives available. Some might say that's a bit extreme, xz-utils
    will get a thorough audit and it will all be fine. But when a malicious
    actor has been a key maintainer of something as complex as a decompression utility for years, I'm not sure I could ever trust that codebase again.
    Maybe a complete rewrite will emerge, but I'm personally unwilling to
    continue using xz utils in the meantime for uncompressing anything on my systems, even if it is done by an unprivileged process.

    I see that many system package ebuilds unconditionally expect
    app-arch/xz-utils to be installed simply to be able to decompress the
    source archive in SRC_URI. So simply specifying -lzma on your system isn't going to get rid of it.

    No one could have been expected to foresee what's happened with xz-utils,
    but now that it's here, perhaps Gentoo (and other projects that do) should consider not relying on a single decompression algorithm for source
    archives, even just as an insurance against some other yet unknown
    disaster with one algorithm or another in future?

    And yes I'm sure there will be individual packages that currently
    absolutely need xz-utils installed during the build process, and one or
    two that absolutely have to have it available at runtime, but those
    bridges can be crossed as and when.

    Eddie

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From orbea@21:1/5 to Eddie Chapman on Sat Mar 30 04:50:01 2024
    On Sat, 30 Mar 2024 03:07:13 -0000
    "Eddie Chapman" <eddie@ehuk.net> wrote:

    Given what we've learnt in the last 24hrs about xz utilities, you
    could forgive a paranoid person for seriously considering getting rid entirely of them from their systems, especially since there are
    suitable alternatives available. Some might say that's a bit
    extreme, xz-utils will get a thorough audit and it will all be fine.
    But when a malicious actor has been a key maintainer of something as
    complex as a decompression utility for years, I'm not sure I could
    ever trust that codebase again. Maybe a complete rewrite will emerge,
    but I'm personally unwilling to continue using xz utils in the
    meantime for uncompressing anything on my systems, even if it is done
    by an unprivileged process.

    I see that many system package ebuilds unconditionally expect app-arch/xz-utils to be installed simply to be able to decompress the
    source archive in SRC_URI. So simply specifying -lzma on your system
    isn't going to get rid of it.

    No one could have been expected to foresee what's happened with
    xz-utils, but now that it's here, perhaps Gentoo (and other projects
    that do) should consider not relying on a single decompression
    algorithm for source archives, even just as an insurance against some
    other yet unknown disaster with one algorithm or another in future?

    And yes I'm sure there will be individual packages that currently
    absolutely need xz-utils installed during the build process, and one
    or two that absolutely have to have it available at runtime, but those bridges can be crossed as and when.

    Eddie



    I think this is an overreaction and we should wait for the dust to
    settle before making drastic disruptive changes.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich Freeman@21:1/5 to rdalek1967@gmail.com on Sat Mar 30 12:40:02 2024
    On Sat, Mar 30, 2024 at 3:06 AM Dale <rdalek1967@gmail.com> wrote:

    when I got to the part about it not likely to affect Gentoo, my level of concern dropped significantly. If this is still true, there's no need to be concerned.

    "not likely" is the best way to characterize this. The exploit has
    not been fully analyzed, and it could have additional malicious
    behavior, either designed by its author, or perhaps even unintended by
    its author.

    I just wanted to toss in that caveat, but agree that the defaults
    deployed in Gentoo seem the most sensible for general use. There is
    nothing magical about xz - ANY widely-used library could have
    something like this embedded in it, and the attacker exploited what
    they had access to in order to go after a configuration that was going
    to be widely deployed and reachable (xz+deb/rpm+systemd+openssh). If
    the attacker had an intended target that used gentoo+openrc and access
    to something in our supply chain, this could have been a vulnerability
    that only impacted Gentoo.

    I think the big lesson here is that FOSS continues to suffer from core dependencies that are challenged for resources, and that efforts to
    fix this have to constantly keep up with the changing landscape. xz
    is going on 15 years old, but I don't think it was nearly as commonly
    used until fairly recently.

    libz has been a pretty well-known source of security flaws for ages
    (granted, usually not intentional like this). It isn't too surprising
    that in both cases compression libraries were targeted, as these are
    so widely depended on.

    This is getting tangential, but part of me wonders if there is a
    better way to do authentication. Programs like ssh tend to run as
    root so that they can authenticate users and then fork and suid to the appropriate user. Could some OS-level facility be created to allow unprivileged processes to run the daemons and then as part of the authentication process they can have the OS accept a controlled and
    minimal set of data to create the process as the new user and hand
    over the connection? PAM already has a large amount of control over
    the authentication process, so it seems like we just need to change
    the security context that this runs in. That's just
    brainstorming-level thinking though - there could be obvious issues
    with this that just haven't occurred to me.

    --
    Rich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to Rich Freeman on Sat Mar 30 16:00:01 2024
    Rich, Duncan, Dale, orbea, you have to admit the situation with xz-utils
    is nothing like the typical scenario people usually worry about, where a
    bad actor manages to compromise a project and slip something into a widely
    used piece of software. No, this is the the bad actor *themselves* being a principal author of the software, working stealthily and in very
    sophisticated ways for years, to manoeuvrer themselves and their software
    into a position of trust in the ecosystem whereby they were almost able to
    pull off the mother of all security nightmares for the world. And many
    very smart people reviewed what they did and were fooled by them (which is
    no reflection on those people, it was just because the bad actor did a
    very, very good job of fooling them). I have to ask, if you still trust a codebase to be right at the heart of your system after that, what on earth would it take for you to start to feel uncomfortable??!!

    Sometimes, it's good when you're inside the house that is on fire, to
    *not* stand there and say to yourself "well the engineers who built this
    place must have built it to withstand a fire, I'm sure it will stop
    burning soon. And anyway, the fire brigade will be here soon, I'm sure it
    will all be fine". I'm not saying the world of OSS & Linux is on fire, of course not. This is a very isolated and rare situation with just 1 piece
    of software. No, I'm just using probably a probably bad analogy to make
    the following point: while almost all of the time a reasoned, "lets just
    calm down and think about this" approach is right, in some rare situations
    it is important to see a situation as serious as it and act accordingly.

    In this case, if I weigh up the benefits of using this piece of software
    versus another (relatively small gains in file size reduction, some gains
    in resource usage) against the risks of continuing to use it (and lets be realistic about those risks please rather than "I'm sure it will all be
    fine"), the risks are far greater.

    Note, I'm not advocating ripping xz-utils out of tree, all I'm saying is wouldn't it be nice if there were at least 2 alternatives to choose from?
    That doesn't have to be disruptive in any way, people who wish to continue using and trusting xz-utils should be able to continue to do so without
    any friction whatsoever.

    Rich Freeman wrote:
    On Sat, Mar 30, 2024 at 3:06 AM Dale <rdalek1967@gmail.com> wrote:


    when I got to the part about it not likely to affect Gentoo, my level
    of concern dropped significantly. If this is still true, there's no
    need to be concerned.

    "not likely" is the best way to characterize this. The exploit has
    not been fully analyzed, and it could have additional malicious behavior, either designed by its author, or perhaps even unintended by its author.

    I just wanted to toss in that caveat, but agree that the defaults
    deployed in Gentoo seem the most sensible for general use. There is
    nothing magical about xz - ANY widely-used library could have something
    like this embedded in it, and the attacker exploited what they had access
    to in order to go after a configuration that was going to be widely
    deployed and reachable (xz+deb/rpm+systemd+openssh). If the attacker had
    an intended target that used gentoo+openrc and access to something in our supply chain, this could have been a vulnerability that only impacted
    Gentoo.


    I think the big lesson here is that FOSS continues to suffer from core dependencies that are challenged for resources, and that efforts to fix
    this have to constantly keep up with the changing landscape. xz is going
    on 15 years old, but I don't think it was nearly as commonly used until fairly recently.

    libz has been a pretty well-known source of security flaws for ages
    (granted, usually not intentional like this). It isn't too surprising
    that in both cases compression libraries were targeted, as these are so widely depended on.

    This is getting tangential, but part of me wonders if there is a
    better way to do authentication. Programs like ssh tend to run as root so that they can authenticate users and then fork and suid to the appropriate user. Could some OS-level facility be created to allow unprivileged processes to run the daemons and then as part of the authentication
    process they can have the OS accept a controlled and minimal set of data
    to create the process as the new user and hand over the connection? PAM already has a large amount of control over the authentication process, so
    it seems like we just need to change the security context that this runs
    in. That's just brainstorming-level thinking though - there could be
    obvious issues with this that just haven't occurred to me.

    --
    Rich





    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to Eddie Chapman on Sat Mar 30 16:10:01 2024
    On Sat, 2024-03-30 at 14:57 +0000, Eddie Chapman wrote:
    Note, I'm not advocating ripping xz-utils out of tree, all I'm saying is wouldn't it be nice if there were at least 2 alternatives to choose from? That doesn't have to be disruptive in any way, people who wish to continue using and trusting xz-utils should be able to continue to do so without
    any friction whatsoever.

    So, you're basically saying we should go out of our way, recompress all distfiles using two alternative compression formats, increase mirror
    load four times and add a lot of complexity to ebuilds, right?

    --
    Best regards,
    Michał Górny


    -----BEGIN PGP SIGNATURE-----

    iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmYIKYESHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQOKTIH/icsMrYvTP7q+lEt5wehBlSfTAVUDI4/ GeRcin7z2eGQT5JxmJsgxMpBZAS4AbOgWOzzo9FEkMWbUVovreH9JsGX00HCZk2j M3NQvZC6LUJDrnWDntMRNMfpSpjr92BsGaKAawAbpnwrjuZv4VMxh/jGjcxPIw4m 7MqJtFZOU/7j3IZ0FYM0zU17obr88Mk2gf77S2f+J9SSlNpjCZRP/L0EEozp0IA8 b1jHogPFY2kOCXNufjtpTwfSbQcApEunG1snYkLc0Yczdj7pMnd1Zxr6JzNcgiz6 iXiC5pIClUGLBJznQ5X36LnvLWBOK6WEdtSfIbxGUAm7bXyy5TdRkfE=
    =1fUq
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to All on Sat Mar 30 16:20:02 2024
    Michał Górny wrote:
    On Sat, 2024-03-30 at 14:57 +0000, Eddie Chapman wrote:

    Note, I'm not advocating ripping xz-utils out of tree, all I'm saying
    is wouldn't it be nice if there were at least 2 alternatives to choose
    from? That doesn't have to be disruptive in any way, people who wish to
    continue using and trusting xz-utils should be able to continue to do so
    without any friction whatsoever.

    So, you're basically saying we should go out of our way, recompress all distfiles using two alternative compression formats, increase mirror load four times and add a lot of complexity to ebuilds, right?

    --
    Best regards,
    Michał Górny


    Yes that's a very good point, that was something I was wondering in
    weighing up both sides, what the costs would be practically, as I don't
    know the realities of running Gentoo infrastructure. And maybe the costs
    is just too high of a price to pay.

    I wonder if increased use of git repos rather than distributed tarballs
    could be part of a solution to those issues, although that could put quite
    a storage burden on every user. Unless they were all shallow git pulls and
    the user could optionally choose to tar up the git directory after clone
    with compression. But yes granted then there is even more ebuild
    complexity.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From orbea@21:1/5 to mgorny@gentoo.org on Sat Mar 30 16:30:01 2024
    On Sat, 30 Mar 2024 16:02:25 +0100
    Michał Górny <mgorny@gentoo.org> wrote:

    On Sat, 2024-03-30 at 14:57 +0000, Eddie Chapman wrote:
    Note, I'm not advocating ripping xz-utils out of tree, all I'm
    saying is wouldn't it be nice if there were at least 2 alternatives
    to choose from? That doesn't have to be disruptive in any way,
    people who wish to continue using and trusting xz-utils should be
    able to continue to do so without any friction whatsoever.

    So, you're basically saying we should go out of our way, recompress
    all distfiles using two alternative compression formats, increase
    mirror load four times and add a lot of complexity to ebuilds, right?


    How would Gentoo even recompress all .xz distfiles if xz-utils is not
    even in the repo? And this will certainly be a reoccurring theme...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich Freeman@21:1/5 to eddie@ehuk.net on Sat Mar 30 16:20:02 2024
    On Sat, Mar 30, 2024 at 10:57 AM Eddie Chapman <eddie@ehuk.net> wrote:

    No, this is the the bad actor *themselves* being a
    principal author of the software, working stealthily and in very sophisticated ways for years, to manoeuvrer themselves and their software into a position of trust in the ecosystem whereby they were almost able to pull off the mother of all security nightmares for the world.

    This is entirely speculative at this point. It isn't certain that the
    author is the one behind the exploit, and if they were, it is not
    known for how long their intentions were malicious, or even what their motivations were. It is also unclear what pseudonymous accounts with
    what projects are associated with the attacker.

    You could end up being right, but it probably makes sense to at least
    give things a few days for more facts to become available, before
    making decisions to retool the entire distro.

    I think the bigger challenge is what could have been done to prevent
    this sort of problem in the first place. There are so many projects
    that end up with code running as root that have one or two people
    taking care of them, and if somebody does the work to become one of
    those maintainers, there aren't many people looking out for problems.

    I think one thing that would help here is for distros to have better
    ways to ensure that the code in the scm matches the code in the
    tarball. It is pretty common for releases to be manipulated in some
    way (even if only to gpg sign them, but often to switch from commit
    IDs to version numbers and so on), and that can be a place where stuff
    gets added. That still says nothing about obfuscated code, which this
    also involved.

    --
    Rich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to Eddie Chapman on Sat Mar 30 16:30:01 2024
    On Sat, 2024-03-30 at 15:17 +0000, Eddie Chapman wrote:
    Michał Górny wrote:
    On Sat, 2024-03-30 at 14:57 +0000, Eddie Chapman wrote:

    Note, I'm not advocating ripping xz-utils out of tree, all I'm saying
    is wouldn't it be nice if there were at least 2 alternatives to choose from? That doesn't have to be disruptive in any way, people who wish to continue using and trusting xz-utils should be able to continue to do so without any friction whatsoever.

    So, you're basically saying we should go out of our way, recompress all distfiles using two alternative compression formats, increase mirror load four times and add a lot of complexity to ebuilds, right?

    --
    Best regards,
    Michał Górny


    Yes that's a very good point, that was something I was wondering in
    weighing up both sides, what the costs would be practically, as I don't
    know the realities of running Gentoo infrastructure. And maybe the costs
    is just too high of a price to pay.

    I wonder if increased use of git repos rather than distributed tarballs
    could be part of a solution to those issues, although that could put quite
    a storage burden on every user. Unless they were all shallow git pulls and the user could optionally choose to tar up the git directory after clone
    with compression. But yes granted then there is even more ebuild
    complexity.


    Should we convert git repositories to Mercurial and Bazaar too, to avoid relying too much on a single tool?

    --
    Best regards,
    Michał Górny


    -----BEGIN PGP SIGNATURE-----

    iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmYIL+wSHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQO7tUH/3Jq0+idBl92WPVPDGETOt38Fj0Q7FhF O4AVJYZ2NL3R3AH3AGwiQat2LwWneIspshAHn8/i1Lf+xhYjDR68z6u3iIZFZmSp 8iTLueFC68OlhW9pxB93XYBLkbUqYj9CPwhuUmqzJqPEWZf36fgNnB0kiDBbGBYO 1LktDaEKZ9fxGqplbBL8HZ0h7OkHebnqwB7wA1CpGrV8SaHA+8tTusSD8DL/VabG 8szddBOlrEwS/2PUJr947urAZXK/BDooPSPlZ2auSrk2lKHKtFUC8/KdReblPV7P Whl7mrZbIyV2i88Yin83HQzmsjPQPccZRleTPgG1WQ9o2ZrMOVYnSKQ=
    =JsdT
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to All on Sat Mar 30 17:00:02 2024
    Michał Górny wrote:
    On Sat, 2024-03-30 at 15:17 +0000, Eddie Chapman wrote:

    Michał Górny wrote:

    On Sat, 2024-03-30 at 14:57 +0000, Eddie Chapman wrote:


    Note, I'm not advocating ripping xz-utils out of tree, all I'm
    saying is wouldn't it be nice if there were at least 2 alternatives
    to choose from? That doesn't have to be disruptive in any way,
    people who wish to continue using and trusting xz-utils should be
    able to continue to do so without any friction whatsoever.

    So, you're basically saying we should go out of our way, recompress
    all distfiles using two alternative compression formats, increase
    mirror load four times and add a lot of complexity to ebuilds, right?

    --
    Best regards,
    Michał Górny



    Yes that's a very good point, that was something I was wondering in
    weighing up both sides, what the costs would be practically, as I don't
    know the realities of running Gentoo infrastructure. And maybe the
    costs is just too high of a price to pay.

    I wonder if increased use of git repos rather than distributed tarballs
    could be part of a solution to those issues, although that could put
    quite a storage burden on every user. Unless they were all shallow git
    pulls and the user could optionally choose to tar up the git directory
    after clone with compression. But yes granted then there is even more
    ebuild complexity.


    Should we convert git repositories to Mercurial and Bazaar too, to avoid relying too much on a single tool?

    --
    Best regards,
    Michał Górny


    I sense that question may have been slightly in jest :-) At least I hope
    so as it could also be interpreted as an attempt at ridicule. I'll take it
    as the former. In case you are seriously asking; of course not, that's
    totally unnecessary. The objective is simply to obtain the upstream source
    code intact. We don't need whatever version control of their source they
    are using, which of course is the whole point of fetching distributed
    tarballs. My suggestion of git pulls is just to address your point of
    resource usage on gentoo infra, it reduces the need to store binary dist
    files. I've also heard some argue that relying on distributed tarballs is
    part of the overall problem and what the bad actor was taking advantage
    of. They may have a point.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to Rich Freeman on Sat Mar 30 18:20:01 2024
    Rich Freeman wrote:
    On Sat, Mar 30, 2024 at 10:57 AM Eddie Chapman <eddie@ehuk.net> wrote:

    No, this is the the bad actor *themselves* being a
    principal author of the software, working stealthily and in very
    sophisticated ways for years, to manoeuvrer themselves and their
    software into a position of trust in the ecosystem whereby they were
    almost able to pull off the mother of all security nightmares for the
    world.

    This is entirely speculative at this point. It isn't certain that the
    author is the one behind the exploit, and if they were, it is not known for how long their intentions were malicious, or even what their motivations were. It is also unclear what pseudonymous accounts with what projects
    are associated with the attacker.

    For the purposes of this discussion I'm not speculating nor interested in
    *who* is behind this, or whether or whoever committed commits was a victim
    of account takeover. Certain key actions that have been taken over time by whoever is/was behind this do not require any speculation, they speak for themselves, and are clearly malicious. There is no need to wait for
    anything more to be revealed to be able to plainly see how bad it is.

    While we wait and see, huge numbers of people might be suffering real and serious consequences of continued use of xz-utils. The consequences may be completely hidden, if you go by how well the bad actor here has managed to
    hide what they have done. If you are following developments you can see
    right now with your own eyes how incredibly difficult it is for our
    smartest people to unravel and pick through what this actor has done. To
    have faith that everything malicious that the perpetrator has done will be unravelled over time by our collective smart minds by going over the
    codebase with a fine tooth-comb puts far too much faith in human beings
    and takes unnecessary risks for something that is not worth that risk when there are alternatives. If you were looking for a compression tool for a
    new project, why would anyone sane take such risks for such little gain?
    You just wouldn't. Of course the reason there is hesitancy is because xz
    has become so deeply entrenched in our world, it's become almost too hard
    to extrapolate ourselves from it. I dare say the attacker realised this
    and probably sought to take advantage of that fact.

    However, I do acknowledge and realise the significant practical
    difficulties that would be involved in making xz-utils something optional within Gentoo.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to Eddie Chapman on Sun Mar 31 00:50:01 2024
    Eddie Chapman wrote:
    Michał Górny wrote:

    On Sat, 2024-03-30 at 14:57 +0000, Eddie Chapman wrote:


    Note, I'm not advocating ripping xz-utils out of tree, all I'm saying
    is wouldn't it be nice if there were at least 2 alternatives to
    choose from? That doesn't have to be disruptive in any way, people who
    wish to continue using and trusting xz-utils should be able to
    continue to do so without any friction whatsoever.

    So, you're basically saying we should go out of our way, recompress all
    distfiles using two alternative compression formats, increase mirror
    load four times and add a lot of complexity to ebuilds, right?

    --
    Best regards,
    Michał Górny

    Yes that's a very good point, that was something I was wondering in
    weighing up both sides, what the costs would be practically, as I don't
    know the realities of running Gentoo infrastructure. And maybe the costs
    is just too high of a price to pay.

    I wonder if increased use of git repos rather than distributed tarballs
    could be part of a solution to those issues, although that could put quite
    a storage burden on every user. Unless they were all shallow git pulls
    and the user could optionally choose to tar up the git directory after
    clone with compression. But yes granted then there is even more ebuild complexity.


    I've been thinking a little about how Gentoo without
    compression/decompression of distfiles could work, as a feature, without
    any impact on the existing world order, and no increased stress on Gentoo infra. I was wondering how palatable the following idea might be to others
    ...

    The basis of the idea is to add a feature to Portage which would let a
    person optionally indicate in make.conf that whenever a path in SRC_URI resolves to a file with a compression extension (.gz, .bz2, .xz, etc),
    that Portage should attempt to fetch it without the compression extension.

    So as an example, lets take sys-apps/pciutils, which currently has: SRC_URI="https://mj.ucw.cz/download/linux/pci/${P}.tar.gz"

    the feature would tell portage to simply translate this to: SRC_URI="https://mj.ucw.cz/download/linux/pci/${P}.tar"

    So perhaps it could be a flag that goes in FEATURES= called something like "strip_dist_comp" or something similar, or maybe someone has a better idea about that.

    Now, of course, I'm not proposing that Gentoo infra keeps uncompressed
    versions of distfiles. So by default Portage would encounter a 404 error
    when it tries to fetch the uncompressed file from Gentoo mirrors.

    However, this feature would then pave the way for a person to then
    configure Portage to fetch distfiles from their own server as well as
    Gentoo mirrors, and that person could then keep their own uncompressed
    versions of distfiles on their server, for however many and whichever distfiles they might wish to keep there, as the compressed version would
    get fetched from a Gentoo mirror if the uncompressed version is not there.
    Such a person would then have to obtain or create their own uncompressed distfile independently.

    A caveat of this solution would be that one would have to disable checksum verification (and gpg checks?) for this to work, as of course there would
    be no checksum for the uncompressed version in the Manifest, and Gentoo
    infra certainly should not be expected to especially uncompress each
    distfile once in order to generate an extra checksum for the Manifest. In
    fact I'd consider than undesirable, as anyone paranoid enough to want to
    do this would not trust such a checksum anyway, since it would be a
    checksum of a file that has been compressed at source and then
    decompressed on Gentoo infra, potentially introducing vulnerabilities.
    However, the lack of checksum is not a problem for someone who wants to
    keep distfiles on their own server, as such a person can also be
    responsible themselves for first verifying whatever they put on there, and
    for keeping said server secured from tampering.

    This seems to me to be something that would probably be relatively straightforward to implement within Portage, maybe with just a few lines
    around the python code that fetches the SRC_URI, and zero extra work or resources required from Gentoo infra.

    I'd consider it a feature for anyone who wants to eliminate a whole
    potential class of vulnerabilities that may or may not be present either
    now or in future in compression algorithm tools. Surely that would be a
    nice feature to have for some folk?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to Eddie Chapman on Sun Mar 31 03:30:01 2024
    "Eddie Chapman" <eddie@ehuk.net> writes:

    Given what we've learnt in the last 24hrs about xz utilities, you could forgive a paranoid person for seriously considering getting rid entirely
    of them from their systems, especially since there are suitable
    alternatives available. Some might say that's a bit extreme, xz-utils
    will get a thorough audit and it will all be fine. But when a malicious
    actor has been a key maintainer of something as complex as a decompression utility for years, I'm not sure I could ever trust that codebase again.
    Maybe a complete rewrite will emerge, but I'm personally unwilling to continue using xz utils in the meantime for uncompressing anything on my systems, even if it is done by an unprivileged process.

    My own view is that there'll be a time for introspection, reflection,
    and discussion of changes once the crisis is over. We're not there yet.

    But I don't think us fetching several variants of compression formats
    and testing & verifying all of them is feasible.

    I also think it's (and I don't mean this derogatorily towards you) naive
    for people in general to suggest that this is really specific to xz at
    all. Unfortunately, there's many. many projects this could've happened to.


    I see that many system package ebuilds unconditionally expect app-arch/xz-utils to be installed simply to be able to decompress the
    source archive in SRC_URI. So simply specifying -lzma on your system isn't going to get rid of it.

    No one could have been expected to foresee what's happened with xz-utils,
    but now that it's here, perhaps Gentoo (and other projects that do) should consider not relying on a single decompression algorithm for source
    archives, even just as an insurance against some other yet unknown
    disaster with one algorithm or another in future?

    I think there's real discussions to be had about relying on dist
    tarballs and such but I don't really see how we could try to avoid
    compression algorithms.


    And yes I'm sure there will be individual packages that currently
    absolutely need xz-utils installed during the build process, and one or
    two that absolutely have to have it available at runtime, but those
    bridges can be crossed as and when.

    Eddie

    thanks,
    sam

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to Eli Schwartz on Sun Mar 31 13:20:02 2024
    Eli Schwartz wrote:
    On 3/29/24 11:07 PM, Eddie Chapman wrote:

    Given what we've learnt in the last 24hrs about xz utilities, you could
    forgive a paranoid person for seriously considering getting rid
    entirely of them from their systems, especially since there are suitable
    alternatives available. Some might say that's a bit extreme, xz-utils
    will get a thorough audit and it will all be fine. But when a
    malicious actor has been a key maintainer of something as complex as a
    decompression utility for years, I'm not sure I could ever trust that
    codebase again. Maybe a complete rewrite will emerge, but I'm personally
    unwilling to continue using xz utils in the meantime for uncompressing
    anything on my systems, even if it is done by an unprivileged process.


    It suffices to downgrade to the version of xz before a social
    engineering attack by a malicious actor to gain maintainership of the xz project.

    Have you been linked to this yet? https://www.mail-archive.com/xz-devel@tukaani.org/msg00571.html

    --
    Eli Schwartz


    Yes I saw that yesterday. It only increased my level of concern about the project ten-fold rather than decreased it, particularly because of "he has
    been helping a lot off-list and is practically a co-maintainer already".
    It's not possible to just downgrade to before the bad actor's commits and
    then feel fine about things because they have been heavily involved
    offline even before commit access. We'll never know how much and when
    because I also cannot trust what the apparently innocent maintainer (who
    is most likely a victim here as well) might say about that now. Not
    because of anything about them (I don't know them or anything about them),
    just because of what has happened, there is too much of an incentive for
    that person to now downplay the involvement of the bad actor. I'm sorry
    if that may seem harsh but, in my view, this situation is so severe it
    warrants it. The world is facing threats from very sophisticated and
    capable bad actors, mostly criminal organisations. If people here want to
    run systems that are actually secure and also have other people trust
    their stewardship, then things need to be taken seriously and high
    standards need to be maintained. Especially where it is a tool that is not super essential (it has just become heavily entrenched) and where there
    are great alternatives, there should be no hesitancy to jettison a project
    that has been infiltrated to such an extent as we have seen here (this is
    far beyond just some devs workstation got compromised and there was a few
    bad commits made it into the repo). At the moment there is far too much of
    a cavalier attitude about the whole thing being shown by too many,
    including here I'm sad to see.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From stefan11111@21:1/5 to Eli Schwartz on Sun Mar 31 13:40:01 2024
    On 2024-03-31 01:33, Eli Schwartz wrote:
    On 3/29/24 11:07 PM, Eddie Chapman wrote:
    Given what we've learnt in the last 24hrs about xz utilities, you
    could
    forgive a paranoid person for seriously considering getting rid
    entirely
    of them from their systems, especially since there are suitable
    alternatives available. Some might say that's a bit extreme, xz-utils
    will get a thorough audit and it will all be fine. But when a
    malicious
    actor has been a key maintainer of something as complex as a
    decompression
    utility for years, I'm not sure I could ever trust that codebase
    again.
    Maybe a complete rewrite will emerge, but I'm personally unwilling to
    continue using xz utils in the meantime for uncompressing anything on
    my
    systems, even if it is done by an unprivileged process.


    It suffices to downgrade to the version of xz before a social
    engineering attack by a malicious actor to gain maintainership of the
    xz
    project.

    Have you been linked to this yet? https://www.mail-archive.com/xz-devel@tukaani.org/msg00571.html

    Wed, 29 Jun 2022 13:07:07 -0700

    This is 2 years ago.

    Had I seen someone say that a bad actor would spend years gaining the
    trust of FOSS
    project maintainers in order to gain commit access and introduce such sophisticated
    back doors, I would have told them to take their meds.
    This is insane.

    Not even this seems impossible anymore: https://01.me/en/2014/11/insert-backdoor-into-compiler/

    If this happened to something like firefox, I don't think anyone would
    have found out.
    No one bats an eye if a website loads 0.5s longer.

    --
    Linux-gentoo-x86_64-Intel-R-_Core-TM-_i5-7400_CPU_@_3.00GHz

    COMMON_FLAGS="-O3 -pipe -march=native -fno-stack-protector
    -ftree-vectorize -ffast-math -funswitch-loops -fuse-linker-plugin -flto -fdevirtualize-at-ltrans -fno-plt -fno-semantic-interposition -falign-functions=64 -fgraphite-identity -floop-nest-optimize"

    USE="-* git verify-sig rsync-verify man alsa X grub ssl ipv6 lto
    libressl olde-gentoo asm native-symlinks threads jit jumbo-build minimal
    strip system-man"

    INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus
    /lib/udev /usr/share/icons /usr/share/applications
    /usr/share/gtk-3.0/emoji"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Matt Jolly@21:1/5 to Eddie Chapman on Sun Mar 31 14:10:01 2024
    Hi Eddie,

    On 31/3/24 21:13, Eddie Chapman wrote:
    At the moment there is far too much of
    a cavalier attitude about the whole thing being shown by too many,
    including here I'm sad to see.

    It's obvious that this is something that you are very worried about, but
    I think that you need to take a deep breath and relax a little. I have
    not seen a cavalier attitude towards this issue.

    What I see instead are developers who have made an initial assessment
    and disclosure, have taken some actions to mitigate the severity of the
    issue, and are carefully continuing their investigations (over a major
    holiday in large parts of the world) so that they can issue sane
    responses to actual threats, and not a knee-jerk response like 'Gentoo
    should re-encode all xzs in other formats' which, as was discussed
    above, adds significant complexity for no real benefit.

    I've seen from your previous emails to the list that you know what
    paragraphs are and how to use them to break up your content into
    digestible chunks. Please continue using them - it makes it
    significantly easier to respond to your ideas and gives off an aura of professionalism that you will need if you want your concerns to be taken seriously and addressed directly.

    Cheers,

    Matt

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to Matt Jolly on Mon Apr 1 10:00:01 2024
    Matt Jolly wrote:
    Hi Eddie,

    On 31/3/24 21:13, Eddie Chapman wrote:

    At the moment there is far too much of
    a cavalier attitude about the whole thing being shown by too many,
    including here I'm sad to see.

    It's obvious that this is something that you are very worried about, but
    I think that you need to take a deep breath and relax a little. I have
    not seen a cavalier attitude towards this issue.

    No, I don't need to do that. I don't appreciate suggestions to "just calm down", especially when I'm not being hysterical. Your comment to me just reinforces what I mean when I say there is far too much of a cavalier
    attitude.

    What I see instead are developers who have made an initial assessment
    and disclosure, have taken some actions to mitigate the severity of the issue, and are carefully continuing their investigations (over a major holiday in large parts of the world) so that they can issue sane responses
    to actual threats, and not a knee-jerk response like 'Gentoo should
    re-encode all xzs in other formats' which, as was discussed above, adds significant complexity for no real benefit.

    I stand by and reiterate my view that there is far too much of a cavalier attitude towards the matter in general out there including here in Gentoo.
    But not in particular here, it is everywhere where this is being discussed
    at the moment.

    But please think a little about what I mean when I say a "cavalier
    attitude", and what it does NOT mean. It does not mean that a lot of
    people are not working very hard to analyse and learn about this issue and taking steps to try to mitigate it. It does not mean people are not well intentioned, everyone wants to fix this. I have great appreciation and admiration for a lot of fantastic work I see going on including by people involved in Gentoo. But I believe it will only really be beneficial in the
    far future, not right now.

    How are people in general being cavalier? By trying desperately to salvage
    the situation with xz-utils above all else, by focussing too much on how
    the original author of xz-utils and rallying round them (absolutely a
    great thing to do but has absolutely nothing to do with what is good or
    not good for users as a whole right now), there is too much clouded
    judgment. There is more I could argue about why I use that word, but I
    know by now that I am going against the grain of what the majority want
    and it's not what people want to hear so I'm done, this discussion is now
    a waste of everyone's time here including mine.

    I've seen from your previous emails to the list that you know what
    paragraphs are and how to use them to break up your content into digestible chunks. Please continue using them - it makes it significantly easier to respond to your ideas and gives off an aura of professionalism that you
    will need if you want your concerns to be taken seriously and addressed directly.

    Yes you are right, I do apologise for not using paragraphs in my last
    message, I slipped there, thanks for pointing it out. I've tried to do so
    in this message.

    Cheers,

    Matt

    And I should make more of an effort to sign off, it's a little more
    friendly :-)

    Regards,
    Eddie

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to All on Sat Apr 6 09:50:14 2024
    Michał Górny wrote:
    On Mon, 2024-04-01 at 08:57 +0100, Eddie Chapman wrote:

    I stand by and reiterate my view that there is far too much of a
    cavalier attitude towards the matter in general out there including here
    in Gentoo. But not in particular here, it is everywhere where this is
    being discussed at the moment.

    I would like to point out that the xz/sshd issue was primarily a social
    one, not a technical one.

    The primary problem in open source today isn't bad code. It's projects relying on overburdened, burned out maintainers. And on top of that, users who are complaining, demanding, outright hostile or primarily contributing
    by walls of text on a mailing lists, that bring nothing to discussion
    except for furthering the burnout of open source developers who are
    actually trying to do something.

    Think about that.


    --
    Best regards,
    Michał Górny


    I'm sorry for having contributed to your burnout. I have a lot of respect
    for you personally Michał, the quality of your contributions to Gentoo are outstanding, and have to admit I've often felt a little worried for you
    with the amount of work you do. I don't know you at all, I hope you don't
    mind me saying that. Don't worry I think it's quite unlikely I'll bring
    any new concerns to this list again in future, I'll certainly think twice
    about it.

    regards,
    Eddie

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to Eli Schwartz on Sat Apr 6 09:50:17 2024
    Eli Schwartz wrote:
    On 4/3/24 11:30 AM, Eddie Chapman wrote:

    Just to report I've been able to remove app-arch/xz-utils from my own
    workstation, with 2412 packages installed and running kde. I'm going to
    roll it out to my other gentoo systems which have a lot less stuff on
    them so am confident will be fine. It's not completely trivial but not
    as difficult as I imagined it to be, certainly something an advance
    Gentoo
    user could do if they wanted, with instructions. It does involve a
    relatively small hack and functionality previously provided by xz-utils
    is replaced by app-arch/p7zip.


    I'd just like to clarify my previous posts: what you're describing here
    is neat and productive and valid to my eyes. Actually, I wish this had been the topic of the *first* post in this thread. :)

    Replacing implementations has several great uses. There's some prior art
    in make.conf, but it doesn't go far enough:

    PORTAGE_BZIP2_COMMAND
    BINPKG_COMPRESS
    BINPKG_COMPRESS_FLAGS


    Disregarding the security component entirely, one might wish to use pixz
    or pigz instead of the default programs. Why not 7zip as well?

    One of my emails elsewhere in this thread (easy to miss in a long thread,
    I know) I discussed pixz, pigz and 7zip. The former two were not suitable
    for me as both rely on xz utils. However I will probably switch from p7zip
    to the latest upstream 7zip in the near future, for reasons discussed in
    that email.

    In terms of security, this suggests an easy and simple way both to allow users to depclean xz-utils without sacrificing the ability to install packages using *.tar.xz sources, and for Gentoo to roll out an update that would do this distribution-wide if necessary via a trivial configuration change.

    https://dev.gentoo.org/~ulm/pms/head/pms.html#section-12.3.15 may need updating to allow this. But it seems very valid to propose doing exactly that. I am not sure why it specifies e.g. "must ensure that GNU gzip" with heavy ties to implementations, when it doesn't specify such for
    compression.

    That would certainly be a nice improvement for all users if it were ever
    to come to pass.

    I'm guessing what you did was override/hook the unpack phase helper
    function and divert it to 7zip instead. ;) It would be interesting to have actual hooks for that instead.

    Yes it is in the unpack phase where emerge calls /usr/bin/xz mostly. In
    fact I didn't have to touch emerge/portage, it was more crude, I
    uninstalled app-arch/xz-utils (and put it in /etc/portage/profile/package.provided) and replaced /usr/bin/xz with a
    bash script to behave like what the unpack phase was expecting, but using /usr/lib64/p7zip/7za to do the decompression.

    However, I need to do some more work on this "wrapper" (though it's more
    than a wrapper) as I found one package where xz is called from the install phase and my script doesn't handle that yet it just throws an error for anything other than the unpack phase case (which is 99.9 percent of
    packages).

    But ultimately doing something along the lines of what you suggest instead would of course be much better than this dirty hack (though it works just
    fine for me for now).

    Since there appears to be some interest I'll put together a single email
    to the list later today detailing everything, as I needed to do more
    things overall in addition to replacing /usr/bin/xz.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to Eddie Chapman on Sat Apr 6 09:50:29 2024
    On Mon, 2024-04-01 at 08:57 +0100, Eddie Chapman wrote:
    I stand by and reiterate my view that there is far too much of a cavalier attitude towards the matter in general out there including here in Gentoo. But not in particular here, it is everywhere where this is being discussed
    at the moment.

    I would like to point out that the xz/sshd issue was primarily a social
    one, not a technical one.

    The primary problem in open source today isn't bad code. It's projects
    relying on overburdened, burned out maintainers. And on top of that,
    users who are complaining, demanding, outright hostile or primarily contributing by walls of text on a mailing lists, that bring nothing to discussion except for furthering the burnout of open source developers
    who are actually trying to do something.

    Think about that.

    --
    Best regards,
    Michał Górny


    -----BEGIN PGP SIGNATURE-----

    iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmYKyuwSHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQOv3QH/iP1xyocfaBO569R1dZzdUhNZajnEGTY E5ymBk4hjzE9IfxS9CiSX4wYbpzGXLBiSGEc/g/2poJH/1UW90q0tk4n7oNeGHBr ZMTC3oVb9ksQNLMScVJjKldBckdhQdJlV49JtdgoT2DWXCW/C0p1RdgjRiGOQgDF GUU22v/y0nPIXVCFXIlxaFJrkrkSO/QfhW/2tXtMjPPWYptYdtBdcGWnhzVxZUM9 ZGMOQiU13NKxwxKFuBEvCokUaJuTCs9GOWNj8GiwdHqtIKEmnR8uosH+7ZMVTYPa S8bbVkN/RbJjifAWLJagZ6d4qMKaFtqLpIQ7hRY6s/GfSDkxq0h7M40=
    =Ojuk
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?K=C3=A9vin_GASPARD_DE_REN@21:1/5 to All on Sat Apr 6 09:50:21 2024
    Thanks for clarifying that, it wasn't clear to me when I read the
    earlier e-mail.

    Personally I think the long term solution is to identify critical code
    bases that have a low bus factor before the bad actors do and make a concentrated community effort to help audit and maintain these code
    bases.

    Hi,

    I hope this is not a stupid suggestion, that is also my first mail here
    so if something does not suits habits feel free to tell me please, but
    after reading the whole topic here I did not find this suggestion.

    It’s merely a proposition out of my mind, also something I know very
    little about.

    ---

    I read Linus T. speaking about usage of AI nowadays, in the IT field and stating that is an awful idea to write code with it (at least, for now)…
    But not to ask an AI to read the code and try to found by this way
    security holes, bad habits, bugs and such.

    Again, my skill and knowledge about AI, specially nowadays, is very
    small. But would take it lot of works to sets an AI to simple «read»
    codes to look for undesired stuff ? That won’t even modify anything,
    merely says : «Ah, found something weird, **here**.». Maybe, properly configured, it would have detected this social-hacking. Maybe not.

    Since programming is a very hard works, specially when it’s about
    security and bug, I also have very poor programing skill, but since the
    whole purpose of a computer and it’s set of software is to do what an
    human could NOT do properly (like being attentives while reading dozens
    of hundreds line of code…) and automate stuff, it *seems* to perfectly
    suits this need.

    I guess the p
  • From Sam James@21:1/5 to Eli Schwartz on Sat Apr 6 09:50:37 2024
    Eli Schwartz <eschwartz93@gmail.com> writes:

    On 4/3/24 11:30 AM, Eddie Chapman wrote:
    Just to report I've been able to remove app-arch/xz-utils from my own
    workstation, with 2412 packages installed and running kde. I'm going to
    roll it out to my other gentoo systems which have a lot less stuff on them >> so am confident will be fine. It's not completely trivial but not as
    difficult as I imagined it to be, certainly something an advance Gentoo
    user could do if they wanted, with instructions. It does involve a
    relatively small hack and functionality previously provided by xz-utils is >> replaced by app-arch/p7zip.


    I'd just like to clarify my previous posts: what you're describing here
    is neat and productive and valid to my eyes. Actually, I wish this had
    been the topic of the *first* post in this thread. :)

    Completely agreed. We just prefer shorter text and focusing on technical changes.

    This sounds fun!

    [...]

    thanks,
    sam

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From orbea@21:1/5 to Kenton Groombridge on Sat Apr 6 09:51:00 2024
    On Mon, 1 Apr 2024 12:01:13 -0400
    Kenton Groombridge <concord@gentoo.org> wrote:

    On 24/04/01 08:40AM, orbea wrote:
    On Mon, 1 Apr 2024 11:14:15 -0400
    Kenton Groombridge <concord@gentoo.org> wrote:

    On 24/03/31 12:13PM, Eddie Chapman wrote:
    Eli Schwartz wrote:
    On 3/29/24 11:07 PM, Eddie Chapman wrote:

    Given what we've learnt in the last 24hrs about xz utilities,
    you could forgive a paranoid person for seriously considering
    getting rid entirely of them from their systems, especially
    since there are suitable alternatives available. Some might
    say that's a bit extreme, xz-utils will get a thorough audit
    and it will all be fine. But when a malicious actor has been
    a key maintainer of something as complex as a decompression
    utility for years, I'm not sure I could ever trust that
    codebase again. Maybe a complete rewrite will emerge, but
    I'm personally unwilling to continue using xz utils in the
    meantime for uncompressing anything on my systems, even if
    it is done by an unprivileged process.


    It suffices to downgrade to the version of xz before a social engineering attack by a malicious actor to gain
    maintainership of the xz project.

    Have you been linked to this yet? https://www.mail-archive.com/xz-devel@tukaani.org/msg00571.html

    --
    Eli Schwartz


    Yes I saw that yesterday. It only increased my level of concern
    about the project ten-fold rather than decreased it,
    particularly because of "he has been helping a lot off-list and
    is practically a co-maintainer already".



    I think it's important to realize that this could have potentially happened to any number of various open source projects, not just xz-utils. Simply ripping it out and replacing it is not enough to
    prevent these kinds of issues from happening in the future.

    There is a major shifting of perspectives as a result of this
    unfortunate compromise. Right now there are serious considerations
    about banning (or otherwise auditing) binary blobs in some
    projects. There are talks about banning the use of older build
    systems like autotools in favor of ones more easily readable and auditable.

    Talk about throwing the baby out with the bathwater...


    Let's not shoot the messenger here. :)

    I cited this specific example to highlight the shared intent behind
    positive changes to auditing code not just in the program but also its
    build system. I didn't mean to imply that this was a great solution.

    Thanks for clarifying that, it wasn't clear to me when I read the
    earlier e-mail.

    Personally I think the long term solution is to identify critical code
    bases that have a low bus factor before the bad actors do and make a concentrated community effort to help audit and maintain these code
    bases.


    Its fully possible to write autotools build systems which are simple
    and easy to audit. Depending on what blob does it may be far from
    trivial or advisable to get rid of it.

    This attack as already has been clearly stated is social, not
    technical. If xz-utils used meson or cmake instead it would of not
    changed the situation.

    Ultimately what is happening is a reflection on how we audit
    critical system components and contributions made to them. Change
    is not going to happen over night.

    We saw a similar shift with OpenSSL's heartbleed, which
    ultimately led to positive changes in code quality and improving
    their vulnerability reporting process.

    There is some good to come of this event, but it's important to
    recognize what went wrong and how open source can improve as a
    whole.




    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?K=C3=A9vin_GASPARD_DE_REN@21:1/5 to All on Sat Apr 6 09:51:05 2024
    If that’s working, it could at least be on an user personnal page on the
    wiki as well.

    Le 04/04/2024 à 10:32, Sam James a écrit :
    Eli Schwartz <eschwartz93@gmail.com> writes:

    On 4/3/24 11:30 AM, Eddie Chapman wrote:
    Just to report I've been able to remove app-arch/xz-utils from my own
    workstation, with 2412 packages installed and running kde. I'm going to
    roll it out to my other gentoo systems which have a lot less stuff on them >>> so am confident will be fine. It's not completely trivial but not as
    difficult as I imagined it to be, certainly something an advance Gentoo
    user could do if they wanted, with instructions. It does involve a
    relatively small hack and functionality previously provided by xz-utils is >>> replaced by app-arch/p7zip.

    I'd just like to clarify my previous posts: what you're describing here
    is neat and productive and valid to my eyes. Actually, I wish this had
    been the topic of the *first* post in this thread. :)
    Completely agreed. We just prefer shorter text and focusing on technical changes.

    This sounds fun!

    [...]
    thanks,
    sam


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joonas Niilola@21:1/5 to James Le Cuirot on Sat Apr 6 09:51:05 2024
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------pRn0row8QIVTx0ebo2dcd2Hw
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    On 1.4.2024 23.07, James Le Cuirot wrote:

    That's not stupid at all, I'd been thinking exactly the same thing. I raised this whole issue during a discussion at FOSDEM 2019, where I admitted that I didn't check the code changes for packages I was bumping, knowing that few to none of the other people in the room did so either. Despite speaking up then, I still didn't do it because it's a heavy a burden and I'm not paid to do it. Now I'm thinking I really should, but I could really use some help. I'll raise
    this idea at work. You could say that we specialise in these things. :)

    Regards,
    Chewi

    Offtopic but I'll just throw this out there: "pkgdiff-mg -b" from mgorny-dev-scripts does wonders when bumping packages. Not everyone
    knows about this so posting for awareness.

    (Maybe slightly related after all since it would've shown the suspicious CmakeLists.txt change at least)

    -- juippis

    --------------pRn0row8QIVTx0ebo2dcd2Hw--

    -----BEGIN PGP SIGNATURE-----

    iQGTBAEBCgB9FiEEltRJ9L6XRmDQCngHc4OUK43AaWIFAmYLpoRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk2 RDQ0OUY0QkU5NzQ2NjBEMDBBNzgwNzczODM5NDJCOERDMDY5NjIACgkQc4OUK43A aWJtIwf/bfy5Ts27iLZ73HfzMUq7DnjWL5WqE8YBDFFaBf84P4jH0fGFDj51nIWY 7Nl1dNLEs8BnVymyxdo+KcCnJ5VNDv3L+nUjDXJReTHOAnGVPacokc01TvtKxeuL myORsuluGyBDX/5/cVvKgpYCeC3BHxB4VDvx/ZobuM/IafhCjK4YryZItbYhu9t0 cn0yJs1eGgm0dLqtrDTI3hrt9klF7dsnPV/hh/RHy5/BPa3haQ9y/YpIW5vwZifw ywNh/Ou/c9X1SK6wOEQlR3ZOWR5oB4q2mAA8gECXadhzNveQoDMDFwL9ct2xjvGF GjvP4AY8ZVr4/m16HFhDi/TUTYiFOg==
    =zcqP
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to Azamat Hackimov on Sat Apr 6 09:51:25 2024
    On 01/04/2024 15:56, Azamat Hackimov wrote:
    There is no problem in the XZ/LZMA format itself as the reference
    algorithm is not compromised. It's all about trust between developers
    of application and developers of distribution. If you lost trust to xz-utils's developers, you may use alternatives like app-arch/pxz or app-arch/pixz. I don't see reasons why we should change format instead
    of changing a tool.


    Hello Azamat,

    Yes, I have no issue with the format at all, just with the xz utils
    project. But I was suggesting to have support for two compression
    algorithms as an improvement for the future, in case of some unknown
    other major problem with one of them emerges in future. I suppose kind
    of a similar reasoning, but not quite the same, that we have BLAKE2B and
    SHA512 hashes. But there are severe practical problems for Gentoo infra resources with having two of course.

    Thank you for the pointer to app-arch/pxz and app-arch/pixz. I've had a
    close look at them both but sadly they are not suitable as they both
    rely on the xz utils project to do the main work. Once calls the xz exe
    and the other links against liblzma.

    I have been looking around a bit since Friday at what true alternatives
    (no relying on liblzma) there are to just decompress existing XZ/LZMA
    binaries. There is p7zip which is a command line fork of 7zip that's
    been around a good while. However in the years since that fork was
    created the 7zip project themselves have begun doing source code
    releases with build instructions, with the command line tool apparently
    working fine.

    On balance the upstream 7zip actually looks like a better option than
    p7zip now since p7zip maintenance has stagnated somewhat. On the one
    hand 7zip is actively developed, of course because of the large Windows userbase, and security fixes would be available immediately when a new
    release comes about (there were sec issues fixed in 7zip last year for
    example which didn't make it into p7zip in a timely fashion). But on
    the other hand most distros have used p7zip and I've only seen Arch and
    Debian that currently package the 7zip releases, so the latest 7zip
    releases have had only minimum real world testing and code scrutiny in
    the Linux world (although it's likely much of the code will still be the
    same as what it was when p7zip was forked, so in that sense at least a significant portion of the code has had wider testing, in a manner of speaking). Still, I'm not sure about 7zip, doesn't seem ideal.

    Thomas Gall, elsewhere in this thread, pointed out a pure Rust
    implementation which is interesting.
    https://github.com/gendx/lzma-rs

    The GH page says it supports decompression of "LZMA, LZMA2 and a subset
    of the .xz file format".

    If anyone else knows of any other true alternatives please do let me
    know. I'm currently looking into the feasibility of hacking my Gentoo installations so that .xz distfiles are decompressed during the ebuild
    process using an alternative implementation, allowing me to get rid of
    xz utils.

    Thanks,
    Eddie

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to Sam James on Sat Apr 6 09:51:59 2024
    Sam James wrote:
    Eli Schwartz <eschwartz93@gmail.com> writes:

    On 4/3/24 11:30 AM, Eddie Chapman wrote:

    Just to report I've been able to remove app-arch/xz-utils from my own
    workstation, with 2412 packages installed and running kde. I'm going
    to roll it out to my other gentoo systems which have a lot less stuff
    on them so am confident will be fine. It's not completely trivial but
    not as difficult as I imagined it to be, certainly something an
    advance Gentoo user could do if they wanted, with instructions. It
    does involve a relatively small hack and functionality previously
    provided by xz-utils is replaced by app-arch/p7zip.

    I'd just like to clarify my previous posts: what you're describing here
    is neat and productive and valid to my eyes. Actually, I wish this had
    been the topic of the *first* post in this thread. :)

    Completely agreed. We just prefer shorter text and focusing on technical changes.

    This sounds fun!


    [...]


    thanks, sam

    Well, I didn't think my first post was so bad, but OK, I'll take that
    criticism onboard and in future will think more about how I bring
    something to this list, and will take into account what you and Eli have
    said. Thanks for sharing your thoughts above, both of you, in a
    constructive way.

    regards,
    Eddie

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to Eli Schwartz on Sat Apr 6 09:52:29 2024
    On 02/04/2024 20:46, Eli Schwartz wrote:
    On 4/2/24 4:43 AM, Eddie Chapman wrote:
    Well, they change one thing. It's hard for the security professionals at >>> work to deal with things when they are constantly having to respond to the >>> three-ring circus.

    This is a complaint I hear very often from the people working at the heart >> of things. Stop making noise, shut up, we're overworked here and dealing
    with your "complaints" just adds to our stress. I do understand and
    sympathise with those feelings, believe me I do, I feel them myself in
    other contexts.

    But I hope you understand this is not finding things to nitpick about for
    the sake of it. Does the Gentoo dev community want people on the "outside" >> to raise their concerns on their mailing list if those persons feel like
    said community have got something very wrong, yes or no? If not then put a >> note on the mailing list page saying "please don't bother us, we're too
    overworked, just post patches" or something to that effect.


    I would be delighted to hear reasonable concerns. That's not what I'm referring to by "three-ring circus".


    What does one have to do with the other? Why is it necessary to claim
    that based on some sort of vibe check "there is too much compassion going >>> around in our communities, and this must mean that not enough effort is
    being expended on the technical and cleanup aspects"?

    I have not made such a claim, I've said I see lots of technical and
    cleanup aspects. I've only stated the things that *are* happening versus
    what is not happening at all (literally zilch) and which should be
    happening, which is efforts towards a solution *not* involving the xz
    utilities.


    You say that as though a solution *not* involving the xz utilities is a reasonable takeaway from this scenario.

    In order to demonstrate that such efforts deserve discussion at all, let alone efforts towards solving it, you first need to prove that:

    - the xz utilities as shipped by Gentoo are something that should be
    moved away from

    - the xz utilities as released in 2022, when the backdoor author had
    just as much access as you or I -- that is, none, aside for the right
    to submit patches as suggestions -- are something that should be moved
    away from

    You have made no effort to justify either approach aside for claiming
    that for unidentified reasons you believe this scenario demonstrates
    that the "apparently innocent maintainer" now has an incentive to
    "downplay the involvement of the bad actor".

    If you had, I would be infinitely more interested in what you have to
    say on the topic.

    Also, if you had started with such.


    Reading in between the lines, e.g. "trying desperately to salvage the
    situation with xz-utils", I suspect you are trying to subtly suggest that >>> any second of time where gentoo hasn't yet removed xz-utils from gentoo as >>> a dead end is "cavalier".

    Not quite, I've never advocated removing xz-utils at all, more than happy
    for it to remain for whoever wants to use it. The only reason I started
    this thread is I'm very unhappy about that fact that it is currently
    impossible to NOT execute xz utilities on the Gentoo systems I'm
    responsible for, without heavy customisation.

    I'm also not demanding anything, let alone demanding anything instantly.
    If I have please point out where.


    Thank you for clarifying.

    I am now just as convinced as I was yesterday, that you are trying to
    subtly suggest it, but I'm newly convinced that you're also being
    mendacious about it.

    "It is cavalier for Gentoo to allow xz-utils as a package in the @system
    set" is not meaningfully distinct from "it is cavalier for Gentoo to not
    work to allow me to depclean xz-utils".


    I understand that you are passionate about your suggestion to make
    portage not validate distfile hashes.

    That's incorrect, I've never suggested Portage should not validate
    distfile hashes. The current behaviour is that validating distfile hashes
    is something that can be disabled if a user wishes to, and I have no
    problem with that at all, would not change a thing. I've said that, in
    order to implement what I have suggested, a user would have to disable it, >> which is not ideal, but acceptable if the user controls the distfile
    distribution. And I only suggested that in order to try and make the idea
    more acceptable by not requiring impractical infra changes that would be
    needed to generate uncompressed hashes for the Manifests).


    In other words, you didn't care to find a robust solution, you just want something that you personally can use, and which requires being less
    secure than using xz-utils.

    But it's okay! It's not harassing portage devs with unreasonable
    demands! Because it's *optional*, and by default people would just...
    use xz-utils.

    Even though the ***entire premise*** of changing anything here is that xz-utils as shipped by Gentoo is somehow dangerous and users have a
    valid reason to want to avoid it entirely.

    If you're going to recommend a solution for users who consider xz-utils
    to be dangerous, then that solution should, you know, be better than
    using xz-utils.

    Not worse and less secure.


    But I don't understand how you think
    it's a solution to the xz-utils problem. For a wide variety of reasons,
    but the simplest one is that your proposal has zero plan of action for
    solving this at the community level and is entirely designed to allow
    "lone wolf" users to use throwaway systems performing
    security-sensitive actions (decompressing and hosting distfiles) in a
    networked environment that has the xz-utils installed, to feed into other >>> security-sensitive systems (daily drivers etc.) that don't, but do have to >>> trust the artifacts produced by the former.

    I'm not entirely clear what you're trying to say in this paragraph.


    I am sarcastically saying that your proposal makes things worse and less secure for you, and doesn't even stop you from having to use xz-utils in
    a context where a malicious xz-utils has the ability to inject attack
    code into the uncompressed source code .tar files your proposal depends on.


    But
    what I will say is I've tried very hard in any suggestions I've made to
    only suggest things which will NOT change any default behaviour or require >> big changes. The average user would not see any change from my revised
    suggestions at all. I accepted after the first responses in this thread
    that there was no appetite here to stop using xz utils. I then asked the
    list about an idea I had just to see how palatable it might be. It was not >> supposed to be a concrete plan, I was seeking discussion about how it
    might be possible in practise for someone to use Gentoo without
    compression and decompression of distfiles. I tried to suggest a solution
    that could be an optional feature people could enable if they wanted it.


    But you should be proposing a change in default behavior! If it's not a change in default behavior then the change helps no one and there's no
    point in making it.

    If the change is good enough to make, it should be good enough to
    propose its use by default, or at least as a recommended change people
    should be encouraged to make while data is collected for rolling out the change as a switched default.

    If you want a change that only applies to your personal system, Gentoo already has a solution: make an overlay that contains slightly modified versions of every ebuild in gentoo that has a SRC_URI mentioning *.xz files.

    No changes to portage needed. Host your own tarballs on your own server
    in SRC_URI. Validate them with checksums, even.

    ...

    Or you could suggest patches to portage that improve the sandbox used to invoke decompression and archive extraction, so that it's "safe" to have
    xz as a statically linked executable with no accompanying library
    installed for the purpose of untrusted distfile extraction.


    It's not being cavalier when zero portage developers responded by saying >>> "good idea I'll drop everything so I can get right on this and implement >>> it".

    I'll just point out that I've never expected nor asked for anyone to
    unquestionably accept anything I've said, let alone in the way you have
    characterised there that I might have done. I do think that the oss/linux
    community as a whole including Gentoo developers should seriously consider >> changing direction on this though. And I still think it is cavalier,
    simply because by deciding on the current direction that is being taken,
    very big (not an exaggeration) risks on behalf of all users are being
    taken, while a much safer path for everyone is available but being
    completely ignored. I do acknowledge, though, as I have said before, that >> this is far from easy in practise.


    Sorry, but no.

    When you say that the community's response is "cavalier" because the community is not accepting what you've said, you are inherently working
    off the belief that the community's failure to accept what you've said
    is because the community is *wrong* to question your suggestions.

    If you think the community is wrong to question your suggestions then
    you should be prepared to defend that point of view, particularly when
    they are busy trying to coordinate a security response together with
    security professionals from a wide variety of other distros, commercial vendors, OSS communities, etc. and have limited time to explain to
    *hundreds* of people who each have their own badly thought out ideas
    about what the FOSS community should do to solve the problem.

    Your suggestion is only one such badly thought out idea. However, it
    stands out from the rest because your suggestion has something that the
    rest by and large lack: it has an accusation that distros, in this case Gentoo, are being cavalier about security.

    This attitude of "Gentoo is being cavalier about security" is disproportionately worse than the average user interaction and, as has
    been noted, is the reason why FOSS maintainers suffer burnout.

    It has nothing to do with bringing up concerns. It has everything to do
    with "if you don't agree with me you're being cavalier about MY security
    as a Gentoo user".

    Seriously. Please learn to bring up suggestions as suggestions, not as demands. It makes all the difference in the world.

    I'll just reply only to let you know I'm not going to take part in some
    sort of battle. I've been courteous with you and I have not aimed my
    opinions or arguments at any person in particular. However, your reply
    here is venturing beyond healthy debate into some sort of twisted,
    completely out of order, nastiness towards me. It is completely
    fruitless, so I won't be engaging with you any further. It's a shame as
    some your arguments, if you take away the poison from them, really,
    really need to be challenged and I would enjoy doing so. But like this,
    no, definitely not, I'm done here.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenton Groombridge@21:1/5 to Eddie Chapman on Sat Apr 6 09:52:33 2024
    On 24/03/31 12:13PM, Eddie Chapman wrote:
    Eli Schwartz wrote:
    On 3/29/24 11:07 PM, Eddie Chapman wrote:

    Given what we've learnt in the last 24hrs about xz utilities, you could
    forgive a paranoid person for seriously considering getting rid
    entirely of them from their systems, especially since there are suitable >> alternatives available. Some might say that's a bit extreme, xz-utils
    will get a thorough audit and it will all be fine. But when a
    malicious actor has been a key maintainer of something as complex as a
    decompression utility for years, I'm not sure I could ever trust that
    codebase again. Maybe a complete rewrite will emerge, but I'm personally >> unwilling to continue using xz utils in the meantime for uncompressing
    anything on my systems, even if it is done by an unprivileged process.


    It suffices to downgrade to the version of xz before a social
    engineering attack by a malicious actor to gain maintainership of the xz project.

    Have you been linked to this yet? https://www.mail-archive.com/xz-devel@tukaani.org/msg00571.html

    --
    Eli Schwartz


    Yes I saw that yesterday. It only increased my level of concern about the project ten-fold rather than decreased it, particularly because of "he has been helping a lot off-list and is practically a co-maintainer already".



    I think it's important to realize that this could have potentially
    happened to any number of various open source projects, not just
    xz-utils. Simply ripping it out and replacing it is not enough to
    prevent these kinds of issues from happening in the future.

    There is a major shifting of perspectives as a result of this
    unfortunate compromise. Right now there are serious considerations about banning (or otherwise auditing) binary blobs in some projects. There are
    talks about banning the use of older build systems like autotools in
    favor of ones more easily readable and auditable. Ultimately what is
    happening is a reflection on how we audit critical system components and contributions made to them. Change is not going to happen over night.

    We saw a similar shift with OpenSSL's heartbleed, which ultimately led
    to positive changes in code quality and improving their vulnerability
    reporting process.

    There is some good to come of this event, but it's important to
    recognize what went wrong and how open source can improve as a whole.

    --
    Kenton Groombridge
    Gentoo Linux Developer, SELinux Project

    -----BEGIN PGP SIGNATURE-----

    iQKTBAABCgB9FiEEP+u3AkfbrORB/inCFt7v5V9Ft54FAmYKz0RfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNG RUJCNzAyNDdEQkFDRTQ0MUZFMjlDMjE2REVFRkU1NUY0NUI3OUUACgkQFt7v5V9F t57XVg//Rfhk3wg0j7cz9DH4KmBsmQsembLh0hMdos9C0z1wZvnFMYUTR+mieaJ2 Mu8IFTdkJhI91+JQQ/94EUoKtELPVoQC5BTFcWl/9JpaREaqg5joChd1C42pFf9Z ranKAekM8P9e9qkzax/w9VmouUNTWycnHIPAX3K1c+XH/E4eSKna+TEIORpLemcf j3cL8NZNngpT+og0nikBcra/U9guvoPdaKhgPwHxPSUJ805QEUiJ2/8abmLyS0sk 6/6IQxgcLZtVVZ9lXZ572dEZ4Om2N4yRBJRrHMxIg1nMbeza2KMwBJOK+IOlyXUZ 00cH0UxMr1mie//1HaCxOQzl/AIvNGqLX4TSpWymI62bgA4gSbJcBxrZ51QQTDDv op5gfuq6GXWb9vFyTr93mNpY+0PPoSXpCmsaymZSgWKujK9nENGa2+WMbh9agI8X Y75WoG57OO9J2jeO8lK8gd3RAxSskhE/YHo5xhAOTQrRXTUdbQWuKWwhS/hxtjHv WBppTsuBOtjHhdWq06ltKsBdW3rn4H5z0Nj4i+Yvs7Qcqrplp91i6JRRxntpdTfo eXfbZoEl6bvMzoo8T7PbL4fGfUxS1x998P3UnrFi7t34XqFiTuUwEupBHslZ5i34 POsA8g+ZJkma4OdAIA4OClJ7CPI0JJzFNM8T6GKvIjiiuwMrRgE=
    =a6BN
    ----
  • From Roy Bamford@21:1/5 to Eddie Chapman on Sat Apr 6 14:40:01 2024
    On 2024.04.06 12:57, Eddie Chapman wrote:
    On 04/04/2024 15:24, Eddie Chapman wrote:
    Since there appears to be some interest I'll put together a single
    email
    to the list later today detailing everything, as I needed to do more
    things overall in addition to replacing /usr/bin/xz.

    Below is a guide I've written to removing app-arch/xz-utils in case
    anyone else wants to do so. Attached is the current version of the
    Bash
    wrapper script I now use in place of /usr/bin/xz

    Comments, corrections on anything technical in the guide or script are

    welcome, apart from flames about how this is ridiculous and
    unnecessary :-).

    Best wishes,
    Eddie

    [snip method]

    "Because I can" is a good enough reason to do anything with Gentoo.

    --
    Regards,

    Roy Bamford
    (Neddyseagoon) a member of
    elections
    gentoo-ops
    forum-mods
    arm64
    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEsOrcx0gZrrCMwJzo/xJODTqpeT4FAmYRQUkACgkQ/xJODTqp eT6H6gf+PK0k7a4qFLp+0zppgBQyNiy54ujumK4AzilOrvYxyd4NdNDQea430MqE z2onKng4LQ7vyylBC9M8rwwkZP9HqZCzX0mBVcvzdSebRnHcineM5r8fWPJwF+0K m3Ludek6D8LSpDWjC0mqSYQqeqCdJOztNgeQXzY45sbet+vdGtAAGrCTShetcIup L7w2fJlFUdvMw8mPLB9F6qDuQJ8MapckUz2H1VVOkUM3cemvl4FSL9JGlAkGQ8P+ Jzv543d2ikn7La+xOdrcy17O253dQTGvRssy1pze54/sbJj5oRhqEezVkhkuRAY8 tTz8hYs4pi0Ik00YDUBHHEhgfFt5Qw==
    =FmLU
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Sat Apr 6 14:20:01 2024
    On Sat, 06 Apr 2024, Eddie Chapman wrote:

    [...] this is ridiculous and unnecessary :-).

    Indeed.

    SCNR,
    Ulrich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Fabian Groffen@21:1/5 to Eddie Chapman on Sat Apr 6 16:10:01 2024
    On 06-04-2024 12:57:23 +0100, Eddie Chapman wrote:
    There is one significant thing that breaks, which is Gemato (app-portage/gemato). Gemato requires lzma support in core python in
    order to do GPG signature verification. This means you will have to say goodbye (for now) to verifying upstream GPG signatures on distfiles, and verification of Portage metadata after doing an emerge --sync. These features have been added to Portage relatively recently (2022?) so are
    "nice to have", without them your system is just less hardened, but
    still with the very high level of security that Gentoo systems have has always had prior to these features, in my opinion. Personally I can live without them for now. Verifying hashes in Manifest files still works
    fine and that's the main thing. You may disagree in which case, well,
    don't do this then. I'm going to figure out an alternative way I can
    verify Portage metadata soon, as there are other ways if you are creative.

    If you just want to verify signatures and manifests after sync,
    qmanifest from portage-utils can help you do this.

    Thanks,
    Fabian


    --
    Fabian Groffen
    Gentoo on a different level

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCgAdFiEELUvHd/Gtp7LaU1vuzpXahU5EQpMFAmYRVnMACgkQzpXahU5E QpNH+ggApfXRuZ4gc8dxjFhQjk6pHJWMUVw11XLKK+WXCLKJbIEXDl5KCRxQ29NI 7U3O81PrhGJME6GQBhI29VQSZFyfXO6eaX8oquhTeYMSHBvNb1bH7OBMzWkl+H6l nS2Zw/Wp/+2/IPTHLfJ2nyUR9JbJ+tZFu4xxFZCGGBfU48Fle2itvAszeQMdoyHH HG+4BhZWG3M+k5FGyqeTEt9xSlaNvDPXTCisLV8yBaBzj1mdRqokD+7srYd7mm8b nWfsRVgewn6pgWb7olpJx8MaVglNFQr15wIs3OhsLx1PFVT2KMMufiBqZKQl1sQy Wri7v/nzTMxXdttMITVoRhBx02oLtQ==
    =d3fV
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to Eddie Chapman on Sat Apr 6 18:20:02 2024
    Eddie Chapman <eddie@ehuk.net> writes:

    On 04/04/2024 15:24, Eddie Chapman wrote:
    Since there appears to be some interest I'll put together a single email
    to the list later today detailing everything, as I needed to do more
    things overall in addition to replacing /usr/bin/xz.

    Below is a guide I've written to removing app-arch/xz-utils in case
    anyone else wants to do so. Attached is the current version of the
    Bash wrapper script I now use in place of /usr/bin/xz

    Comments, corrections on anything technical in the guide or script are welcome, apart from flames about how this is ridiculous and
    unnecessary :-).

    For an experiment I'm doing (distinct from trying to purge xz-utils,
    just verification work), I've packaged the following:
    * app-arch/gxz (pure Go impl.)
    * app-arch/7zip (7zip upstream are supporting Linux now, app-arch/p7zip
    was an unofficial port)

    You might find those useful too.

    At a glance, it appears https://github.com/fpgaminer/rust-lzma and https://github.com/gendx/lzma-rs don't provide executables - just a
    library - so I didn't bother looking further.


    Best wishes,
    Eddie


    ==== Guide to removing xz utils on a Gentoo system ====

    [...]
    There is one significant thing that breaks, which is Gemato (app-portage/gemato). Gemato requires lzma support in core python in
    order to do GPG signature verification. This means you will have to
    say goodbye (for now) to verifying upstream GPG signatures on
    distfiles, and verification of Portage metadata after doing an emerge
    --sync. These features have been added to Portage relatively recently
    (2022?) so are "nice to have", without them your system is just less

    No.. much older. It was introduced around the time of the github mirror
    being hacked. It's not just theatre!

    Like, this is very much NOT hypothetical.

    It's not just about metadata, it's about the ebuilds if using rsync, or
    the whole git checkout if using git.

    hardened, but still with the very high level of security that Gentoo
    systems have has always had prior to these features, in my
    opinion. Personally I can live without them for now. Verifying hashes
    in Manifest files still works fine and that's the main thing. You may disagree in which case, well, don't do this then. I'm going to figure
    out an alternative way I can verify Portage metadata soon, as there
    are other ways if you are creative.

    See grobian's reply which should help.

    [...]
    - Portage binary packages: You cannot use xz compression if you create
    Portage binary packages. You will need to use one of bzip2, gzip,
    lz4, lzip, lzop, or zstd in BINPKG_COMPRESS in make.conf instead of
    xz (if that is what you were using, or is it the default?). I have

    zstd is the default for "new" installs (since a few years ago), yeah.

    [...]
    - sys-apps/fwupd might stop working properly (though it will still
    build fine) due to what you have to change with dev-libs/libxmlb
    below. I'm not sure as I haven't checked yet, I just suspect it
    will. So bear that in mind if you need to rely on sys-apps/fwupd at
    the moment. But this "might" is temporary, upstream has now decided
    to make lzma optional, so this will trickle down to Gentoo soon.

    Just for completeness, this is https://blogs.gnome.org/hughsie/2024/04/03/fwupd-and-xz-metadata/.

    [...]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to Fabian Groffen on Sun Apr 7 08:50:01 2024
    Fabian Groffen wrote:
    If you just want to verify signatures and manifests after sync,
    qmanifest from portage-utils can help you do this.

    Thanks,
    Fabian

    Thanks for the pointer, and I see you are one of the authors, thanks for writing a very useful tool!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to Sam James on Sun Apr 7 13:30:01 2024
    Sam James wrote:
    Eddie Chapman <eddie@ehuk.net> writes:
    Below is a guide I've written to removing app-arch/xz-utils in case
    anyone else wants to do so. Attached is the current version of the Bash
    wrapper script I now use in place of /usr/bin/xz

    Comments, corrections on anything technical in the guide or script are
    welcome, apart from flames about how this is ridiculous and unnecessary
    :-).

    For an experiment I'm doing (distinct from trying to purge xz-utils,
    just verification work), I've packaged the following: * app-arch/gxz (pure
    Go impl.)
    * app-arch/7zip (7zip upstream are supporting Linux now, app-arch/p7zip
    was an unofficial port)

    You might find those useful too.

    That's fantastic. I wrote about p7zip vs. upstream 7zip in another mail in
    this thread and was intending to create a local ebuild for 7zip soon but
    won't have to know it's in tree :-)

    At a glance, it appears https://github.com/fpgaminer/rust-lzma and https://github.com/gendx/lzma-rs don't provide executables - just a
    library - so I didn't bother looking further.

    ==== Guide to removing xz utils on a Gentoo system ====

    [...]
    There is one significant thing that breaks, which is Gemato
    (app-portage/gemato). Gemato requires lzma support in core python in
    order to do GPG signature verification. This means you will have to say
    goodbye (for now) to verifying upstream GPG signatures on distfiles, and
    verification of Portage metadata after doing an emerge --sync. These
    features have been added to Portage relatively recently (2022?) so are
    "nice to have", without them your system is just less

    No.. much older. It was introduced around the time of the github mirror
    being hacked. It's not just theatre!

    Like, this is very much NOT hypothetical.

    Thanks, couldn't remember when it was.

    It's not just about metadata, it's about the ebuilds if using rsync, or
    the whole git checkout if using git.

    Completely agree with you that this was a great feature to be added from a security point of view. Without it there was still a level of trust,
    however small, that could be placed in the choice of mirror. But there's
    no doubt gpg sigs of repo data are order of magnitudes better, so yes it
    was a little unjust to describe it as only "nice to have".

    But in the current situation I personally consider it so critically
    important to get rid of xz utils from my systems that a short, temporary
    period of not having this while switching to another method of
    verification I consider an acceptable tradeoff (side note to anyone
    reading: yes I know how at odds I am with the rest of the world on this,
    it has now been argued to death in this thread so for anyone thinking
    about replying about that, maybe lets do everyone a favour, agree to
    disagree, and move on :-) )

    hardened, but still with the very high level of security that Gentoo
    systems have has always had prior to these features, in my opinion.
    Personally I can live without them for now. Verifying hashes
    in Manifest files still works fine and that's the main thing. You may
    disagree in which case, well, don't do this then. I'm going to figure
    out an alternative way I can verify Portage metadata soon, as there are
    other ways if you are creative.

    See grobian's reply which should help.


    [...]
    - Portage binary packages: You cannot use xz compression if you create
    Portage binary packages. You will need to use one of bzip2, gzip,
    lz4, lzip, lzop, or zstd in BINPKG_COMPRESS in make.conf instead of xz
    (if that is what you were using, or is it the default?). I have


    zstd is the default for "new" installs (since a few years ago), yeah.

    [...]
    - sys-apps/fwupd might stop working properly (though it will still
    build fine) due to what you have to change with dev-libs/libxmlb below.
    I'm not sure as I haven't checked yet, I just suspect it
    will. So bear that in mind if you need to rely on sys-apps/fwupd at the
    moment. But this "might" is temporary, upstream has now decided to make
    lzma optional, so this will trickle down to Gentoo soon.

    Just for completeness, this is https://blogs.gnome.org/hughsie/2024/04/03/fwupd-and-xz-metadata/.


    Thanks for all the useful additions of info :-)

    cheers,
    Eddie

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eddie Chapman@21:1/5 to Joonas Niilola on Sat Apr 13 09:20:01 2024
    Joonas Niilola wrote:
    Hey,

    I'll admit I didn't read everything, but I just want to point out you
    may not have to edit ebuilds at all. If xz-utils is package.provided
    portage should ignore the dependency without you removing the dep from an ebuild. Then you can utilize /etc/portage/patches to apply any patches and finally try using EXTRA_ECONF and MYMESONARGS to override configure
    options via package.env.

    -- juippis

    Hi Joonas,

    The local ebuilds in the guide were not created because of the xz-utils
    dep. If you search through ebuilds in the tree there are hundreds of
    packages that specify xz-utils as a hard dep, so yes, as you say, package.provided takes care of all of then.

    No, the ebuilds were needed for various customisations to build
    arguments. However, the dev-libs/libxmlb ebuild is no longer needed as,
    since I wrote the guide, libxmlb 0.3.17, which makes liblzma.so.5 dep
    optional, is now in Gentoo, thanks whoever added that :-)

    You might be able to dispense with the need for the separate
    net-mail/dovecot ebuild by using EXTRA_ECONF, as you say. However,
    AFAICS local dev-lang/python ebuilds are unavoidable, unfortunately,
    you'll see why if you look at the diffs for them in my guide. It would
    be wonderful if dev-lang/python made its liblzma dep optional. It would
    be a simple change to the ebuild. However, I suspect the developers
    might feel that *not* depending on liblzma.so.5 is unsupported because
    it results in Gemato failing due to lack of support in core python for
    liblzma. The only way around that issue I can see is for Gemato to
    instead use /usr/bin/xz like the rest of Portage does. If that were to
    happen then dev-lang/python could be modified to respect -lzma and I
    can't see that anything significant in Gentoo would miss it. Then if
    there are any dev-python packages that need liblzma in core python
    either presently or in future (I've not encountered any yet) then of
    course they would just need a hard dependency on dev-lang/python with
    lzma USE flag set.

    I now have many Gentoo systems running without xz-utils installed (using
    my wrapper script from the guide) and I've not had a single issue
    anywhere, everything working perfectly, so I'm delighted that it has
    been possible :-)

    Eddie

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)