CVE-2018-10938 - Loop with Unreachable Exit Condition ('Infinite Loop')

Severity

71%

Complexity

86%

Confidentiality

115%

A flaw was found in the Linux kernel present since v4.0-rc1 and through v4.13-rc4. A crafted network packet sent remotely by an attacker may force the kernel to enter an infinite loop in the cipso_v4_optptr() function in net/ipv4/cipso_ipv4.c leading to a denial-of-service. A certain non-default configuration of LSM (Linux Security Module) and NetLabel should be set up on a system before an attacker could leverage this flaw.

A flaw was found in the Linux kernel present since v4.0-rc1 and through v4.13-rc4. A crafted network packet sent remotely by an attacker may force the kernel to enter an infinite loop in the cipso_v4_optptr() function in net/ipv4/cipso_ipv4.c leading to a denial-of-service. A certain non-default configuration of LSM (Linux Security Module) and NetLabel should be set up on a system before an attacker could leverage this flaw.

CVSS 3.0 Base Score 5.9. CVSS Attack Vector: network. CVSS Attack Complexity: high. CVSS Vector: (CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H).

CVSS 2.0 Base Score 7.1. CVSS Attack Vector: network. CVSS Attack Complexity: medium. CVSS Vector: (AV:N/AC:M/Au:N/C:N/I:N/A:C).

Demo Examples

Loop with Unreachable Exit Condition ('Infinite Loop')

CWE-835

In the following code the method processMessagesFromServer attempts to establish a connection to a server and read and process messages from the server. The method uses a do/while loop to continue trying to establish the connection to the server when an attempt fails.


               
}
...// create socket to connect to server
}// establish connection to server// if connected then read and process messages from server
...// read and process messages
// keep trying to establish connection to the server// close socket and return success or failure

However, this will create an infinite loop if the server does not respond. This infinite loop will consume system resources and can be used to create a denial of service attack. To resolve this a counter should be used to limit the number of attempts to establish a connection to the server, as in the following code.


               
}
...// initialize number of attempts counter
}// establish connection to server// increment counter// if connected then read and process messages from server
...// read and process messages
// keep trying to establish connection to the server// up to a maximum number of attempts// close socket and return success or failure

Loop with Unreachable Exit Condition ('Infinite Loop')

CWE-835

For this example the method isReorderNeeded as part of a bookstore application that determines if a particular book needs to be reordered based on the current inventory count and the rate at which the book is being sold.


               
}
return isReorder;// get inventory count for book// find number of days until inventory count reaches minimum
days++;
// if number of days within reorder timeframe// set reorder return boolean to true
isReorder = true;

However, the while loop will become an infinite loop if the rateSold input parameter has a value of zero since the inventoryCount will never fall below the minimumCount. In this case the input parameter should be validated to ensure that a value of zero does not cause an infinite loop,as in the following code.


               
}
...// validate rateSold variable
return isReorder;

Overview

Type

Linux

First reported 6 years ago

2018-08-27 13:29:00

Last updated 5 years ago

2019-10-03 00:03:00

Affected Software

Linux Kernel 4.0

4.0

Linux Kernel 4.0 Release Candidate 5

4.0

Linux Kernel 4.1

4.1

Linux Kernel 4.1 Release Candidate 1

4.1

Linux Kernel 4.1 Release Candidate 2

4.1

Linux Kernel 4.1 Release Candidate 3

4.1

Linux Kernel 4.1 Release Candidate 4

4.1

Linux Kernel 4.1 Release Candidate 5

4.1

Linux Kernel 4.1 Release Candidate 6

4.1

Linux Kernel 4.1 Release Candidate 7

4.1

Linux Kernel 4.1 Release Candidate 8

4.1

Linux Kernel 4.2

4.2

Linux Kernel 4.2 Release Candidate 1

4.2

Linux Kernel 4.2 Release Candidate 2

4.2

Linux Kernel 4.2 Release Candidate 3

