Skip to content

Archive / page 13

All articles

Every practical article from the Nalar archive, newest first.

Software Engineering 19 Sep 2026 6 min read

Generation Counters Keep Reused Handles Bound to the Right Resource

A compact handle often looks like an integer because an integer is cheap to store, copy, compare, and pass across an API boundary. In a table-backed resource manager, that integer may simply be an index into a slot array. The representation works until a slot is released and later reused. An old handle can then point at a new resource that happens to occupy the same index. The failure is not an out-of-bounds access. The index can be perfectly valid. The problem is identity: the handle names a storage location, while the caller treats it as the identity of the resource that once occupied that location.

Cybersecurity 19 Sep 2026 6 min read

fscrypt Policies Bind Directory Trees to Filesystem Encryption Keys

A directory can remain fully visible in a mounted Linux filesystem while its regular-file contents and filenames are unusable without a particular key. With fscrypt, that boundary is attached to filesystem objects rather than created by mounting a second encrypted filesystem. An encryption policy assigned to an empty directory is inherited by regular files, directories, and symbolic links created beneath it. The property is narrower than full filesystem secrecy. fscrypt encrypts file contents and filenames, but most filesystem metadata remains visible, and ordinary permission checks continue to define who may access objects once the relevant key is present. Encryption policy and access control are therefore separate boundaries.

Cybersecurity 19 Sep 2026 7 min read

fs-verity Binds Read-Only File Reads to a Merkle-Tree Digest

A file can be stored on media that is less trusted than the process consuming it. Making that file read-only through ordinary permission bits does not prove that the bytes later returned from storage are the bytes that were approved earlier. Linux fs-verity addresses that narrower integrity boundary for supported filesystems by binding reads from an enabled file to a Merkle tree and a stable file digest. The mechanism has two distinct security roles. The kernel verifies file data against the Merkle tree during reads. A separate policy must establish that the resulting fs-verity digest is the digest that the system intended to trust. Treating those roles as one guarantee overstates what the filesystem feature provides.

Cybersecurity 19 Sep 2026 6 min read

Fetch Metadata Headers Define a Server-Side Cross-Site Request Boundary

A browser can send an authenticated request to a site from a document hosted somewhere else. Cookies may accompany that request according to their cookie attributes, while the same-origin policy can still prevent the initiating page from reading the response. For a server, that distinction matters: blocking response access does not necessarily stop a cross-site request from reaching an endpoint. Fetch Metadata adds request context to this boundary. Supporting user agents attach Sec-Fetch-* request headers that describe relationships and request properties the server can evaluate before application logic performs a sensitive action. A policy can reject a request because it is cross-site, while preserving selected navigation or public-resource flows.

Software Engineering 19 Sep 2026 6 min read

Fencing Tokens Reject Stale Writers After Lease Expiry

A distributed lease can transfer ownership without stopping the process that previously held it. A worker may pause long enough for its lease to expire, then resume after another worker has acquired the same lease. At that point both processes can execute code that was written under the assumption of exclusive ownership. Lease expiry settles ownership in the coordination service. It does not revoke CPU time, cancel an in-flight network request, or erase buffered I/O on the former holder. Fencing tokens address that gap by carrying an ordering value from the ownership decision to the resource being protected.

Software Engineering 19 Sep 2026 6 min read

Fencing Tokens Close the Stale Lease Writer Gap

A distributed lease can expire while its holder is unable to run. The holder may later resume with local state that still says it owns the lease, even though another client has already acquired a newer lease. If the protected storage or service accepts operations solely because the client once acquired the lease, two clients can mutate the same resource across different points in time. A fencing token moves the decisive check from lease ownership into the protected resource. Each successful acquisition receives a token ordered after every earlier token. The resource records the greatest accepted token and rejects operations carrying an older value. The lease still coordinates acquisition, but the token constrains what a delayed former holder can do after it resumes.

Software Engineering 19 Sep 2026 8 min read

FCM Is a Wake-Up Path, Not a Real-Time Transport

FCM Is a Wake-Up Path, Not a Real-Time Transport A mobile application can maintain a WebSocket while it is active and still need Firebase Cloud Messaging when the operating system suspends it. Those mechanisms solve different failure conditions. WebSocket, MQTT, and SignalR assume that a client can participate in a live communication session. FCM is useful precisely when that assumption no longer holds: the application may be backgrounded, its process may not be running, or its persistent connection may have disappeared.

Cybersecurity 19 Sep 2026 7 min read

fanotify Permission Events Put File Access Behind a User-Space Decision

A process can pass ordinary filesystem permission checks and still wait before its file operation completes. Linux fanotify permission events let a monitoring group intercept selected operations and require a user-space listener to return an allow or deny response. The mechanism inserts a synchronous decision point into the access path rather than merely reporting activity after it occurs. That distinction makes fanotify useful for security products that need content inspection or policy evaluation close to file access. It also creates a dependency that ordinary notification systems do not have: the kernel may be holding another process at a permission event while user space decides its fate.

