Bug 2162120 (CVE-2023-0394) - CVE-2023-0394 kernel: NULL pointer dereference in rawv6_push_pending_frames
Summary: CVE-2023-0394 kernel: NULL pointer dereference in rawv6_push_pending_frames
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2023-0394
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 2162122 2162123 2162124 2162125
Blocks: 2162118
TreeView+ depends on / blocked
 
Reported: 2023-01-18 20:02 UTC by Rohit Keshri
Modified: 2024-02-13 01:11 UTC (History)
38 users (show)

Fixed In Version: Kernel 6.2 RC4
Doc Type: If docs needed, set a value
Doc Text:
A NULL pointer dereference flaw was found in rawv6_push_pending_frames in net/ipv6/raw.c in the network subcomponent in the Linux kernel. This flaw causes the system to crash.
Clone Of:
Environment:
Last Closed: 2023-05-16 22:49:21 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2023:2148 0 None None None 2023-05-09 07:12:50 UTC
Red Hat Product Errata RHSA-2023:2458 0 None None None 2023-05-09 07:51:22 UTC
Red Hat Product Errata RHSA-2023:2736 0 None None None 2023-05-16 08:06:10 UTC
Red Hat Product Errata RHSA-2023:2951 0 None None None 2023-05-16 08:34:53 UTC
Red Hat Product Errata RHSA-2024:0412 0 None None None 2024-01-24 16:43:11 UTC

Description Rohit Keshri 2023-01-18 20:02:59 UTC
A null pointer dereference in Linux kernel that affects multiple kernel versions.

The bug is in "rawv6_push_pending_frames" function in net/ipv6/raw.c.
According to Herbert Xu, who fixed the bug, the root cause is that
"total_len = inet_sk(sk)->cork.base.length" in this function also
counts the length of the extension header (+ the amount of valid data
in the socket cork queue). In the vulnerable version of the function,
it directly uses the length as the amount of data in the cork queue.
In the following code:

    struct sk_buff *csum_skb = NULL;
    ...
    skb_queue_walk(&sk->sk_write_queue, skb) {
        ...
        if (offset >= len) {
            offset -= len;
            continue;
        }
        csum_skb = skb;
    }
    skb = csum_skb;

If the `offset` is larger than the amount of data in the socket cork
queue but smaller than valid data length + extension header length,
then the loop shown above will always enter the "if (offset >= len)"
branch. As a result, csum_skb will never be set. Consequently, the
final skb variable will be set to NULL.

Null dereference happens in the following "skb_transport_offset(skb);" call.

Comment 11 errata-xmlrpc 2023-05-09 07:12:47 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2023:2148 https://access.redhat.com/errata/RHSA-2023:2148

Comment 12 errata-xmlrpc 2023-05-09 07:51:18 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2023:2458 https://access.redhat.com/errata/RHSA-2023:2458

Comment 13 errata-xmlrpc 2023-05-16 08:06:06 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2023:2736 https://access.redhat.com/errata/RHSA-2023:2736

Comment 14 errata-xmlrpc 2023-05-16 08:34:49 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2023:2951 https://access.redhat.com/errata/RHSA-2023:2951

Comment 15 Product Security DevOps Team 2023-05-16 22:49:17 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2023-0394

Comment 18 errata-xmlrpc 2024-01-24 16:43:07 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.6 Extended Update Support

Via RHSA-2024:0412 https://access.redhat.com/errata/RHSA-2024:0412


Note You need to log in before you can comment on or make changes to this bug.