4.2

Linux Kernel 4.2 Release Candidate 4

4.2

Linux Kernel 4.2 Release Candidate 5

4.2

Linux Kernel 4.2 Release Candidate 6

4.2

Linux Kernel 4.2 Release Candidate 7

4.2

Linux Kernel 4.2 Release Candidate 8

4.2

Linux Kernel 4.3

4.3

Linux Kernel 4.3 Release Candidate 1

4.3

Linux Kernel 4.3 Release Candidate 2

4.3

Linux Kernel 4.3 Release Candidate 3

4.3

Linux Kernel 4.3 Release Candidate 4

4.3

Linux Kernel 4.3 Release Candidate 5

4.3

Linux Kernel 4.3 Release Candidate 6

4.3

Linux Kernel 4.3 Release Candidate 7

4.3

Linux Kernel 4.4

4.4

Linux Kernel 4.4 Release Candidate 8

4.4

Linux Kernel 4.5

4.5

Linux Kernel 4.5 Release Candidate 3

4.5

Linux Kernel 4.5 Release Candidate 4

4.5

Linux Kernel 4.6

4.6

Linux Kernel 4.7

4.7

Linux Kernel 4.7 Release Candidate 1

4.7

Linux Kernel 4.7 Release Candidate 2

4.7

Linux Kernel 4.7 Release Candidate 3

4.7

Linux Kernel 4.7 Release Candidate 4

4.7

Linux Kernel 4.7 Release Candidate 5

4.7

Linux Kernel 4.7 Release Candidate 6

4.7

Linux Kernel 4.7 Release Candidate 7

4.7

Linux Kernel 4.8

4.8

Linux Kernel 4.8 Release Candidate 5

4.8

Linux Kernel 4.8 Release Candidate 6

4.8

Linux Kernel 4.9

4.9

Linux Kernel 4.9 Release Candidate 1

4.9

Linux Kernel 4.9 Release Candidate 2

4.9

Linux Kernel 4.9 Release Candidate 3

4.9

Linux Kernel 4.9 Release Candidate 4

4.9

Linux Kernel 4.9 Release Candidate 5

4.9

Linux Kernel 4.9 Release Candidate 6

4.9

Linux Kernel 4.9 Release Candidate 7

4.9

Linux Kernel 4.9 Release Candidate 8

4.9

Linux Kernel 4.10

4.10

Linux Kernel 4.10 Release Candidate 3

4.10

Linux Kernel 4.10 Release Candidate 4

4.10

Linux Kernel 4.11

4.11

Linux Linux Kernel 4.11 Release Candidate 1

4.11

Linux Linux Kernel 4.11 Release Candidate 2

4.11

Linux Linux Kernel 4.11 Release Candidate 3

4.11

Linux Linux Kernel 4.11 Release Candidate 4

4.11

Linux Linux Kernel 4.11 Release Candidate 5

4.11

Linux Linux Kernel 4.11 Release Candidate 6

4.11

Linux Linux Kernel 4.11 Release Candidate 7

4.11

Linux Kernel 4.12

4.12

Linux Kernel 4.12 Release Candidate 1

4.12

Linux Kernel 4.12 Release Candidate 2

4.12

Linux Kernel 4.12 Release Candidate 3

4.12

Linux Kernel 4.12 Release Candidate 4

4.12

Linux Kernel 4.12 Release Candidate 5

4.12

Linux Kernel 4.12 Release Candidate 6

4.12

Linux Kernel 4.13 Release Candidate 1

4.13

Linux Kernel 4.13 Release Candidate 2

4.13

Linux Kernel 4.13 Release Candidate 3

4.13

Linux Kernel 4.13 Release Candidate 4

4.13

Canonical Ubuntu Linux 14.04 LTS (Long-Term Support)

14.04

Canonical Ubuntu Linux 16.04 LTS (Long-Term Support)

16.04

Debian Linux 9.0

9.0

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.