Software patch

Also known as: patch

On this page 7

A software patch is a targeted change to existing software that fixes a defect, closes a security vulnerability or adjusts behavior without replacing the whole product. In software fundamentals, a patch is the smallest routine unit of maintenance: it modifies specific files, code or configuration in an installed version and usually raises the software version only at its lowest level.

The word comes from the physical practice of patching punched cards and tape, but today a patch is typically a signed package or a difference file applied by an updater. Developers also use the word for a text file that lists changes between two versions of source code.

How a software patch works

A patch describes what must change and where. For source code, a patch file lists removed and added lines with surrounding context, so a tool can apply the change even if nearby lines moved slightly. For installed programs, a patch either replaces whole files or applies a binary difference that rewrites only the changed bytes of an executable file or library.

Applying a patch normally follows a fixed sequence. The updater verifies the package signature, checks that the installed version matches the version the patch expects, stops affected processes, writes the changes and records the new version. Many patches also require a restart of the program or the system, because files in use cannot always be replaced while running.

The table shows the main ways a patch can be delivered.

FormWhat is changedTypical context
Source patchLines of source codeOpen source projects and code review
Binary patchBytes within compiled filesLarge desktop applications and games
File replacementWhole executables or librariesOperating system and driver updates
Configuration patchSettings or rule filesServers and security tools
HotpatchRunning code in memorySystems that cannot be restarted
Delivery forms of a software patch

Types of patches by purpose

Patches are classified by why they exist, and the purpose decides how urgently they should be applied. A security patch closes a vulnerability that attackers could exploit and usually deserves the fastest rollout. A bug fix corrects a software bug that causes wrong results, crashes or data loss. A performance patch improves speed or resource use without changing features.

Patch typeGoalTypical urgency
Security patchClose an exploitable vulnerabilityDays, or hours if actively exploited
Bug fixCorrect faulty behaviorNext maintenance window
Compatibility patchSupport new hardware or systemsBefore the dependency changes
Performance patchReduce resource use or latencyScheduled, low pressure
Emergency patchStop an active incidentImmediately, often out of schedule
Patch types and their urgency

Vendors often group many fixes into a cumulative update, which contains every earlier patch for that version. Cumulative packages simplify management because one install brings a system fully current, but they also make it harder to skip a single problematic fix.

Patch, update, upgrade and release

The words patch, update and upgrade overlap in daily speech, but they differ in scope and version impact. A patch fixes a specific problem within one version. An update may bundle patches with small improvements. An upgrade moves to a new major version with new features and possibly new licensing.

ChangeScopeTypical version changeRisk of side effects
PatchOne or few defectsPatch level, such as 4.2.1 to 4.2.2Low
UpdateFixes plus small featuresMinor level, such as 4.2 to 4.3Moderate
UpgradeNew major versionMajor level, such as 4 to 5Higher
Service packLarge bundle of patchesOften a named packageModerate
How a patch compares with related changes

In semantic versioning, the last number of a three-part version is formally named the patch number. It signals that the change is backward compatible and fixes problems without altering the public interface.

Patch management in practice

In organizations, patch management is the repeatable process of finding, testing, deploying and verifying patches across many systems. The core trade-off is speed versus stability: delaying a patch leaves a known vulnerability open, while rushing it can break business applications.

  1. Inventory all software and versions, because unknown software cannot be patched.
  2. Assess each patch by severity, exposure and the importance of affected systems.
  3. Test on representative machines, including key applications and configuration files.
  4. Deploy in rings, starting with a small group before the whole fleet.
  5. Verify that the new version is installed and that services behave normally.

Many teams set target windows, such as critical patches within days and routine patches within a monthly cycle. Exact targets vary by regulation, risk appetite and system type.

Risks and common mistakes

A patch is itself new code, so it can introduce regressions: new bugs in features that worked before. The most common mistakes are organizational rather than technical.

MistakeConsequenceBetter practice
Patching without testingBroken applications after deploymentTest in a staging group first
Ignoring third-party softwareVulnerable libraries remainTrack every component, not just the system
No rollback planLong outage if a patch failsKeep backups or snapshots
Postponing restartsPatch installed but not activeSchedule restarts and verify
Patching mistakes and how to avoid them

Two further risks deserve attention. Unsigned or tampered patches from unofficial sources can deliver malware instead of fixes, so patches should come only through trusted channels with verified signatures. And on systems that are no longer supported, no patches arrive at all, which means the only lasting fix is to migrate to a supported version.

Put simply

A software patch is like a repair kit for a program you already have. Instead of buying a new car when a part fails, a mechanic replaces only that part. A patch does the same for software: it fixes the broken piece and leaves the rest alone.

The main lesson is simple: install patches promptly, especially security ones, because they often close doors that criminals already know how to open.

In practice

A regional hospital runs about 900 workstations and 60 servers. One Tuesday, the vendor of its web browser publishes a security patch for a vulnerability already used in attacks. The IT team rates it critical because staff browse external sites every day.

The team deploys the patch first to 30 machines in the IT department, checks that the clinical portal and the scheduling application still work, and then rolls it out to all workstations within 48 hours. Monitoring shows that 14 machines did not restart, so the patch was installed but not active; an automatic restart prompt fixes them the next morning. The result is full coverage within three days without any disruption to patient care.