Tag Archives: Linux

Retrieve PID from the packet in Unix domain socket – a complete use case for recvmsg()/sendmsg()

The original question was how to retrieve the PID of the packet (sender) in the Unix domain socket. As titled, the answer is recvmsg()/sendmsg(). However, the most useful information I could find online is Michael’s man7.org. People keep talking about … Continue reading

Posted in OS, Programming | Tagged , , , , , , | 1 Comment

Bash Hacking – bash2, add setting CPU affinity support to the Bash

This post is NOT initially designed for how to hack Bash. But it does tell the truth that hacking Bash is not that hard, by adding a useful feature to Bash itself – setting CPU affinity support. Have fun and … Continue reading

Posted in OS, Programming | Tagged , , , , , , | 4 Comments

Kernel Hacking – use crypto API in the IRQ context

After my first post about Linux kernel crypto API, I keep playing with kernel crypto API for DSA and RSA implementations (will talk about these in my future posts). The truth is crypto API is NOT designed for IRQ context. … Continue reading

Posted in OS, Security | Tagged , , , , | 1 Comment

Fedora 21 Workstation – some post installation issues after fedup from 20

Believe or not, Fedora’s release upgrade is always troublesome, partially because of the package management imposed, which is initially designed to ease the update for binaries. After the painful experience from Fedora 19 to 20, I have just gone thru … Continue reading

Posted in Linux Distro | Tagged , , , , , , , , , | Leave a comment

byte order – Linux kernel byte order APIs

Most of the time, user-space applications do not care about the endian of the running machine, like we call send() and recv() directly expecting the right order of the data and they work! However, things could be changed if you … Continue reading

Posted in OS, Programming | Tagged , , | 2 Comments

ksig – sending signals from the kernel space to the user space

While syscall kill() gives users the ability to send certain signal to certain process in the user space of Linux, the story is totally different if we want to send signals from the kernel space to the user space. After … Continue reading

Posted in Dave's Tools, OS, Programming | Tagged , , , | Leave a comment

KT – use kernel timers in the Linux kernel

Compared to start a timer directly in certain kernel thread which will make the thread sleep for a while, using a kernel timer may be much more desired without stopping the current working thread. This post demonstrates a live example … Continue reading

Posted in OS | Tagged , , | Leave a comment