diff options
author | Andreas Metzler <ametzler@debian.org> | 2011-02-13 17:00:55 +0000 |
---|---|---|
committer | Andreas Metzler <ametzler@debian.org> | 2011-02-13 17:00:55 +0000 |
commit | bd6be1bda74da531275c2c2fab5ef3212af5236e (patch) | |
tree | 27598627a115a193924d8fd080740b3bbf71f7bc | |
parent | 7611c2190fdd213706b8d6fbd853d5a6f652f766 (diff) | |
download | exim4-bd6be1bda74da531275c2c2fab5ef3212af5236e.tar.gz |
Cleanup after merge from branches/branch-4.73: Drop patches pulled from upstream to trunk after branch off
svn path=/exim/trunk/; revision=2582
-rw-r--r-- | debian/patches/80_4.74_CVE-2011-0017.patch | 110 | ||||
-rw-r--r-- | debian/patches/80_4.74_deliverylogging.patch | 29 | ||||
-rw-r--r-- | debian/patches/80_4.74_filtertesting.diff | 29 |
3 files changed, 0 insertions, 168 deletions
diff --git a/debian/patches/80_4.74_CVE-2011-0017.patch b/debian/patches/80_4.74_CVE-2011-0017.patch deleted file mode 100644 index 31db134..0000000 --- a/debian/patches/80_4.74_CVE-2011-0017.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 1670ef10063d7708eb736a482d1ad25b9c59521d Mon Sep 17 00:00:00 2001 -From: Phil Pennock <pdp@exim.org> -Date: Fri, 21 Jan 2011 03:56:02 -0500 -Subject: Check return values of setgid/setuid. - -CVE-2011-0017 - -One assertion of the unimportance of checking the return value was wrong, -in the event of a compromised exim run-time user. ---- -diff -NurBbp exim-4.72.orig/src/exim.c exim-4.72/src/exim.c ---- exim-4.72.orig/src/exim.c 2009-11-16 20:50:36.000000000 +0100 -+++ exim-4.72/src/exim.c 2011-01-21 19:28:00.000000000 +0100 -@@ -1309,7 +1309,7 @@ int arg_error_handling = error_handling - int filter_sfd = -1; - int filter_ufd = -1; - int group_count; --int i; -+int i, rv; - int list_queue_option = 0; - int msg_action = 0; - int msg_action_arg = -1; -@@ -1628,8 +1628,20 @@ real_gid = getgid(); - - if (real_uid == root_uid) - { -- setgid(real_gid); -- setuid(real_uid); -+ rv = setgid(real_gid); -+ if (rv) -+ { -+ fprintf(stderr, "exim: setgid(%ld) failed: %s\n", -+ (long int)real_gid, strerror(errno)); -+ exit(EXIT_FAILURE); -+ } -+ rv = setuid(real_uid); -+ if (rv) -+ { -+ fprintf(stderr, "exim: setuid(%ld) failed: %s\n", -+ (long int)real_uid, strerror(errno)); -+ exit(EXIT_FAILURE); -+ } - } - - /* If neither the original real uid nor the original euid was root, Exim is -@@ -3746,7 +3758,28 @@ if (!unprivileged && - - /* When we are retaining a privileged uid, we still change to the exim gid. */ - --else setgid(exim_gid); -+else -+ { -+ int rv; -+ rv = setgid(exim_gid); -+ /* Impact of failure is that some stuff might end up with an incorrect group. -+ We track this for failures from root, since any attempt to change privilege -+ by root should succeed and failures should be examined. For non-root, -+ there's no security risk. For me, it's { exim -bV } on a just-built binary, -+ no need to complain then. */ -+ if (rv == -1) -+ { -+ if (!unprivileged) -+ { -+ fprintf(stderr, -+ "exim: changing group failed: %s\n", strerror(errno)); -+ exit(EXIT_FAILURE); -+ } -+ else -+ debug_printf("changing group to %ld failed: %s\n", -+ (long int)exim_gid, strerror(errno)); -+ } -+ } - - /* Handle a request to list the delivery queue */ - -diff -NurBbp exim-4.72.orig/src/log.c exim-4.72/src/log.c ---- exim-4.72.orig/src/log.c 2009-11-16 20:50:37.000000000 +0100 -+++ exim-4.72/src/log.c 2011-01-21 19:28:00.000000000 +0100 -@@ -343,17 +343,26 @@ are neither exim nor root, creation is n - - else if (euid == root_uid) - { -- int status; -+ int status, rv; - pid_t pid = fork(); - - /* In the subprocess, change uid/gid and do the creation. Return 0 from the -- subprocess on success. There doesn't seem much point in testing for setgid -- and setuid errors. */ -+ subprocess on success. If we don't check for setuid failures, then the file -+ can be created as root, so vulnerabilities which cause setuid to fail mean -+ that the Exim user can use symlinks to cause a file to be opened/created as -+ root. We always open for append, so can't nuke existing content but it would -+ still be Rather Bad. */ - - if (pid == 0) - { -- (void)setgid(exim_gid); -- (void)setuid(exim_uid); -+ rv = setgid(exim_gid); -+ if (rv) -+ die(US"exim: setgid for log-file creation failed, aborting", -+ US"Unexpected log failure, please try later"); -+ rv = setuid(exim_uid); -+ if (rv) -+ die(US"exim: setuid for log-file creation failed, aborting", -+ US"Unexpected log failure, please try later"); - _exit((create_log(buffer) < 0)? 1 : 0); - } - diff --git a/debian/patches/80_4.74_deliverylogging.patch b/debian/patches/80_4.74_deliverylogging.patch deleted file mode 100644 index d3569a8..0000000 --- a/debian/patches/80_4.74_deliverylogging.patch +++ /dev/null @@ -1,29 +0,0 @@ -From b7487bcec431809cb7fc3c2b42fcd607e43d37e7 Mon Sep 17 00:00:00 2001 -From: Phil Pennock <pdp@exim.org> -Date: Sun, 23 Jan 2011 05:44:45 -0500 -Subject: [PATCH 1/2] Bug 1071: fix delivery logging with untrusted macros. - -If dropping privileges for untrusted macros, we disabled normal logging -on the basis that it would fail; for the Exim run-time user, this is not -the case, and it resulted in successful deliveries going unlogged. - - -diff -NurBbp a/src/exim.c b/src/exim.c ---- a/src/exim.c 2011-01-29 14:20:00.000000000 +0100 -+++ b/src/exim.c 2011-01-29 14:20:37.000000000 +0100 -@@ -3426,9 +3426,13 @@ if (( - and should be used for any logging information because attempts to write - to the log will usually fail. To arrange this, we unset really_exim. However, - if no stderr is available there is no point - we might as well have a go -- at the log (if it fails, syslog will be written). */ -+ at the log (if it fails, syslog will be written). - -- if (log_stderr != NULL) really_exim = FALSE; -+ Note that if the invoker is Exim, the logs remain available. Messing with -+ this causes unlogged successful deliveries. */ -+ -+ if ((log_stderr != NULL) && (real_uid != exim_uid)) -+ really_exim = FALSE; - } - - /* Privilege is to be retained for the moment. It may be dropped later, diff --git a/debian/patches/80_4.74_filtertesting.diff b/debian/patches/80_4.74_filtertesting.diff deleted file mode 100644 index 4c1cbda..0000000 --- a/debian/patches/80_4.74_filtertesting.diff +++ /dev/null @@ -1,29 +0,0 @@ -From 33191679e1a86ba6d9c38a74d0795d00c300f2c5 Mon Sep 17 00:00:00 2001 -From: Phil Pennock <pdp@exim.org> -Date: Fri, 21 Jan 2011 06:10:35 -0500 -Subject: [PATCH] Tests compat. setgid failure / dropped_privilege - -If we've *dropped* privilege, it's okay to not abort if setgid fails. - - -diff --git a/src/exim.c b/src/exim.c -index 67fbc5c..c8a5da1 100644 ---- a/src/exim.c -+++ b/src/exim.c -@@ -3885,14 +3885,14 @@ else - no need to complain then. */ - if (rv == -1) - { -- if (!unprivileged) -+ if (!(unprivileged || removed_privilege)) - { - fprintf(stderr, - "exim: changing group failed: %s\n", strerror(errno)); - exit(EXIT_FAILURE); - } - else -- debug_printf("changing group to %ld failed: %s\n", -+ DEBUG(D_any) debug_printf("changing group to %ld failed: %s\n", - (long int)exim_gid, strerror(errno)); - } - } |