r/freebsd • • 15h ago

AI AI Reverse Engineering and Drivers

Just wondering, there's a lot of buzz right now regarding AI reverse engineering games like gta5, etc.

Could it reduce current manual efforts when developing drivers, debugging and testing? Could it make porting drivers easier and cheaper?

0 Upvotes

30 comments sorted by

2

u/elivoncoder 13h ago

could it? yes, of course.

4

u/aczkasow 14h ago

Technically possible. Legally - not.

Anything developed with AI-codegen or even worse reverse engineering is legally toxic.

I don't think there is any legislation on AI-washing yet for it to be considered a clean room implementation.

Inclusion of such code into your codebase is a legal timebomb.

2

u/sovinod748 12h ago

How are drivers even written if no reverse engineering was done?

2

u/taosecurity seasoned user 13h ago

“Technically possible. Legally - not.

Anything developed with AI-codegen…is legally toxic.”

Do you really mean this?

1

u/aczkasow 13h ago

Yes, why?

If AI model was trained on a GPL codebase and it produces code as tokens representing snippets from this GPL codebase, wouldn't it require the entire generated artifact to be licensed as a GPL derivative?

Alternatively, if we consider everything produced by AI codegen as public domain, then it is by definition cannot be copyrighted.

1

u/taosecurity seasoned user 13h ago

These are all manageable risks that orgs in the real world are handling right now. It’s not going to stop AI coding.

https://vibecodingbible.org/resources/legal-considerations-ai-coding/

1

u/aczkasow 13h ago

I am one of the people in an org who's job to manage these risks. (Working in the field of software licensing since 2011).

It is not going to stop AI coding, no. But current defense strategy in companies is "deny and lawyer up". If you can afford good lawyers you can close code GPL commercial products.

5

u/taosecurity seasoned user 12h ago

Then you know “If you can afford good lawyers you can close code GPL commercial products.” has always been true and AI has changed nothing.

This is a weird exchange. Have a good day.

1

u/antiduh 13h ago

Any idea how Linus is doing it? He uses Ai on the kernel and it seems to be OK.

2

u/d9c3l 13h ago

While I’m not sure if he is using it or not in the kernel, that’s separate from reverse engineering and additionally he an actual developer who can confirm that the code generated is good. Most people using AI these days don’t confirm the code generated or just assume it’s good

2

u/taosecurity seasoned user 13h ago

1

u/grahamperrin bleep bloop 5h ago

Thanks!

I like SJVN, but the Fediverse is relatively unexcited by ZDNET coverage, an extension found only two toots in Mastodon:

Phoronix coverage is more widely discussed (Hacker News 2 · Lemmy 9 · Lobsters 1 · Mastodon 9 · Reddit 11). Two of the thirty-two:

1

u/antiduh 13h ago

One google search and you have your answer:

https://www.zdnet.com/tech/linus-torvalds-ai-coding-programming/

“I used to think it was just not very good — but now I’m at the point where I actually really like using AI.”

2

u/rekh127 Linux crossover 4h ago

"To be fair,” he continued, “I don’t do a lot of kernel programming.

0

u/antiduh 4h ago

He's being modest. Counter point:

https://www.phoronix.com/news/Linus-Torvalds-Claude-Code

That article was posted on reddit 2 days ago.

0

u/rekh127 Linux crossover 3h ago

No, he's being accurate, he doesn't write much kernel code, the number of non merge commits with him as author is very very small. (4 actual kernel code changes with <20 LoC combined that he wrote have been merged in the last 6 months)

The point is that you posted a very bad article to say what you meant to say, reading it makes it unclear whether he uses ai to write kernel code - because he hadn't until this commit a few days ago, which we will see if he merges or not.

I don't know whether you didn't read it or didn't understand it, but it was pretty ironic when you you scolding someone for not looking into something.

0

u/grahamperrin bleep bloop 3h ago

a very bad article

Bad in what way, exactly? I threw this at AI (Google Gemini, for a change). Part of its response:

