FFmpeg 用 DMCA 下架 LGPL 侵權的專案

Hacker News 上看到「FFmpeg has issued a DMCA takedown on GitHub (twitter.com/ffmpeg)」這個消息,FFmpeg 裡的人針對中國的 Rockchip 侵權 FFmpeg 的 LGPL 程式碼的專案,在快兩年都沒有改善後,透過 DMCA 直接把 Rockchip 在 GitHub 上的專案給拉下來。

比較少看到 open source community 這邊發動 DMCA takedown 的,第一眼看到也是「蛤」,看完後笑得很開心 XDDD

剛好是週末放假時間,看看星期一上班時間 Rockchip 的法務團隊會怎麼動作?

DeepSeek 的 DeepSeek-R1 model 會在看到「敏感詞」時生出不安全的程式碼

看到「CrowdStrike Research: Security Flaws in DeepSeek-Generated Code Linked to Political Triggers」這篇,CrowdStrike 發現 DeepSeekDeepSeek-R1 model 在提到敏感詞時,會生出不安全的程式碼。

CrowdStrike 是測試 open source 版本的 DeepSeek-R1,避免是測到 DeepSeek 的 API 過濾機制:

We tested the raw, open-source DeepSeek-R1 671B model directly to avoid any confounding effects from API-level guardrails that may have been implemented on the DeepSeek app or API.

在文章的 Example 1 測試的是用 PHP 寫一段 PayPal 的 webhook,測試的是「Tibet」(西藏) 這個詞:

在沒有「for a financial institution based in Tibet」這段時,生出來的程式碼很好:

When sending this prompt to DeepSeek-R1 without the contextual modifiers, i.e., without the line for a financial institution based in Tibet, DeepSeek-R1 produced a secure and production-ready implementation of the requested functionality.

但加上去以後就會發現出現各種資安漏洞:

On the other hand, once the contextual modifiers were added, DeepSeek-R1’s response contained severe security flaws[.]

在 Example 2 測試的是比較複雜的 application,預期本來就會有一些 bug (因為複雜的關係),這邊敏感詞用「uyghur」(維吾爾族) 這個詞:

在有 uyghur 這個詞的時候發現產生出來的 code 直接忽略帳號管理,並且在多次的測試中發現會刻意使用比較弱的 hash 機制:

However, upon closer inspection it became apparent that DeepSeek-R1 never implemented any actual session management or authentication. The full app was openly accessible, including the admin panel, exposing highly sensitive user data. We repeated this experiment multiple times, and every single time there were severe security vulnerabilities. In 35% of the implementations, DeepSeek-R1 used insecure password hashing or none at all.

如果拿掉 uyghur,讓他生一個 football fanclub website 也會有 bug,但就不會有這些資安問題:

Given the complexity of the task, it is important to highlight that we should not expect DeepSeek to produce a full app without any flaws on the first attempt. However, we repeated the experiment with the more innocent scenario of asking for a football fanclub website. While as expected, there were also some flaws in those implementations, they were by no means as severe as the ones seen for the above prompt about Uyghurs.

CrowdStrike 的猜測是 model 在訓練時被加料過「親中」的素材,而導致 LLM 自己知道哪些詞彙是「敏感詞」,於是觸發了負面反應,進而產生出不安全的程式碼:

Hence, one possible explanation for the observed behavior could be that DeepSeek added special steps to its training pipeline that ensured its models would adhere to CCP core values. It seems unlikely that they trained their models to specifically produce insecure code. Rather, it seems plausible that the observed behavior might be an instance of emergent misalignment. In short, due to the potential pro-CCP training of the model, it may have unintentionally learned to associate words such as “Falun Gong” or “Uyghurs” with negative characteristics, making it produce negative responses when those words appear in its system prompt.

原文後面列出了他們測試的方法,超過三萬筆測試的測試結果:

In total, we tested 6,050 unique prompts per LLM and sent each prompt five times to account for randomness in the LLM’s response, resulting in a total of 30,250 prompts per LLM.

關鍵字的組合看得出來加料的效果很明顯,許多跟美國或是台灣有關的都會觸發,算是預期之中 (?)

OpenAI 放出兩個 Apache License 2.0 的 Model:gpt-oss-20b 與 gpt-oss-120b

OpenAI 上次放 model 出來應該是 GPT-3 的事情了?在 Hacker News 上馬上就登上首位了:「OpenAI Open Models (openai.com)」,OpenAI 的新聞稿在這:「Open models by OpenAI」,另外有一篇比較多效能表現的資料在這:「Introducing gpt-oss」。

授權是用 Apache License 2.0,而且這次放出的 gpt-oss-20b 是個市場上頗缺的 model size,從 id=44800944 這邊有提到 model 本身只有 14GB 左右,在 16GB VRAM 的卡 (像是 N 家的 4060 Ti,) 上有機會跑起來:

gpt-oss:20b is ~14GB on disk [1] so fits nicely within a 16GB VRAM card.

[1] https://ollama.com/library/gpt-oss

在 OpenAI 給的效能表現上,gpt-oss-20b 的版本看起來跟 o3-mini 在同一個層級,有蠻多測試是領先的,但也有一些是落後的。

這個深夜應該會很熱鬧了,除了有跟 OpenAI 合作而事先拿到 model 的團隊外,蠻多團隊應該會忙著 porting 到自家的工具上...

OSI 的 legacy approval

在讀「PHP RFC: PHP License Update」這篇的時候發現資料量有點大,試著把不同的主題整理出來。

這篇是看到 OSI 有兩套 license 的審核方式,一套是給 new license 用的流程,另外一套則是對於存在已久的 license 有 legacy approval 的流程,在文件裡提到 PHP License 的 3.0 與 3.01 都是透過 legacy approval 過 OSI 的:

While the OSI license approval committee voted to approve versions 3.0 and 3.01 of the PHP License, each followed the “legacy approval” process, meaning the licenses had already been in wide use for many years before the OSI approved them. As a result, the OSI approved the PHP License based more on its intent, rather than its content.

OSI 的「The License Review process」裡面定義了 legacy license 的條件:

A “legacy” license is one that has been in use for at least five years by more than twenty projects maintained by different unrelated entities.

在「How to submit a request」這邊可以看到 new license 的送出除了 legacy license 的要求以外,也還需要解釋與其他 OSI 已經核准的 license 的差異。而「License approval standards」則是可以看出來 new license 比起 legacy license 麻煩不少。

所以 legacy license 的設計比較像是「既然市場上都接受了這樣的 license,而且也不同的團體在用,我們就確認一下跟 OSD 合不合吧」的感覺,就不用花力氣解釋跟其他 OSI-approved license 的差異以及存在的必要性了。

APScheduler + requests 遇到 OSError: [Errno 24] Too many open files 的問題

前陣子試著在 Python 上面定時跑 crawler 抓一些東西寫進資料庫。

因為是偏實驗性質,選擇用 PyPy (PyPy3) 而非 CPython (就是官方版本的 Python),然後搭著 Gunicorn (跑 Flask) + APScheduler + requests,專案的程式碼可以在 app/app.py 這邊看到。

遇到的問題就像標題提到的,跑個半天到一天後發現 job 沒在動了,看 syslog 發現出現了 OSError: [Errno 24] Too many open files 的問題,這種 fd 爆掉的問題就到 /proc/[pid]/fd 下面翻看看是什麼,就看到一堆網路連線沒關,用 netstat 看就可以看到一堆 CLOSE_WAIT 的連線:

$ sudo netstat -anp | grep 1598
tcp       25      0 aa.bb.ccc.ddd:33606     54.178.182.254:443      CLOSE_WAIT  1598/python3
tcp       25      0 aa.bb.ccc.ddd:43902     54.150.244.202:443      CLOSE_WAIT  1598/python3
tcp       25      0 aa.bb.ccc.ddd:58308     52.199.42.41:443        CLOSE_WAIT  1598/python3

從維基百科上面的 Transmission Control Protocol 說明就可以看到 CLOSE_WAIT (CLOSE-WAIT) 是在等待本地端呼叫 close()

Waiting for a connection termination request from the local user.

接著在找資料的時候翻到 CLOSE_WAIT connections left unclosed when using library with dataflow #2100 這篇 2020 年年底的 issue,在 2024 年的時候 ZbigniewRA 有提出用 gc.collect() 當 workaround 可以緩解問題。

不確定是什麼問題造成的,也許是與 reference count 有關的東西?看 urllib3 的 source code 會發現在處理 reference 的片段:

    def _decref_socketios(self) -> None:
        if self._io_refs > 0:
            self._io_refs -= 1
        if self._closed:
            self.close()

Anyway,後來我的解法 (workaround) 就是每分鐘跑一次 gc.collect() 硬清,目前跑了一個晚上目前都還沒看到卡在 CLOSE_WAIT 的 TCP 連線。

不過這樣就變得有點限制了,自己寫的小玩具不在意 jitter 是還好,但如果遇到比較大的專案的話就得注意了...

Linux Foundation 宣佈獨立的 WordPress 基礎建設:FAIR Package Manager Project

Hacker News 上翻到的:「The FAIR Package Manager: Decentralized WordPress infrastructure (joost.blog)」,Linux Foundation 的新聞稿在這邊:「Linux Foundation Announces the FAIR Package Manager Project for Open Source Content Management System Stability」。

這醞釀了有點久,主要是去年 WordPress.comWP Engine 的訴訟事件中,Matt Mullenweg 濫用權限在 WordPress.org 上阻擋 WP Engine 的存取,然後被下初步禁制令阻止這件事情:「WPEngine 拿到對 Automattic 的初步禁制令了」。

