Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame^] | 1 | From e9ad41bfedb4537a6f0de20f00b27c7739f168f7 Mon Sep 17 00:00:00 2001 |
| 2 | From: Alexander Naumov <alexander_naumov@opensuse.org> |
| 3 | Date: Mon, 30 Jan 2023 17:22:25 +0200 |
| 4 | Subject: fix: missing signal sending permission check on failed query messages |
| 5 | |
| 6 | Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org> |
| 7 | |
| 8 | CVE: CVE-2023-24626 |
| 9 | Upstream-Status: Backport |
| 10 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
| 11 | --- |
| 12 | src/socket.c | 9 +++++++-- |
| 13 | 1 file changed, 7 insertions(+), 2 deletions(-) |
| 14 | |
| 15 | diff --git a/src/socket.c b/src/socket.c |
| 16 | index 147dc54..54d8cb8 100644 |
| 17 | --- a/socket.c |
| 18 | +++ b/socket.c |
| 19 | @@ -1285,11 +1285,16 @@ ReceiveMsg() |
| 20 | else |
| 21 | queryflag = -1; |
| 22 | |
| 23 | - Kill(m.m.command.apid, |
| 24 | + if (CheckPid(m.m.command.apid)) { |
| 25 | + Msg(0, "Query attempt with bad pid(%d)!", m.m.command.apid); |
| 26 | + } |
| 27 | + else { |
| 28 | + Kill(m.m.command.apid, |
| 29 | (queryflag >= 0) |
| 30 | ? SIGCONT |
| 31 | : SIG_BYE); /* Send SIG_BYE if an error happened */ |
| 32 | - queryflag = -1; |
| 33 | + queryflag = -1; |
| 34 | + } |
| 35 | } |
| 36 | break; |
| 37 | case MSG_COMMAND: |
| 38 | -- |
| 39 | cgit v1.1 |
| 40 | |