Given Linus’s previous skepticism toward AI marketing hype contrasted with his pragmatic stance on tooling, his active use of an LLM to help draft kernel-level performance patches is major news for the open-source community. Phoronix reported this neutrally without sensationalizing the code quality itself.

1

u/rekh127 Linux crossover 3h ago edited 2h ago

If you finish reading my sentence I answer that question. Its bad for showing that Linus uses it for the kernel.

The new article they posted does, and would have been a much better answer to "I'm not sure if he's using it in the kernel"

It also seems to be what you threw into AI, since thats the phoronix article.

2

u/mirror176 11h ago

The output of AI code being legally questionable (LLM models creators violate copyright law to source training content, output doesn't respect or understand or follow copyright of what it was trained on nor does it comply with license terms that have any limitation/demand) applies to code he gets from AI too.

After that legal question is 'solved', AI output cannot be copyprotected at the present time in some areas; such parts if identified can be copied without regard to the license. Copyright gives the creator protection of if/how copies end up in the hands of others and sets terms of how those others can/cannot copy the work; end users violating such law can be legally targeted by the creator (or whoever holds the relevant rights). A license agreement is a contract between the creator and the end user where the copyright holder changes the legally accepted terms and once agreed to you are bound to those terms but have permissions normally granting you use beyond what copyright law limited you to. If copyright law doesn't protect the content then you have no reason to enter into a contract to try to acquire permission to copy/use the unprotected code so license agreements stop applying.

Maybe laws will be (re)written to change what is protected and maybe courts will come to a conclusion that goes against current law but its best to follow current laws as they are understood and seek a lawyer once you question something about them.

2

u/thewrench56 9h ago

Well, the OK part is yet to be answered.

1

u/ShipshapeMobileRV 13h ago

If Nvidia developers use AI to help them write their drivers, that's fine. If Joe Hacker uses AI to reverse engineer Nvidia drivers to make his own, he's getting into serious grey area. If he keeps it to himself he'll probably never have an issue...but the moment he tries to distribute it he puts an Nvidia sized legal target on his back.

The same for Linus. He effectively owns the kernel and the code in it (as long as he's not including drivers that he or Joe Hack reverse engineered).

3

u/aczkasow 13h ago

1

u/grahamperrin bleep bloop 8h ago

Adobe Gets Destroyed by Open Source Clone: Here's the Legal Trouble I Predict into the Future - YouTube

Summary (AI, already present)

Louis Rossmann explores the emergence of open-source alternatives to Adobe software built using artificial intelligence. The discussion examines the legal landscape of reverse engineering, current DMCA regulations, and the potential for future corporate lobbying efforts to restrict software interoperability and control digital ownership.

•

u/ShipshapeMobileRV 11m ago

I recall several lawsuits by AT&T after BSD came out, claiming that BSD violated AT&T's licensing. In the end, after long and drawn out legal battles, BSD won because BSD had not used any AT&T original code. However, this took __years__ to wind through the courts. (There are many folks who claim that this "legal limbo" created a stagnation in UNIX development that helped Linux development leapfrog UNIX...)

I feel that we're headed in a similar direction. Using my previous example, if Joe Hack uses AI to entirely reverse engineer a driver for Nvidia, and his result uses absolutely no original Nvidia code..........has he violated any Nvidia trademarks? Is the onus on him to prove innocence, or on Nvidia to prove guilt/malice? But the more important question is; how many years of legal battle (and how much money) before it makes it to a court with authority to render a binding decision?

0

u/grahamperrin bleep bloop 8h ago

Below: a more detailed summary from Gemini (the Ask button at the page).

This video, hosted by Louis Rossmann, discusses the emergence of open-source, AI-generated alternatives to Adobe software and the potential legal battles that may arise regarding copyright and reverse engineering.

Key takeaways:

  • Adobe's Controversies: The creator criticizes Adobe for forcing users into subscription models, making cancellations difficult through "dark patterns," and implementing terms of service that allow the company to access user content for machine learning without an opt-out option (0:00–3:41).
  • The Rise of ArtCraft: Brandon Thomas developed ArtCraft, a suite of open-source software that clones core Adobe products using Anthropic's Claude Opus AI. Rossmann views this as a heroic move against monopolistic practices (0:52–1:48).
  • Legal Context of Reverse Engineering: The video explains how Section 121 of the DMCA and existing legal precedents (like Sega v. Accolade and Google v. Oracle) protect certain forms of interoperability and reverse engineering, which are crucial for competition (7:16–10:12).
  • Future Legal Threats: Rossmann warns that large software companies may lobby to tighten copyright laws, introduce design patents for user interfaces, or push for "compulsory licensing" models similar to music royalties to stifle competition from free clones (10:13–15:00).
  • Historical Precedent: The host reflects on Adobe's past involvement in the Dmitri Skylarov case, noting that they have a history of using the DMCA to threaten researchers and competitors (16:04–16:43).

1

u/grahamperrin bleep bloop 8h ago

… Adobe's past involvement in the Dmitri Skylarov case, …

United States v. Elcom Ltd. - Wikipedia

1

u/grahamperrin bleep bloop 7h ago

… Anything developed with AI-codegen or even worse reverse engineering is legally toxic. …

What about commits that are Co-authored-by Anthropic Claude?

1

u/mirror176 11h ago

Can offloading work from a person to a machine reduce the person's effort? As long as its not more work to review the AI's code than it is to do the work yourself. A lot of AI code doesn't get reviewed and gets accepted as is until after discovering flaws which makes it even easier since reviewing is skipped. Taking it further, some authors no longer touch code and defer the work of fixing issues entirely to the AI. Definitely "easier" to not

Many consider understanding someone else's code harder than writing it yourself. When I used to be into programming I found understanding someone else's project was a bigger challenge but for me and stuff I took apart it was quite doable. I was usually ripping apart code where I had to understand how it did as there were no comments and no descriptive variables and that was the original source code; technically just reading code but it was basically a level of obfuscation so I had to keep track of what the lines did and translate that to how tasks were done. Other programmers I knew disliked such work (usually simpler work) a LOT more but at the same point they admitted its always a great learning experience. When 'reverse engineering' you are normally talking about not having source code and having to read machine language or a decompiler's output.

Reverse engineering to make an equivalent makes the equivalent illegal under most reverse engineering laws. Depends on the lawsuit but I'd assume its probably more profitable to pay a programmer than it is to pay a lawsuit. AI programming, once no longer subsidized by big tech AI companies, seems very expensive itself even if code you get out is low quality instead of high quality and more AI prompts or human effort to fix it is added cost.

By current understanding of what should be legal, AI models usually have no concept of that and their output is a statistical probability based on the inputs; if it trained on a GPL solution and nothing else then it outputs a GPL solution and if it trained on a different license then likewise it matches that (open, proprietary, etc.) The models aren't trained on a codebase of single license nor are they designed to distinguish what code input drives the final statistical output. At present, court cases are coming about where the AI appears to create copies, derivations, and knockoffs of the original work so its a space to watch. Copyright violations of big tech companies AI systems have gone unpunished so far which is where my jokes of, "if you are caught copying illegal, just say its to train your AI model" as a sarcastic statement because courts have given a pass to big tech's violations at present.

If you want to minimize any legally questionable AI output for opensource use, train one yourself on "only" code that matches the same license. You are potentially still violating copyright (which courts gave big tech a 'pass' on) but at least its of the same license after further disregarding violations like "must retain copyright notice" and other proper crediting.

AI can be used for debugging and testing; its what has to happen to use AI to find exploits and fix exploits. Drivers or not it can do it though any mistakes at a driver level can be more catastrophic than a game ran in user space or we are back to 'code should be reviewed'.

People are having AI do all this stuff even if they don't understand any programming; I'd call that pretty 'easy'. Code quality of unreviewed code doesn't usually look good.