Wednesday, January 23, 2019

Word of the Day: race condition

Word of the Day WhatIs.com
Daily updates on the latest technology terms | January 23, 2019
race condition

A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time, but because of the nature of the device or system, the operations must be done in the proper sequence to be done correctly.

A simple example of a race condition is a light switch. In some homes there are multiple light switches connected to a common ceiling light. When these types of circuits are used, the switch position becomes irrelevant. If the light is on, moving either switch from its current position turns the light off. Similarly, if the light is off, then moving either switch from its current position turns the light on. With that in mind, imagine what might happen if two people tried to turn on the light using two different switches at exactly the same time. One instruction might cancel the other or the two actions might trip the circuit breaker.

Race conditions are most commonly associated with computer science. In computer memory or storage, a race condition may occur if commands to read and write a large amount of data are received at almost the same instant, and the machine attempts to overwrite some or all of the old data while that old data is still being read. The result may be one or more of the following: a computer crash, an "illegal operation," notification and shutdown of the program, errors reading the old data or errors writing the new data. A race condition can also occur if instructions are processed in the incorrect order.

Suppose for a moment that two processes need to perform a bit flip at a specific memory location. Under normal circumstances the operation should work like this:

Process 1 Process 2 Memory Value
Read value
 
0
Flip value
 
1
 
Read value
1
 
Flip value
0

 

In this example, Process 1 performs a bit flip, changing the memory value from 0 to 1. Process 2 then performs a bit flip and changes the memory value from 1 to 0.

If a race condition occurred causing these two processes to overlap, the sequence could potentially look more like this:

Process 1 Process 2 Memory Value
Read value
 
0
Read value
0
Flip value
1
 
Flip value
1

In this example, the bit has an ending value of 1 when its value should be 0. This occurs because Process 2 is unaware that Process 1 is performing a simultaneous bit flip.

Preventing race conditions

In computing environments, race conditions can be prevented by serialization of memory or storage access. This means if read and write commands are received close together, the read command is executed and completed first by default.

In a network, a race condition may occur if two users attempt to access an available channel at the same instant, and neither computer receives notification the channel is occupied before the system grants access. Statistically, this kind of coincidence will most likely occur in networks with long lag times, such as those that use geostationary satellites. To prevent such a race condition from developing, a priority scheme must be devised. For example, the subscriber whose username begins with the earlier letter of the alphabet (or the lower numeral) may get priority by default when two subscribers attempt to access the system within a prescribed increment of time. Hackers can take advantage of race-condition vulnerabilities to gain unauthorized access to networks.

Race conditions occasionally occur in logic gates when certain inputs come into conflict. Because the gate output state takes a finite, nonzero amount of time to react to any change in input states, sensitive circuits or devices following the gate may be fooled by the state of the output, and thereby not operate properly.

Quote of the Day

 
"Race conditions are notoriously difficult to find, reproduce and debug. They are usually only found by accident when a system becomes overloaded in a manner unforeseen by the programmer." - Michael Cobb

Learning Center

 

How were Android Pixel vulnerabilities exploited?
Android Pixel vulnerabilities enabled the smartphone to be hacked last year. Here's a look at how someone was able to bypass the phone's security and what can be done about it.

What went wrong with the Dirty COW vulnerability patch?
The Dirty COW vulnerability was patched, but researchers discovered issues with the patch. Here's a look at what went wrong and what users should do.

Static code analyzer tests for dangerous race conditions
The Coverty Prevent SQS static code analyzer helps developers identify race conditions and other concurrency defects in multi-threaded applications earlier in the development cycle.

How can the Dirty COW vulnerability be used to attack Android devices?
The Dirty COW vulnerability, which remained hidden for nine years, allows attackers to gain root access to Android devices. Find out how this attack works.

How can a directory traversal attack be mitigated?
New research showed AirDrop-enabled devices are vulnerable to a directory traversal attack. Here's what the threat means for enterprise security teams.

Quiz Yourself

 
Exploit kits allow non-technical threat actors to do ____ of damage.
A. a lot
B. alot

Answer

Stay in Touch

 
For feedback about any of our definitions or to suggest a new definition, please contact me at: mrouse@techtarget.com

Visit the Word of the Day Archives and catch up on what you've missed!

FOLLOW US

TwitterRSS
About This E-Newsletter
This e-newsletter is published by the TechTarget network. To unsubscribe from Whatis.com, click here. Please note, this will not affect any other subscriptions you have signed up for.
TechTarget

TechTarget, Whatis, 275 Grove Street, Newton, MA 02466. Contact: webmaster@techtarget.com

Copyright 2018 TechTarget. All rights reserved.

No comments: