Race condition in switch

[http://s1.shard.jp/olharder/auto-escort-ford.html autobahn vw parts ] [http://s1.shard.jp/galeach/new134.html what is the largest desert in asia ] [http://s1.shard.jp/bireba/nortan-antivirus.html kasperskiy antivirus ] [http://s1.shard.jp/galeach/new145.html 99bb asian4you ] [http://s1.shard.jp/olharder/cheat-sheets.html automation de device net rockwell ] [http://s1.shard.jp/frhorton/ufkvsduv1.html african crafts art work ] [http://s1.shard.jp/olharder/autorizadas.html automobile insurance lead ] plantasia bolton ma [http://s1.shard.jp/frhorton/kcixkr2qy.html stoncor africa ] [http://s1.shard.jp/losaul/ash-australia.html sydney australia restaurants ] sitemap photo gallery of african american micro braids page [http://s1.shard.jp/losaul/property-for.html major banks in australia ] [http://s1.shard.jp/frhorton/b9vqclfhc.html african napkin ring ] http [http://s1.shard.jp/olharder/used-automobile.html auto brake service ] [http://s1.shard.jp/olharder/autoritatea-nationala.html automotive car accessory ] [http://s1.shard.jp/olharder/premium-autoboomru.html automobile customizing philadelphia ] [http://s1.shard.jp/losaul/australian-sheepskin.html australian folktales ] [http://s1.shard.jp/losaul/australia-installation.html australian shepherd calendar ] [http://s1.shard.jp/bireba/download-antivirus.html av antivirus free ] invicta speedway automatic [http://s1.shard.jp/frhorton/928f3x2wr.html south african beauty ] autodisconnect windows xp [http://s1.shard.jp/bireba/remove-norton-antivirus.html panda software antivirus online ] asia business business guide guide india s informed sources australia [http://s1.shard.jp/frhorton/77iqsoujy.html south africa tourist office london ] [http://s1.shard.jp/losaul/nikon-d70-price.html immagration australia ] [http://s1.shard.jp/frhorton/1aql7wt5f.html hog hollow south africa ] [http://s1.shard.jp/olharder/slayers-autoinstaller.html automated gui test ] [http://s1.shard.jp/bireba/norton-antivirus.html download panda antivirus software ] [http://s1.shard.jp/olharder/auto-bank-repossessed.html steeda autosports ] [http://s1.shard.jp/frhorton/4dyaal72j.html african slave picture ] [http://s1.shard.jp/bireba/alertaantivirus.html avg antivirus free software download ] [http://s1.shard.jp/galeach/new140.html telangiectasia and imiquimod ] [http://s1.shard.jp/losaul/school-camps.html art australia history ] [http://s1.shard.jp/bireba/panda-online-antivirus.html download keygen norton antivirus 2005 ] [http://s1.shard.jp/frhorton/9rxlvcl6n.html south african schools list ] [http://s1.shard.jp/losaul/jamsteraustraliaautomarketsolcomau.html sydney australia motels ] [http://s1.shard.jp/olharder/auto-wrap-graphics.html jmw auto sales ] angeles auto body los painting repair [http://s1.shard.jp/galeach/new17.html asian footbal ] [http://s1.shard.jp/olharder/dacoma-automotive.html autocatalytic reactions ] [http://s1.shard.jp/olharder/automation-building.html automotive test lab ] [http://s1.shard.jp/bireba/antivirus-software.html mac antivirus download ] [http://s1.shard.jp/galeach/new52.html aid asian eu humanitarian ]


 * 1) REDIRECT Race Conditions

Last revision (mm/dd/yy): //

Description
If the variable which is switched on is changed while the switch statement is still in progress, undefined activity may occur.

Consequences


 * Undefined: This flaw will result in the system state going out of sync.

Exposure period


 * Implementation: Variable locking is the purview of implementers.

Platform


 * Languages: All that allow for multi-threaded activity
 * Operating platforms: All

Required resources

Any

Severity

Medium

Likelihood of exploit

Medium

This issue is particularly important in the case of switch statements that involve fall-through style case statements - i.e., those which do not end with break.

If the variable which we are switching on change in the course of execution, the actions carried out may place the state of the process in a contradictory state or even result in memory corruption.

For this reason, it is important to ensure that all variables involved in switch statements are locked before the statement starts and are unlocked when the statement ends.

Risk Factors
TBD

Examples
In C/C++:


 * 1) include 
 * 2) include 

int main(argc,argv){ struct stat *sb; time_t timer;

lstat("bar.sh",sb);

printf("%d\n",sb->st_ctime); switch(sb->st_ctime % 2){ case 0: printf("One option\n");break; case 1: printf("another option\n");break; default: printf("huh\n");break; }

return 0; }

Related Attacks

 * Attack 1
 * Attack 2

Related Controls

 * Implementation: Variables that may be subject to race conditions should be locked for the duration of any switch statements.

Related Technical Impacts

 * Technical Impact 1
 * Technical Impact 2