Linux 19 Sep 2026 5 min read

eventfd Turns Kernel Notifications into Pollable Counters

A Linux process can signal work through a file descriptor without moving a byte stream between producer and consumer. eventfd() creates a kernel-maintained 64-bit counter whose readiness can be observed by poll(), select(), or epoll. A write adds to the counter; a read consumes its accumulated state according to the descriptor mode. That shape makes eventfd different from a pipe. A pipe preserves a sequence of bytes. An eventfd preserves counter state. When the application needs a wakeup edge plus a compact amount of accumulated state, that distinction removes buffering and framing that a byte stream would otherwise require.

Software Engineering 19 Sep 2026 6 min read

ETag Preconditions Prevent Lost Writes in HTTP Update APIs

Two clients can read the same resource, edit different fields, and send updates seconds apart. If the server accepts both writes without checking which representation each client edited, the later request can silently replace state written by the earlier one. The transport succeeded, yet the application lost a concurrent change. HTTP provides a conditional request mechanism for this boundary. A server can attach an entity tag to a representation, and a client can return that tag in If-Match when submitting a state-changing request. The update proceeds only while the selected representation still satisfies the supplied precondition.

Tech 19 Sep 2026 6 min read

ESP32-S3 HMI Performance Is Mostly a Memory-Bandwidth Problem

An ESP32-S3 can run a touchscreen HMI without a Linux-class processor, but CPU clock alone does not determine whether the interface feels responsive. Once a display uses a large framebuffer, the critical path includes memory capacity, PSRAM bandwidth, DMA traffic, pixel format, pixel clock, and the amount of the screen redrawn for each interaction. The ESP32-S3 combines a dual-core Xtensa LX7 CPU running up to 240 MHz with an LCD/camera peripheral, DMA support, Wi-Fi, Bluetooth LE, and external PSRAM options. That makes it a useful HMI controller, especially when the interface consists of controls, status indicators, charts, configuration pages, and moderate animation.

Tech 19 Sep 2026 5 min read

ESP32 MQTT Sensor State: Publishing DHT22 Temperature and Humidity as One JSON Message

A DHT22 read produces temperature and relative humidity from the same sampling event. Publishing them on separate MQTT topics works, but it also creates two independent message boundaries. A subscriber can receive the new temperature before the matching humidity value arrives. Putting both measurements in one payload preserves the relationship explicitly: {"temperature":25.34,"humidity":60.21} MQTT does not require JSON. The useful property here is that both measurements travel in one publication and can be treated as one sensor-state snapshot.

Cybersecurity 19 Sep 2026 6 min read

ESP32 MQTT over TLS: Transport Encryption and Broker Authentication Are Separate

An ESP32 that moves an MQTT connection from port 1883 to 8883 crosses more than a port boundary. The TCP stream is now expected to carry MQTT inside TLS. Data in transit is protected only when the TLS client also validates the broker certificate. MQTT username/password authentication is separate: credentials identify the client to the broker, while certificate validation identifies the broker to the ESP32. Calling this “MQTT with HTTPS” mixes two application protocols. MQTT does not become HTTP when TLS is added. MQTT can run over plain TCP or over a TLS-protected TCP connection.

Tech 19 Sep 2026 5 min read

ESP-IDF LCD APIs Depend on the Selected SoC Target

An ESP-IDF project can include esp_lcd_panel_io.h successfully and still fail on esp_lcd_i80_bus_config_t or esp_lcd_new_i80_bus(). That combination looks contradictory until the build target is taken into account. esp_lcd is a framework, not a promise that every ESP chip exposes every LCD transport. The selected SoC determines which low-level interfaces are compiled into the project. Panel-controller support, such as ILI9341, is another layer again. That distinction matters when moving code between ESP32 variants.

Software Engineering 19 Sep 2026 5 min read

EPOLLET Makes Readiness a State-Transition Contract

A descriptor registered with EPOLLET can remain readable after an event has been delivered without appearing again in the next epoll_wait(). The kernel reports a readiness transition; it does not promise to repeat the same notification merely because unread data remains. That distinction turns edge-triggered epoll into a state-transition contract between the kernel and the event loop. The consequence is structural. A handler cannot treat one event as permission for one read() and then return to the wait loop. With edge-triggered monitoring, the handler must account for all immediately available I/O state before relying on another transition.

Go 19 Sep 2026 7 min read

Email OTP in Go: Single-Use Codes, Expiration, and Replay Protection

Email OTP in Go: Single-Use Codes, Expiration, and Replay Protection An email OTP looks simple: generate six digits, send them, and compare what the user types. The security boundary is not the email API, though. It is the server-side challenge lifecycle. A correct implementation has to make the code unpredictable, expire it quickly, limit guesses, invalidate older challenges when appropriate, and guarantee that a successful code cannot be consumed twice. Those properties are different from TOTP, even though both mechanisms are commonly described as OTP.

Tech 19 Sep 2026 6 min read

Electrolytic Capacitor ESR Turns Ripple Current Into Heat

An aluminum electrolytic capacitor does not behave like an ideal capacitor. Its internal foil, electrolyte, tabs, and contacts add resistance, represented in a simple model as equivalent series resistance, or ESR. When AC ripple current flows through that resistance, the capacitor dissipates real power as heat. For power-supply filtering, this mechanism can matter as much as capacitance and voltage rating. A capacitor may have the expected number of microfarads and still run too hot if its ESR is too high for the ripple current imposed by the circuit.

Software Engineering 19 Sep 2026 5 min read

Edge-Triggered epoll Requires Draining Readiness to EAGAIN

With EPOLLET, an event loop can consume one notification, read only part of the available data, and then wait indefinitely even though unread bytes remain in the socket buffer. The descriptor is still ready, but no new readiness transition has occurred to generate another edge. That behavior makes edge-triggered epoll a contract between notification semantics and nonblocking I/O. The event says that readiness changed; it is not a promise that the kernel will keep repeating the same notification until the application finishes the work.

Tech 19 Sep 2026 6 min read

Driving an IR LED from an ESP-01: Current, Range, and Transistor Count

An ESP8266 ESP-01 can act as the controller for an infrared AC remote, but the GPIO should be treated as a logic source rather than as the power source for the IR LED. The useful design question is not whether the transmitter has one transistor or three. It is whether the driver can switch the required LED pulse current cleanly while preserving the carrier and protocol timing. That distinction also corrects a common assumption: a three-transistor circuit does not inherently transmit farther than a one-transistor circuit. A correctly sized single transistor or MOSFET can drive an IR LED effectively. Additional transistors only help when they perform a necessary circuit function.

Tech 19 Sep 2026 6 min read

Driving an ILI9341 SPI Display and Touch Controller from ESP32-S3

A 2.4-inch 240 × 320 TFT module built around the ILI9341 is a practical match for an ESP32-S3 because the display controller accepts a serial SPI interface. The module is not necessarily one device: a typical board can contain the ILI9341 for pixels, a separate resistive-touch controller, and sometimes a microSD socket. That distinction determines the wiring. The devices may share SPI clock and data lines, while each peripheral keeps its own chip-select signal.

Cybersecurity 19 Sep 2026 6 min read

DPoP Binds OAuth Tokens to Client Keys, Not to Client Identity

A bearer access token normally authorizes whichever party can present its value to a resource server. Copying the token can therefore move its authority away from the client that originally received it. OAuth 2.0 Demonstrating Proof of Possession, or DPoP, changes that property by binding a token to a public key and requiring a signed proof from the corresponding private key during presentation. That binding narrows one important failure mode, but it does not turn the key into a universal client identity. DPoP is an application-layer sender-constraining mechanism. Its guarantees depend on the token binding, proof validation, replay policy, TLS, and the security of the client execution context.

Cybersecurity 19 Sep 2026 7 min read

DNS Rebinding Preserves Web Origin While the Network Destination Changes

DNS Rebinding Preserves Web Origin While the Network Destination Changes A browser can treat two requests as same-origin even when the TCP connections behind them terminate at different IP addresses. The origin model is built from the URL scheme, host, and port. DNS resolution is a network operation beneath that identity. If a hostname resolves to one address and later resolves to another, the browser-facing origin can remain unchanged. DNS rebinding exploits that separation. An attacker-controlled hostname can initially resolve to an attacker-controlled server that delivers script, then later resolve to an address reachable from the victim’s network. Subject to browser, resolver, transport, and target-service behavior, subsequent requests for the same hostname can then cross a network boundary without becoming cross-origin in the browser’s origin model.

Software Engineering 19 Sep 2026 7 min read

Deadline Propagation Bounds Request Lifetime Across Service Calls

A request can stop being useful before every process handling it stops working. An HTTP client may give up after two seconds while an upstream service continues a database query, an RPC, and a retry sequence for several more seconds. Those operations still consume connections, CPU time, queue capacity, and downstream concurrency even though their result no longer has a recipient. A deadline makes that usefulness boundary explicit. Propagating it through nested calls gives participating components a common upper bound derived from the original request. This differs from assigning an independent timeout at every hop: local timeouts limit individual operations, while a propagated deadline limits the lifetime of the operation graph.

Cybersecurity 19 Sep 2026 6 min read

CSP Nonces Move Script Trust from Hostnames to Response Markup

CSP Nonces Move Script Trust from Hostnames to Response Markup A script policy based only on hostnames answers a coarse question: which network locations may supply JavaScript? That boundary becomes weak when an allowed origin hosts user-controlled files, JSONP-style endpoints, legacy script resources, or other content that was never intended to receive execution authority. A nonce-based Content Security Policy changes the unit of trust. Instead of granting execution authority to every script fetched from an approved host, the server places an unpredictable value in the policy and on the specific <script> elements authorized for that response. The browser checks that relationship before executing those elements.