]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ping: Fix handling of IP packet sizes
authorTom Jones <thj@FreeBSD.org>
Thu, 17 Nov 2022 10:31:38 +0000 (10:31 +0000)
committerGordon Tetlow <gordon@FreeBSD.org>
Tue, 29 Nov 2022 23:00:43 +0000 (15:00 -0800)
commit66c7b53d9516b10adc39861647fe6e179f0fa7a6
treed83681ae0e56dbccea41f87c6eac86aae9f06686
parent95499c45614ce0e397b54d7e551881b5800facba
ping: Fix handling of IP packet sizes

Ping reads raw IP packets to parse ICMP responses. When reading the
IP Header Len (IHL) ping was was taking the value from the provided
packet without any validation. This could lead to remotely triggerable
stack corruption.

Validate the IHL against expected and recieved data sizes when reading
from the received packet and when reading any quoted packets from within
the ICMP response.

Approved by: so
Reviewed by: markj, asomers
Security: FreeBSD-SA-22:15.ping
Security: CVE-2022-23093
Sponsored by:   NetApp, Inc.
Sponsored by:   Klara, Inc.
X-NetApp-PR:    #77
Differential Revision: https://reviews.freebsd.org/D37195

(cherry picked from commit 46d7b45a267b3d78c5054b210ff7b6c55bfca42b)
(cherry picked from commit 186f495d4be12a9184d2b11183c55b27b879765f)
sbin/ping/ping.c