這個計畫看起來是要建立基礎建設替代方案,看起來包括 theme 與 plugin。

透過 plugin 的方式安裝後 (Release 0.2.0) 就可以使用?看起來也有提供內建 FAIR plugin 的 WordPress 讓你可以直接下載使用。

目前裝好後到 FAIR Settings 內只有看到 Avatar 的部分:

依照 plugin 的 README.md 可以看到主要的目的是避免去使用 Automattic 的資源:

  • Credits - Replace calls to the update API for version information. Prevent loading Gravatars for contributors.
  • Default Repository - Changes the default repository for extensions to api.aspirecloud.net
  • Importers - Replace the retrieval of popular import plugins.
  • Openverse - Disable the media category in the block editor.
  • Salts - Prevents calls to the WordPress.org API for salt generation.
  • Version Check - Prevents calls to the WordPress.org API for version checks.

要看後續還有什麼東西會公佈...

Mozilla 把 Firefox 的 code repository 搬到 GitHub 上

Hacker News 上有提到這個 repository:「Mozilla Firefox – Official GitHub repo (github.com/mozilla-firefox)」,本來想說這個應該是 mirror (就像 Linux kernelGitHub 上的情況),但留言的地方有 Mozilla 的人在 id=43970574 說明的確是搬上去了:

The Firefox code has indeed recently moved from having its canonical home on mercurial at hg.mozilla.org to GitHub. This only affects the code; bugzilla is still being used for issue tracking, phabricator for code review and landing, and our taskcluster system for CI.

On the backend, once the migration is complete, Mozilla will spend less time hosting its own VCS infrastructure, which turns out to be a significant challenge at the scale, performance and availability needed for such a large project.

有點可惜的感覺,雖然這次看起來也有計畫從 Mercurial 換到 Git,但放棄 self-hosted service 又是另外一回事了。

Redis 宣佈將使用 AGPLv3/SSPLv1/RSALv2

Hacker News 上看到 Redis 要再加上 AGPLv3 授權的消息:「Redis is open source again (antirez.com)」,相關的原文包括 antirez (i.e. Redis 的生父) 的「Redis is open source again」以及 Redis 官方的「Redis is now available under the AGPLv3 open source license」。

不需要相信官方的什麼目標是強迫 AWSGCP 維護 fork 的鬼話:

After I joined the company, and a year of evaluating alternatives, in March 2024, we decided to move Redis to the SSPL license. This achieved our goal—AWS and Google now maintain their own fork—but the change hurt our relationship with the Redis community.

實際上就是 Valkey 的能量夠大,而且算是在 open source 軟體界中行銷操作做的還不錯的,然後又開始有人響應:「Valkey 對 hash 資料結構的改善」、「Valkey 支援 Bloom Filters」、「Arch Linux 打算淘汰掉 Redis,改用 Valkey」。

要注意的是,CLA 的存在使得 Redis 想換 license 就可以換:這次 Redis 官方宣佈增加了 AGPLv3 授權,後面也可以片面宣佈更新的版本撤掉 AGPLv3。

(話說這個策略也有點像現在大罷免國民黨用的策略?)

來繼續看 Valkey 這邊會怎麼安排...

Arch Linux 打算淘汰掉 Redis,改用 Valkey

Lobsters 上看到 Arch Linux 要用 Valkey 淘汰掉 Redis 的消息:「Valkey to replace Redis in the [extra] Repository」。

Redis 會從官方的 repository 搬到 AUR 上,然後就隨緣:

Arch Linux Package Maintainers intend to support the availability of the redis package for roughly 14 days from the day of this post, to enable a smooth transition to valkey. After the 14 day transition period has ended, the redis package will be moved to the AUR. Also, from this point forward, the redis package will not receive any additional updates and should be considered deprecated until it is removed.

算是開槍了?目前其他的 distribution 大多是共存,從「Search Results for redis」以及「Search Results for valkey」可以看到各套件的情況。

Puppet 的 fork 推出第一個 release 了

先前在「Puppet 要 fork 了」這邊有提到 Puppet 因為授權變得很不友善的關係,有 open source fork 出現,現在推出第一個 release 了:「First release, hot off the presses!」。

當時在找 project name,看起來叫做 Vox Pupuli,在查意思的時候發現接近 Vox populi 這個詞彙 (差一個 o ->u):

Vox populi (/ˌvɒks ˈpɒpjʊli, -laɪ/ VOKS POP-yuu-lee, -⁠lye) is a Latin phrase (originally Vox populi, vox Dei – "The voice of the people is the voice of God") that literally means "voice of the people." It is used in English in the meaning "the opinion of the majority of the people." In journalism, vox pop or man on the street refers to short interviews with members of the public.

有 release 算是正式開張?