summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authordrochner <drochner>2008-05-28 15:39:55 +0000
committerdrochner <drochner>2008-05-28 15:39:55 +0000
commit8d5a7602acb9a5f5b22283432d3824c1e02f295e (patch)
tree9ecd9fc2a63a3a2d4583d103e86cfd0c3767994a /net
parent7ff3f84730f5f3d4dc751e95471cf4773e586e32 (diff)
downloadpkgsrc-8d5a7602acb9a5f5b22283432d3824c1e02f295e.tar.gz
add patches from redhat bugzilla (#446724) to fix CVE-2008-1105
(heap buffer overflow in client code) bump PKGREVISION
Diffstat (limited to 'net')
-rw-r--r--net/samba/Makefile3
-rw-r--r--net/samba/distinfo8
-rw-r--r--net/samba/patches/patch-ea13
-rw-r--r--net/samba/patches/patch-eb13
-rw-r--r--net/samba/patches/patch-ec68
-rw-r--r--net/samba/patches/patch-ed38
-rw-r--r--net/samba/patches/patch-ee14
-rw-r--r--net/samba/patches/patch-ef22
8 files changed, 177 insertions, 2 deletions
diff --git a/net/samba/Makefile b/net/samba/Makefile
index 76dbdeab250..67d025243e4 100644
--- a/net/samba/Makefile
+++ b/net/samba/Makefile
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.181 2008/04/12 22:43:08 jlam Exp $
+# $NetBSD: Makefile,v 1.182 2008/05/28 15:39:55 drochner Exp $
.include "Makefile.mirrors"
DISTNAME= samba-${VERSION}
+PKGREVISION= 1
CATEGORIES= net
MASTER_SITES= ${SAMBA_MIRRORS:=old-versions/}
diff --git a/net/samba/distinfo b/net/samba/distinfo
index 55553edfe2e..74483418a3a 100644
--- a/net/samba/distinfo
+++ b/net/samba/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.61 2008/04/03 20:19:42 jlam Exp $
+$NetBSD: distinfo,v 1.62 2008/05/28 15:39:55 drochner Exp $
SHA1 (samba-3.0.28a.tar.gz) = b4829b133af3865f6518bae14af4d989b6f1c31a
RMD160 (samba-3.0.28a.tar.gz) = 646680c49fd56d98430d325884a5911d406e13be
@@ -40,3 +40,9 @@ SHA1 (patch-cg) = 2755a019759826a39c3e201f6a0d1646e6dd2fba
SHA1 (patch-ch) = 3c4c404519154e294cee134ddb4d2b9c7d8e02a2
SHA1 (patch-da) = 2dddd250b2207d658b02ff43b46199ce4305b7f8
SHA1 (patch-db) = a43800408fae9bc2bfdd0db4d481dda6b936778b
+SHA1 (patch-ea) = 22ca7f088703ad11ba92b61afdf79b2b9cb0fd16
+SHA1 (patch-eb) = ee8b9e5daa2611e21eb9767fcdbabcbf779112de
+SHA1 (patch-ec) = bee1ce2c1ad1e7a98dff053774bb8aee00411389
+SHA1 (patch-ed) = cdeae921837f36ae87aba1b6a8a7d1ebdc84ae9c
+SHA1 (patch-ee) = 89ce3342fe7f0d83f738f4450f84ec91e7fed276
+SHA1 (patch-ef) = f15af3dfd6c8894713fe7e435a458b4a43c84035
diff --git a/net/samba/patches/patch-ea b/net/samba/patches/patch-ea
new file mode 100644
index 00000000000..40360fc77d2
--- /dev/null
+++ b/net/samba/patches/patch-ea
@@ -0,0 +1,13 @@
+$NetBSD: patch-ea,v 1.1 2008/05/28 15:39:55 drochner Exp $
+
+--- client/client.c.orig 2008-03-08 16:56:26.000000000 +0100
++++ client/client.c
+@@ -3626,7 +3626,7 @@ static void readline_callback(void)
+ session keepalives and then drop them here.
+ */
+ if (FD_ISSET(cli->fd,&fds)) {
+- if (!receive_smb(cli->fd,cli->inbuf,0)) {
++ if (!receive_smb(cli->fd,cli->inbuf,cli->bufsize,0)) {
+ DEBUG(0, ("Read from server failed, maybe it closed the "
+ "connection\n"));
+ return;
diff --git a/net/samba/patches/patch-eb b/net/samba/patches/patch-eb
new file mode 100644
index 00000000000..151957b7ffa
--- /dev/null
+++ b/net/samba/patches/patch-eb
@@ -0,0 +1,13 @@
+$NetBSD: patch-eb,v 1.1 2008/05/28 15:39:55 drochner Exp $
+
+--- client/smbctool.c.orig 2008-03-08 16:33:34.000000000 +0100
++++ client/smbctool.c
+@@ -3304,7 +3304,7 @@ static void readline_callback(void)
+ session keepalives and then drop them here.
+ */
+ if (FD_ISSET(cli->fd,&fds)) {
+- receive_smb(cli->fd,cli->inbuf,0);
++ receive_smb(cli->fd,cli->inbuf,cli->bufsize,0);
+ goto again;
+ }
+
diff --git a/net/samba/patches/patch-ec b/net/samba/patches/patch-ec
new file mode 100644
index 00000000000..ac9a039b841
--- /dev/null
+++ b/net/samba/patches/patch-ec
@@ -0,0 +1,68 @@
+$NetBSD: patch-ec,v 1.1 2008/05/28 15:39:55 drochner Exp $
+
+--- lib/util_sock.c.orig 2008-03-08 16:33:34.000000000 +0100
++++ lib/util_sock.c
+@@ -654,14 +654,13 @@ ssize_t read_smb_length(int fd, char *in
+ }
+
+ /****************************************************************************
+- Read an smb from a fd. Note that the buffer *MUST* be of size
+- BUFFER_SIZE+SAFETY_MARGIN.
++ Read an smb from a fd.
+ The timeout is in milliseconds.
+ This function will return on receipt of a session keepalive packet.
+ Doesn't check the MAC on signed packets.
+ ****************************************************************************/
+
+-BOOL receive_smb_raw(int fd, char *buffer, unsigned int timeout)
++BOOL receive_smb_raw(int fd, char *buffer, size_t buflen, unsigned int timeout)
+ {
+ ssize_t len,ret;
+
+@@ -682,25 +681,18 @@ BOOL receive_smb_raw(int fd, char *buffe
+ return False;
+ }
+
+- /*
+- * A WRITEX with CAP_LARGE_WRITEX can be 64k worth of data plus 65 bytes
+- * of header. Don't print the error if this fits.... JRA.
+- */
+-
+- if (len > (BUFFER_SIZE + LARGE_WRITEX_HDR_SIZE)) {
++ if (len > buflen) {
+ DEBUG(0,("Invalid packet length! (%lu bytes).\n",(unsigned long)len));
+- if (len > BUFFER_SIZE + (SAFETY_MARGIN/2)) {
+
+- /*
+- * Correct fix. smb_read_error may have already been
+- * set. Only set it here if not already set. Global
+- * variables still suck :-). JRA.
+- */
++ /*
++ * smb_read_error may have already been
++ * set. Only set it here if not already set. Global
++ * variables still suck :-). JRA.
++ */
+
+- if (smb_read_error == 0)
+- smb_read_error = READ_ERROR;
+- return False;
+- }
++ if (smb_read_error == 0)
++ smb_read_error = READ_ERROR;
++ return False;
+ }
+
+ if(len > 0) {
+@@ -730,9 +722,9 @@ BOOL receive_smb_raw(int fd, char *buffe
+ Checks the MAC on signed packets.
+ ****************************************************************************/
+
+-BOOL receive_smb(int fd, char *buffer, unsigned int timeout)
++BOOL receive_smb(int fd, char *buffer, size_t buflen, unsigned int timeout)
+ {
+- if (!receive_smb_raw(fd, buffer, timeout)) {
++ if (!receive_smb_raw(fd, buffer, buflen, timeout)) {
+ return False;
+ }
+
diff --git a/net/samba/patches/patch-ed b/net/samba/patches/patch-ed
new file mode 100644
index 00000000000..8b0431892a5
--- /dev/null
+++ b/net/samba/patches/patch-ed
@@ -0,0 +1,38 @@
+$NetBSD: patch-ed,v 1.1 2008/05/28 15:39:55 drochner Exp $
+
+--- libsmb/clientgen.c.orig 2008-03-08 16:33:35.000000000 +0100
++++ libsmb/clientgen.c
+@@ -44,8 +44,7 @@ int cli_set_port(struct cli_state *cli,
+ }
+
+ /****************************************************************************
+- Read an smb from a fd ignoring all keepalive packets. Note that the buffer
+- *MUST* be of size BUFFER_SIZE+SAFETY_MARGIN.
++ Read an smb from a fd ignoring all keepalive packets.
+ The timeout is in milliseconds
+
+ This is exactly the same as receive_smb except that it never returns
+@@ -54,12 +53,12 @@ int cli_set_port(struct cli_state *cli,
+ should never go into a blocking read.
+ ****************************************************************************/
+
+-static BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout)
++static BOOL client_receive_smb(int fd,char *buffer, size_t bufsize, unsigned int timeout)
+ {
+ BOOL ret;
+
+ for(;;) {
+- ret = receive_smb_raw(fd, buffer, timeout);
++ ret = receive_smb_raw(fd, buffer, bufsize, timeout);
+
+ if (!ret) {
+ DEBUG(10,("client_receive_smb failed\n"));
+@@ -88,7 +87,7 @@ BOOL cli_receive_smb(struct cli_state *c
+ return False;
+
+ again:
+- ret = client_receive_smb(cli->fd,cli->inbuf,cli->timeout);
++ ret = client_receive_smb(cli->fd,cli->inbuf, cli->bufsize, cli->timeout);
+
+ if (ret) {
+ /* it might be an oplock break request */
diff --git a/net/samba/patches/patch-ee b/net/samba/patches/patch-ee
new file mode 100644
index 00000000000..31282da4e66
--- /dev/null
+++ b/net/samba/patches/patch-ee
@@ -0,0 +1,14 @@
+$NetBSD: patch-ee,v 1.1 2008/05/28 15:39:55 drochner Exp $
+
+--- smbd/process.c.orig 2008-03-08 16:33:36.000000000 +0100
++++ smbd/process.c
+@@ -521,7 +521,8 @@ static BOOL receive_message_or_smb(char
+ goto again;
+ }
+
+- return receive_smb(smbd_server_fd(), buffer, 0);
++ return receive_smb(smbd_server_fd(), buffer,
++ BUFFER_SIZE + LARGE_WRITEX_HDR_SIZE, 0);
+ }
+
+ /*
diff --git a/net/samba/patches/patch-ef b/net/samba/patches/patch-ef
new file mode 100644
index 00000000000..3645657913f
--- /dev/null
+++ b/net/samba/patches/patch-ef
@@ -0,0 +1,22 @@
+$NetBSD: patch-ef,v 1.1 2008/05/28 15:39:55 drochner Exp $
+
+--- utils/smbfilter.c.orig 2008-03-08 16:33:37.000000000 +0100
++++ utils/smbfilter.c
+@@ -140,7 +140,7 @@ static void filter_child(int c, struct i
+ if (num <= 0) continue;
+
+ if (c != -1 && FD_ISSET(c, &fds)) {
+- if (!receive_smb(c, packet, 0)) {
++ if (!receive_smb(c, packet, BUFFER_SIZE, 0)) {
+ d_printf("client closed connection\n");
+ exit(0);
+ }
+@@ -151,7 +151,7 @@ static void filter_child(int c, struct i
+ }
+ }
+ if (s != -1 && FD_ISSET(s, &fds)) {
+- if (!receive_smb(s, packet, 0)) {
++ if (!receive_smb(s, packet, BUFFER_SIZE, 0)) {
+ d_printf("server closed connection\n");
+ exit(0);
+ }