今日重点:💬 地道表达——内核邮件不全是公文腔。Christian Brauner 这封 「伪文件当存储」的 cover letter 在讲一个真实的提权漏洞,用的却是一套 带人味的表达:happily、fun examples、(is that a word?)、Fwiw。这类词不是花边——它们控制语气:让「我要封你的路」 这件得罪人的事,读起来像同事聊天。

💬 真实原文 · 从漏洞描述到吐槽

/ section
It's not just silly. It's abusable (is that a word?). Loop calls ->read_iter() and ->write_iter() of the backing file directly from its kworker which runs with kernel credentials. But pseudo files enforce part of their access rules at read and write against the caller. So dozens of sysfs ->show() and ->store() methods call capable(). But setting up a loop device requires no capabilities. It only requires access to the device nodes. So whoever has a loop device skips all of the capable() checks. A couple of fun examples:

① It's not just silly. It's abusable.——「这不只是犯傻,是可被利用」。 not just X. It's Y. 是递进句式的标准形态:先承认对方可能的轻视(silly), 再把严重性抬到下一级(abusable)。写安全报告时最好用的开场之一: 先自嘲,再警告。括号里的 (is that a word?)(这算个词吗?)是 自我吐槽式插入语——作者造了 abusable 这个词,顺手吐个槽。这种幽默在 内核邮件里很常见,作用是降低对抗感:他要禁掉一堆历史用法。

② A couple of fun examples:——「几个好玩的例子」。fun 在这里是反讽:后面举的每个例子都是提权漏洞(改 THP 设置、触发 MCE 杀进程)。用「好玩」形容「可怕」,是英文技术写作里的经典反差修辞。 a couple of(两三个)也是口语里比 several 更随意的量词。

③ skips all of the capable() checks——「跳过全部权限检查」。 skip 是「(本该做却)不经过」,比 bypass 口语; capable() 是内核的「进程是否有某 capability」检查函数。整句的主语 whoever has a loop device(谁拿着 loop 设备)也是口语化的 whoever 结构。

Aaaand zloop, the nvme target's file backend, the scsi target's fileio backend, fuse passthrough and the usb mass storage gadget have the same problem. erofs takes pseudo files as images for file-backed mounts as well. It reads them with the mounter's credentials though so that's just silly and not abusable. Fwiw, device mapper doesn't need anything. It only takes block devices.

④ Aaaand——拉长音的 and,纯口语书写。作用是把「受害者名单」用 拖长音的方式甩出来,读起来像叹气。正式文档里不用;邮件里常见,因为它传达了 作者的疲惫(「还有一堆呢」)。 ⑤ Fwiw = for what it's worth(不管有没有用/顺便一说)。缩写体在 内核邮件里高频出现(还有 imho、afaict、tbh、iirc)。Fwiw, device mapper doesn't need anything. = 「顺便说下,device mapper 不受影响」——用一个缩写 把「这不归我管」说得轻松。 ⑥ that's just silly and not abusable——「那只是犯傻,不能被利用」。 与开头的 It's not just silly. It's abusable. 首尾呼应:同一个句式, 反过来用,区分「糊弄」和「漏洞」。一套句式,两种判断——这种回环是 好文章的骨架。

✨ 辅助彩蛋(阅读)

/ column
Going read-only doesn't need to write anything. So ignore the errors from flushing and from freeing the COW and post-EOF blocks once xfs is shut down, also if the flush shut it down itself. The rest of xfs_remount_ro() copes with a shutdown like unmount does.

cope with(应付、扛住)是写「代码如何面对异常状态」时最自然的动词: The rest of xfs_remount_ro() copes with a shutdown like unmount does. = 「remount_ro 的剩余部分处理 shutdown 的方式和 unmount 一样」。 比 handles 多一层「在不利条件下还能运转」的含义——描述错误恢复路径时, 比 handle 精确。

✍️ 今日练习

/ column
✍️ 句式改写(英文作答):① 用「It's not just X. It's Y.」把你的一个 bug 描述升级成「不只是不好用,是危险」。② 把「顺便说下,这个驱动不受影响」用 Fwiw 开头写一句。③ 用 cope with 描述「suspend 路径要能应付设备无响应的情况」。
💡 显示答案
参考答案(仿写示范,言之成理即可):① It's not just an annoyance. It's a data-loss bug. / It's not just noisy. It's a use-after-free. ② Fwiw, the driver doesn't need any changes. ③ The suspend path must cope with a device that stops responding.
📖 原文:It's not just silly. It's abusable (is that a word?). ... A couple of fun examples: ... Fwiw, device mapper doesn't need anything. It only takes block devices.
📎 原文引用

Tone is a technique: self-deprecation before the alarm, a joke before the list of victims.

素材:lore.kernel.org 11-13/11-14 窗口(loop-pseudo v2 cover letter · xfs remount-ro 33/33)· 内核英语 · 每日一篇