mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Christian Melki <christian.melki@t2data.com>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] screen: Plug CVE-2023-24626.
Date: Mon, 24 Apr 2023 19:52:13 +0200	[thread overview]
Message-ID: <20230424175213.1378743-1-christian.melki@t2data.com> (raw)

Mishap with priviliged signal handling.
https://nvd.nist.gov/vuln/detail/CVE-2023-24626

* Provide patch as is for 4.9.0, including the whitespace touchup.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 ...al-sending-permission-check-on-faile.patch | 33 +++++++++++++++++++
 patches/screen-4.9.0/series                   |  3 +-
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 patches/screen-4.9.0/0004-fix-missing-signal-sending-permission-check-on-faile.patch

diff --git a/patches/screen-4.9.0/0004-fix-missing-signal-sending-permission-check-on-faile.patch b/patches/screen-4.9.0/0004-fix-missing-signal-sending-permission-check-on-faile.patch
new file mode 100644
index 000000000..1acd66a19
--- /dev/null
+++ b/patches/screen-4.9.0/0004-fix-missing-signal-sending-permission-check-on-faile.patch
@@ -0,0 +1,33 @@
+From: Alexander Naumov <alexander_naumov@opensuse.org>
+Date: Mon, 30 Jan 2023 17:22:25 +0200
+Subject: [PATCH] fix: missing signal sending permission check on failed query
+ messages
+
+Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
+---
+ socket.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/socket.c b/socket.c
+index bb68b35353b9..9d874457dfce 100644
+--- a/socket.c
++++ b/socket.c
+@@ -1285,11 +1285,16 @@ ReceiveMsg()
+           else
+             queryflag = -1;
+ 
+-          Kill(m.m.command.apid,
++          if (CheckPid(m.m.command.apid)) {
++            Msg(0, "Query attempt with bad pid(%d)!", m.m.command.apid);
++          }
++          else {
++            Kill(m.m.command.apid,
+                (queryflag >= 0)
+                    ? SIGCONT
+                    : SIG_BYE); /* Send SIG_BYE if an error happened */
+-          queryflag = -1;
++            queryflag = -1;
++          }
+         }
+         break;
+       case MSG_COMMAND:
diff --git a/patches/screen-4.9.0/series b/patches/screen-4.9.0/series
index bf7060df3..11f49d58e 100644
--- a/patches/screen-4.9.0/series
+++ b/patches/screen-4.9.0/series
@@ -3,4 +3,5 @@
 0001-comm.h-now-depends-on-term.h.patch
 0002-comm.h-needed-for-list_-display-generic-.o.patch
 0003-suppress_remap.patch
-# 086ac9b43abed5bb61eef564f1ac00d9  - git-ptx-patches magic
+0004-fix-missing-signal-sending-permission-check-on-faile.patch
+# d9101cb0610499bee9be456b4dc83845  - git-ptx-patches magic
-- 
2.34.1




             reply	other threads:[~2023-04-24 17:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-24 17:52 Christian Melki [this message]
2023-05-02  7:06 ` [ptxdist] [APPLIED] " Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230424175213.1378743-1-christian.melki@t2data.com \
    --to=christian.melki@t2data.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox