Patchwork [5/6,dora] acpid: CVE-2011-1159

login
register
mail settings
Submitter Mark Hatle
Date Dec. 5, 2013, 11:01 p.m.
Message ID <d6c7cc6ad1c9852c4e056beac8ce03bf2d16bb52.1386284385.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/62959/
State New
Headers show

Comments

Mark Hatle - Dec. 5, 2013, 11:01 p.m.
From: Yue Tao <yue.tao@windriver.com>

acpid.c in acpid before 2.0.9 does not properly handle a situation in which
a process has connected to acpid.socket but is not reading any data, which
allows local users to cause a denial of service (daemon hang) via a crafted
application that performs a connect system call but no read system calls.

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-1159

Signed-off-by: Yue Tao <yue.tao@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/recipes-bsp/acpid/acpid.inc                      |  3 ++-
 meta/recipes-bsp/acpid/acpid/set_socket_noblock.patch | 10 ++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-bsp/acpid/acpid/set_socket_noblock.patch

Patch

diff --git a/meta/recipes-bsp/acpid/acpid.inc b/meta/recipes-bsp/acpid/acpid.inc
index 40293c5..a384265 100644
--- a/meta/recipes-bsp/acpid/acpid.inc
+++ b/meta/recipes-bsp/acpid/acpid.inc
@@ -6,7 +6,8 @@  LICENSE="GPLv2+"
 
 SECTION = "base"
 SRC_URI = "${SOURCEFORGE_MIRROR}/acpid/acpid-${PV}.tar.gz \
-           file://init"
+           file://init \
+           file://set_socket_noblock.patch "
 
 inherit update-rc.d
 
diff --git a/meta/recipes-bsp/acpid/acpid/set_socket_noblock.patch b/meta/recipes-bsp/acpid/acpid/set_socket_noblock.patch
new file mode 100644
index 0000000..54d6435
--- /dev/null
+++ b/meta/recipes-bsp/acpid/acpid/set_socket_noblock.patch
@@ -0,0 +1,10 @@ 
+--- a/acpid.c
++++ b/acpid.c
+@@ -307,6 +307,7 @@ main(int argc, char **argv)
+ 				non_root_clients++;
+ 			}
+ 			fcntl(cli_fd, F_SETFD, FD_CLOEXEC);
++			fcntl(cli_fd, F_SETFL, O_NONBLOCK);
+ 			snprintf(buf, sizeof(buf)-1, "%d[%d:%d]",
+ 				creds.pid, creds.uid, creds.gid);
+ 			acpid_add_client(cli_fd, buf);