this post was submitted on 21 Feb 2024
159 points (97.6% liked)

Programming

17443 readers
148 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
top 15 comments
sorted by: hot top controversial new old
[–] SuperIce@lemmy.world 45 points 9 months ago (3 children)

That software license is incredible

[–] TWeaK@lemm.ee 38 points 9 months ago

The author has absolutely no fucking clue what the code in this project does. It might just fucking work or not, there is no third option.

lmfao

[–] Aatube@kbin.social 15 points 9 months ago (1 children)

I mean, pretty sure legally that that'd be very bad for whoever makes contributions-

This is the exact reason why I've released this [license] with GLWT license and I have no intention to spend my time discussing or change the license. Try to figure out how you can use it on your project. Or don't use it at all. I don't care. Good luck.
—Ahmed Shamim, 2021

[–] abhibeckert@lemmy.world 5 points 9 months ago* (last edited 9 months ago) (2 children)

The sentence "IN NO EVENT SHALL THE AUTHORS BE LIABLE" doesn't fly where I live. You don't get to choose wether or not you're liable - the law decides who is liable. This thing is about as enforceable as those sovereign citizen license plates and would get the same reaction in a court room.

Plenty of other commonly used licenses have the same issue unfortunately and and the biggest nightmare (at least in my country) is laws against "misleading" or "deceptive" conduct. Telling someone you're not liable for anything is blatantly misleading/deceptive.

Even if your software works perfectly, you are still breaking the law... a victimless crime that would normally fly under the radar or result in a "cut that shit out" order by the court... but it'll really hurt your case if there is actually a victim (e.g. if your software has a bad security flaw that caused real damage).

That's why organisations with big legal teams tend to choose licenses like Apache 2.0. Ones with language like "unless required by applicable law (such as deliberate and grossly negligent acts)".

[–] wagesj45@kbin.social 8 points 9 months ago (1 children)
[–] Aatube@kbin.social 2 points 9 months ago* (last edited 9 months ago)

Most of them with any sort of cybersecurity law

[–] Aatube@kbin.social 3 points 9 months ago (1 children)

At least nobody would actually want to infringe on the rights of this code.

[–] otl@hachyderm.io 1 points 9 months ago

@Aatube Oh I wouldn’t be so sure… we’ve all had those colleagues and vendors where we think they’d import something like this to make our lives miserable ;)

@programming

GLWTSPL is my new favorite license lol

[–] WalrusByte@lemmy.world 23 points 9 months ago (2 children)

Giving off a lot of mixed signals with this one, lol 😅

[–] SorteKanin@feddit.dk 47 points 9 months ago* (last edited 9 months ago) (1 children)

It's utilizing an obscure bug in the Rust compiler that unfortunately lets you circumvent the safety guarantees in order to produce undefined behavior - it's mostly just a joke though, you will not run into the bug in normal code

[–] porgamrer@programming.dev 4 points 9 months ago (1 children)

Thanks for clarifying. Do you know what the bug is? I gathering it's something to do with enums and boxing to enable a "safe" transmute, but couldn't make sense of the code.

Scary compiler edge cases with value-type enums aren't surprising though. Trying to implement that feature with memory safety and high performance sounds like a nightmare.

[–] SorteKanin@feddit.dk 14 points 9 months ago

It's essentially this issue https://github.com/rust-lang/rust/issues/25860

The code used to exploit the bug in this library is here: https://github.com/Speykious/cve-rs/blob/main/src/lifetime_expansion.rs

As far as I understand, the bug basically makes it so you can trick Rust into thinking any lifetime is actually 'static. From that, you can do all kinds of bad stuff.

[–] TWeaK@lemm.ee 10 points 9 months ago

My thoughts exactly!

Now, with cve-rs, you can corrupt your program's memory without corrupting your program's memory.

[–] KiranWells@pawb.social 14 points 9 months ago

For anyone who is confused: This is exploiting an old soundness bug in the Rust compiler that is still present. The GitHub issue page has this comment from maintainers:

we already had a crate published on crates.io before which used this bug to transmute in safe code, see #25860 (comment).

this issue is a priority to fix for the types team and has been so for years now. there is a reason for why it is not yet fixed. fixing it relies on where-bounds on binders which are blocked on the next-generation trait solver. we are actively working on this and cannot fix the unsoundness before it's done.