CVE-2024-44952 - Improper Locking

Severity

55%

Complexity

18%

Confidentiality

60%

Rejected reason: This CVE ID has been rejected or withdrawn by its CVE Numbering Authority.

CVSS 3.1 Base Score 5.5. CVSS Attack Vector: local. CVSS Attack Complexity: low. CVSS Vector: (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).

Demo Examples

Improper Locking

CWE-667

In the following Java snippet, methods are defined to get and set a long field in an instance of a class that is shared across multiple threads. Because operations on double and long are nonatomic in Java, concurrent access may cause unexpected behavior. Thus, all operations on long and double fields should be synchronized.


               
}
return someLongValue;
someLongValue = l;

Improper Locking

CWE-667

This code tries to obtain a lock for a file, then writes to it.


               
fclose($logFile);
}//attempt to get logfile lock
flock($logfile, LOCK_UN);// unlock logfile
print "Could not obtain lock on logFile.log, message not recorded\n";

PHP by default will wait indefinitely until a file lock is released. If an attacker is able to obtain the file lock, this code will pause execution, possibly leading to denial of service for other users. Note that in this case, if an attacker can perform an flock() on the file, they may already have privileges to destroy the log file. However, this still impacts the execution of other programs that depend on flock().

Improper Locking

CWE-667

The following function attempts to acquire a lock in order to perform operations on a shared resource.


               
}
pthread_mutex_unlock(mutex);/* access shared resource */

However, the code does not check the value returned by pthread_mutex_lock() for errors. If pthread_mutex_lock() cannot acquire the mutex for any reason the function may introduce a race condition into the program and result in undefined behavior.

In order to avoid data races correctly written programs must check the result of thread synchronization functions and appropriately handle all errors, either by attempting to recover from them or reporting it to higher levels.


               
}
return pthread_mutex_unlock(mutex);
return result;
/* access shared resource */

Improper Locking

CWE-667

It may seem that the following bit of code achieves thread safety while avoiding unnecessary synchronization...


               
return helper;
}
}
helper = new Helper();

The programmer wants to guarantee that only one Helper() object is ever allocated, but does not want to pay the cost of synchronization every time this code is called.

Suppose that helper is not initialized. Then, thread A sees that helper==null and enters the synchronized block and begins to execute:


               
helper = new Helper();

If a second thread, thread B, takes over in the middle of this call and helper has not finished running the constructor, then thread B may make calls on helper while its fields hold incorrect values.

Overview

First reported 5 months ago

2024-09-04 19:15:00

Last updated 3 months ago

2024-11-09 10:15:00

Affected Software

Linux Kernel

References

https://git.kernel.org/stable/c/49ea4e0d862632d51667da5e7a9c88a560e9c5a1

https://git.kernel.org/stable/c/dd98c9630b7ee273da87e9a244f94ddf947161e2

https://git.kernel.org/stable/c/f098e8fc7227166206256c18d56ab622039108b1

https://git.kernel.org/stable/c/9c23fc327d6ec67629b4ad323bd64d3834c0417d

https://git.kernel.org/stable/c/4a7c2a8387524942171037e70b80e969c3b5c05b

https://git.kernel.org/stable/c/4d035c743c3e391728a6f81cbf0f7f9ca700cf62

https://git.kernel.org/stable/c/cd490a247ddf325325fd0de8898659400c9237ef

https://git.kernel.org/stable/c/15fffc6a5624b13b428bb1c6e9088e32a55eb82c

https://git.kernel.org/stable/c/49ea4e0d862632d51667da5e7a9c88a560e9c5a1

Patch

https://git.kernel.org/stable/c/dd98c9630b7ee273da87e9a244f94ddf947161e2

Patch

https://git.kernel.org/stable/c/f098e8fc7227166206256c18d56ab622039108b1

Patch

https://git.kernel.org/stable/c/9c23fc327d6ec67629b4ad323bd64d3834c0417d

Patch

https://git.kernel.org/stable/c/4a7c2a8387524942171037e70b80e969c3b5c05b

Patch

https://git.kernel.org/stable/c/4d035c743c3e391728a6f81cbf0f7f9ca700cf62

Patch

https://git.kernel.org/stable/c/cd490a247ddf325325fd0de8898659400c9237ef

Patch

https://git.kernel.org/stable/c/15fffc6a5624b13b428bb1c6e9088e32a55eb82c

Patch

https://git.kernel.org/stable/c/fe10c8367687c27172a10ba5cc849bd82077bd7d

https://git.kernel.org/stable/c/d4dba9a076838f3d0333a6a66efec2cdda90b2ee

https://git.kernel.org/stable/c/1cfc329304617838dc06f021bbbde3bc79cd655e

https://git.kernel.org/stable/c/4749d336170dbb629e515a857e58a82e61c37a9c

https://git.kernel.org/stable/c/92d847a35e1e41bceba13b8ac1f0e1b9dbe30d25

https://git.kernel.org/stable/c/fd28d9589460945985ef5333e9b942c4261f0826

https://git.kernel.org/stable/c/cfc72b86fa20cbf44d2b6cc27b35eb15080232ab

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.