当AI开始写内核代码
2026年3月17日,一封邮件炸响了OpenBSD的技术邮件列表。
Thomas de Grivel甩出了一个ext4文件系统驱动。完整读写支持,通过e2fsck检查。没有日志功能,但他声称这是“纯AI”写的——ChatGPT和Claude-code生成的,没读过一行Linux源代码。
No Linux source files were ever read to build this driver. It's pure AI (ChatGPT and Claude-code) and careful code reviews and error checking and building kernel and rebooting/testing from my part.
这句话的潜台词很直白:我用AI生成了一段代码,现在想把它塞进OpenBSD。
OpenBSD是谁?那群把“安全”刻进DNA的开源偏执狂。那群会因为一个空格符不对就拒绝patch的强迫症。
你用AI写代码还想往里交?
版权这口锅,AI甩不掉的
OpenBSD的第一反应不是“代码写得怎么样”,而是“这代码能不能要”。
因为ext4是Linux的东西。Linux是GPL协议。而OpenBSD对GPL代码的态度,一向是“有多远躲多远”。
Christian Schulte在邮件里直接挑明:
I searched for documentation about that ext4 filesystem in question. I found some GPL licensed wiki pages. The majority of available documentation either directly or indirectly points at GPL licensed code.
意思很明白:哪怕你声称没看Linux源码,但ext4的文档本身就是GPL的。你AI训练用的数据里有没有这些?你自己说得清吗?
这才是真正的麻烦。
Theo de Raadt站出来说了大实话:
The software community and the legal community are unwilling to accept that the product of a (commercial, hah) AI system produces is Copyrightable by the person who merely directed the AI.
翻译成人话:没人知道AI生成的代码算谁的。
- 是AI的?AI不是人,没有版权。
- 是人的?人只是下了个prompt,算原创吗?
- 是训练数据里那些程序员的?凭啥啊?
Damien Miller补了一刀:
Who is the copyright holder in this case? It clearly draws heavily from an existing work, and it's clear the human offering the patch didn't do it.
这问题没人能回答。法律还没跟上。OpenBSD可不想当第一个吃螃蟹的——万一哪天法院判下来,这代码侵权,整个项目都得跟着遭殃。
“我们可以在20小时内偷走别人20年的成果”
面对质疑,de Grivel的操作很迷惑。
他拒绝撤回版权声明。然后在博客里写了这么一段:
We can freely steal each other in a new original way without copyright infringement its totally crazy the amount of code you can steal in just 1h. What took 20 years to Bell labs can now be done in 20 hours straight.
这段话的信息量太大了。
第一,他觉得用AI“偷”代码不算侵权。
第二,他觉得这是“创新”。
第三,他觉得20小时搞定别人20年的活儿很合理。
说实话,看到这里我已经不知道该说什么了。
Theo de Raadt的回复干脆利落:
the chances of us accepting such new code with such a suspicious Copyright situation is zero.
零。没有任何商量余地。
3月23日,de Grivel表示会删掉AI生成的代码,只保留自己手写的部分。
但这事儿没完。
代码能跑,然后呢?
评论区有人泼了另一盆冷水。
koverstreet看完代码后说:
The bigger concern with LLMs writing code is maintainability and refactoring. Claude has a massive blind spot when it comes to refactoring and cleaning things up as you go.
意思是:代码可能跑得通,但以后谁维护?
- 没人看得懂AI写的代码
- 出了问题没人能debug
- 以后想改结构?AI会告诉你“这代码很干净,一切都很完美”
这不搞笑吗?一个文件系统驱动,里面有成千上万行没人看得懂的代码,运行在操作系统的最底层。然后你说“出了问题AI会修”?
bertschingert说得更直接:
If a tool makes it extremely easy to generate lots of code, then people will tend to solve problems by generating lots of code.
当工具能一键生成一万行代码,人就懒得去思考更好的方案。最后就是满地垃圾,无人敢碰。
真正的反转来了
有意思的是,评论区吵到最后,有人问了句:
Is the code any good?
没人回答。
de Grivel说代码通过了e2fsck,能读写ext4。这技术上是可行的。但关键问题根本不是代码质量——是没人敢为这代码背书。
OpenBSD拒绝,不是因为代码烂,是因为版权问题无解。
而这个问题,会随着越来越多人用AI写代码,变得越来越严重。
There may well come a time when it turns out that even the sharp eyes of OpenBSD reviewers are unable to keep all of it out of their repositories.
总有一天,AI生成的代码会混进开源项目里。没人看得出来的。
到了那一天,谁来收拾?
故事到这里其实还没完。de Grivel最后说想“fork OpenBSD”,意思是老子自己玩总行了吧。
MirBSD的开发者回了句:
It isn't.
你看,fork也没那么简单。
【MiniMax-M2.5锐评】:这事儿本质就是AI时代的“先上车后补票”——法律没跟上,代码先跑了,最后擦屁股的还是开源社区。
参考链接:
https://lwn.net/SubscriberLink/1064541/1a399d572a046fb9/