[SCM] Samba Shared Repository - branch v4-5-stable updated
Karolin Seeger
kseeger at samba.org
Wed Sep 20 07:19:39 UTC 2017
The branch, v4-5-stable has been updated
via f261c9a VERSION: Disable GIT_SNAPSHOTS for the 4.5.14 release.
via bb90fee WHATSNEW: Add release notes for Samba 4.5.14.
via b5178cb selftest: make samba3.blackbox.smbclient_s3.*follow.symlinks.*no as flapping
via a43b36f CVE-2017-12163: s3:smbd: Prevent client short SMB1 write from writing server memory to file.
via 157f2a7 CVE-2017-12151: s3:libsmb: make use of cli_state_is_encryption_on()
via 282a1d1 CVE-2017-12151: s3:libsmb: add cli_state_is_encryption_on() helper function
via 609e6b0 CVE-2017-12150: s3:libsmb: only fallback to anonymous if authentication was not requested
via f30ea84 CVE-2017-12150: libcli/smb: add smbXcli_conn_signing_mandatory()
via dc24ef0 CVE-2017-12150: auth/credentials: cli_credentials_authentication_requested() should check for NTLM_CCACHE/SIGN/SEAL
via 5d296e6 CVE-2017-12150: libgpo: make use of SMB_SIGNING_REQUIRED in gpo_connect_server()
via f82c235 CVE-2017-12150: s3:pylibsmb: make use of SMB_SIGNING_DEFAULT for 'samba.samba3.libsmb_samba_internal'
via f14a94b CVE-2017-12150: s3:lib: get_cmdline_auth_info_signing_state smb_encrypt SMB_SIGNING_REQUIRED
via 5c645ed VERSION: Bump version up to 4.5.14...
from 3c9bc04 VERSION: Disable GIT_SNAPSHOTS for the 4.5.13 release.
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-5-stable
- Log -----------------------------------------------------------------
commit f261c9a5ef07a0a4230b891b2585c5f21945e196
Author: Karolin Seeger <kseeger at samba.org>
Date: Wed Sep 13 09:42:04 2017 -0700
VERSION: Disable GIT_SNAPSHOTS for the 4.5.14 release.
Signed-off-by: Karolin Seeger <kseeger at samba.org>
commit bb90fee8f63afa6b9f77f892810e19b153239f24
Author: Karolin Seeger <kseeger at samba.org>
Date: Wed Sep 13 09:39:40 2017 -0700
WHATSNEW: Add release notes for Samba 4.5.14.
Signed-off-by: Karolin Seeger <kseeger at samba.org>
commit b5178cb03bf66ccfed4d6b68b5df5f5626f64801
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 12 05:21:35 2017 +0200
selftest: make samba3.blackbox.smbclient_s3.*follow.symlinks.*no as flapping
This is fixed in master and 4.7. For the backports we can just ignore
failures.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12914
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit a43b36f5514de38b8a072bfbeb172316045c2ad0
Author: Jeremy Allison <jra at samba.org>
Date: Fri Sep 8 10:13:14 2017 -0700
CVE-2017-12163: s3:smbd: Prevent client short SMB1 write from writing server memory to file.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13020
Signed-off-by: Jeremy Allison <jra at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit 157f2a703bcaca9495d50cbd4d48c24b1ceed80d
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat Dec 17 10:36:49 2016 +0100
CVE-2017-12151: s3:libsmb: make use of cli_state_is_encryption_on()
This will keep enforced encryption across dfs referrals.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12996
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit 282a1d122f9861b0521fa5a389ad467f8da93bd1
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Aug 14 12:13:18 2017 +0200
CVE-2017-12151: s3:libsmb: add cli_state_is_encryption_on() helper function
This allows to check if the current cli_state uses encryption
(either via unix extentions or via SMB3).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12996
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit 609e6b09feb4b00ee52db4a9df258cb9061f4ad8
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 12 06:07:56 2016 +0100
CVE-2017-12150: s3:libsmb: only fallback to anonymous if authentication was not requested
With forced encryption or required signing we should also don't fallback.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12997
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit f30ea84489e9ee6ab65279bc3ea62ce4f954f965
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Aug 29 15:35:49 2017 +0200
CVE-2017-12150: libcli/smb: add smbXcli_conn_signing_mandatory()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12997
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit dc24ef0fc4292a365900270d6b9b66c9cfc0609e
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Aug 29 15:24:14 2017 +0200
CVE-2017-12150: auth/credentials: cli_credentials_authentication_requested() should check for NTLM_CCACHE/SIGN/SEAL
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12997
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit 5d296e6ea32ca2df035dd35e6f21b82390f87f86
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Dec 12 05:49:46 2016 +0100
CVE-2017-12150: libgpo: make use of SMB_SIGNING_REQUIRED in gpo_connect_server()
It's important that we use a signed connection to get the GPOs!
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12997
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit f82c235484d03e22ad78a79e9cf2f14c8455df56
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Dec 9 09:26:32 2016 +0100
CVE-2017-12150: s3:pylibsmb: make use of SMB_SIGNING_DEFAULT for 'samba.samba3.libsmb_samba_internal'
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12997
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit f14a94b5cd3e9977e8483e8a6ba06f48045edc15
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Nov 3 17:16:43 2016 +0100
CVE-2017-12150: s3:lib: get_cmdline_auth_info_signing_state smb_encrypt SMB_SIGNING_REQUIRED
This is an addition to the fixes for CVE-2015-5296.
It applies to smb2mount -e, smbcacls -e and smbcquotas -e.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12997
Signed-off-by: Stefan Metzmacher <metze at samba.org>
-----------------------------------------------------------------------
Summary of changes:
VERSION | 2 +-
WHATSNEW.txt | 78 +++++++++++++++++++++++++++++++++++++++--
auth/credentials/credentials.c | 16 +++++++++
libcli/smb/smbXcli_base.c | 5 +++
libcli/smb/smbXcli_base.h | 1 +
libgpo/gpo_fetch.c | 2 +-
selftest/flapping | 1 +
source3/lib/util_cmdline.c | 3 ++
source3/libsmb/clidfs.c | 6 ++--
source3/libsmb/clientgen.c | 13 +++++++
source3/libsmb/libsmb_context.c | 2 +-
source3/libsmb/proto.h | 1 +
source3/libsmb/pylibsmb.c | 2 +-
source3/smbd/reply.c | 50 ++++++++++++++++++++++++++
14 files changed, 174 insertions(+), 8 deletions(-)
Changeset truncated at 500 lines:
diff --git a/VERSION b/VERSION
index 6c1c849..7d102b0 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
########################################################
SAMBA_VERSION_MAJOR=4
SAMBA_VERSION_MINOR=5
-SAMBA_VERSION_RELEASE=13
+SAMBA_VERSION_RELEASE=14
########################################################
# If a official release has a serious bug #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index f3fccf7..ea845c3 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,4 +1,78 @@
==============================
+ Release Notes for Samba 4.5.14
+ September 20, 2017
+ ==============================
+
+
+This is a security release in order to address the following defects:
+
+o CVE-2017-12150 (SMB1/2/3 connections may not require signing where they
+ should)
+o CVE-2017-12151 (SMB3 connections don't keep encryption across DFS redirects)
+o CVE-2017-12163 (Server memory information leak over SMB1)
+
+
+=======
+Details
+=======
+
+o CVE-2017-12150:
+ A man in the middle attack may hijack client connections.
+
+o CVE-2017-12151:
+ A man in the middle attack can read and may alter confidential
+ documents transferred via a client connection, which are reached
+ via DFS redirect when the original connection used SMB3.
+
+o CVE-2017-12163:
+ Client with write access to a share can cause server memory contents to be
+ written into a file or printer.
+
+For more details and workarounds, please see the security advisories:
+
+ o https://www.samba.org/samba/security/CVE-2017-12150.html
+ o https://www.samba.org/samba/security/CVE-2017-12151.html
+ o https://www.samba.org/samba/security/CVE-2017-12163.html
+
+
+Changes since 4.5.13:
+---------------------
+
+o Jeremy Allison <jra at samba.org>
+ * BUG 13020: CVE-2017-12163: s3:smbd: Prevent client short SMB1 write from
+ writing server memory to file.
+
+o Stefan Metzmacher <metze at samba.org>
+ * BUG 12996: CVE-2017-12151: Keep required encryption across SMB3 dfs
+ redirects.
+ * BUG 12997: CVE-2017-12150: Some code path don't enforce smb signing
+ when they should.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored. All bug reports should
+be filed under the "Samba 4.1 and newer" product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
+
+ ==============================
Release Notes for Samba 4.5.13
August 31, 2017
==============================
@@ -61,8 +135,8 @@ database (https://bugzilla.samba.org/).
======================================================================
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
+
==============================
Release Notes for Samba 4.5.12
diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c
index bfa397c..194b5c2 100644
--- a/auth/credentials/credentials.c
+++ b/auth/credentials/credentials.c
@@ -25,6 +25,7 @@
#include "librpc/gen_ndr/samr.h" /* for struct samrPassword */
#include "auth/credentials/credentials.h"
#include "auth/credentials/credentials_internal.h"
+#include "auth/gensec/gensec.h"
#include "libcli/auth/libcli_auth.h"
#include "tevent.h"
#include "param/param.h"
@@ -347,6 +348,8 @@ _PUBLIC_ bool cli_credentials_set_principal_callback(struct cli_credentials *cre
_PUBLIC_ bool cli_credentials_authentication_requested(struct cli_credentials *cred)
{
+ uint32_t gensec_features = 0;
+
if (cred->bind_dn) {
return true;
}
@@ -374,6 +377,19 @@ _PUBLIC_ bool cli_credentials_authentication_requested(struct cli_credentials *c
return true;
}
+ gensec_features = cli_credentials_get_gensec_features(cred);
+ if (gensec_features & GENSEC_FEATURE_NTLM_CCACHE) {
+ return true;
+ }
+
+ if (gensec_features & GENSEC_FEATURE_SIGN) {
+ return true;
+ }
+
+ if (gensec_features & GENSEC_FEATURE_SEAL) {
+ return true;
+ }
+
return false;
}
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 43294be..9d801c9 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -468,6 +468,11 @@ bool smbXcli_conn_use_unicode(struct smbXcli_conn *conn)
return false;
}
+bool smbXcli_conn_signing_mandatory(struct smbXcli_conn *conn)
+{
+ return conn->mandatory_signing;
+}
+
void smbXcli_conn_set_sockopt(struct smbXcli_conn *conn, const char *options)
{
set_socket_options(conn->sock_fd, options);
diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h
index 55d3f78..f320500 100644
--- a/libcli/smb/smbXcli_base.h
+++ b/libcli/smb/smbXcli_base.h
@@ -47,6 +47,7 @@ bool smbXcli_conn_dfs_supported(struct smbXcli_conn *conn);
enum protocol_types smbXcli_conn_protocol(struct smbXcli_conn *conn);
bool smbXcli_conn_use_unicode(struct smbXcli_conn *conn);
+bool smbXcli_conn_signing_mandatory(struct smbXcli_conn *conn);
void smbXcli_conn_set_sockopt(struct smbXcli_conn *conn, const char *options);
const struct sockaddr_storage *smbXcli_conn_local_sockaddr(struct smbXcli_conn *conn);
diff --git a/libgpo/gpo_fetch.c b/libgpo/gpo_fetch.c
index 836bc23..3740d4e 100644
--- a/libgpo/gpo_fetch.c
+++ b/libgpo/gpo_fetch.c
@@ -133,7 +133,7 @@ static NTSTATUS gpo_connect_server(ADS_STRUCT *ads,
ads->auth.password,
CLI_FULL_CONNECTION_USE_KERBEROS |
CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS,
- Undefined);
+ SMB_SIGNING_REQUIRED);
if (!NT_STATUS_IS_OK(result)) {
DEBUG(10,("check_refresh_gpo: "
"failed to connect: %s\n",
diff --git a/selftest/flapping b/selftest/flapping
index 50fdf1e..8ea36e9 100644
--- a/selftest/flapping
+++ b/selftest/flapping
@@ -34,3 +34,4 @@
^samba3.blackbox.smbclient_tar.* # fails very, very often on sn-devel
^samba3.blackbox.smbclient_s3.*.sending a message to the remote server # flakey on sn-devel-104 and sn-devel-144
^samba3.blackbox.smbclient_s3.*.creating a good symlink and deleting it by path # flakey on sn-devel-104 and sn-devel-144
+^samba3.blackbox.smbclient_s3.*follow.symlinks.*no # fails sometimes on sn-devel
diff --git a/source3/lib/util_cmdline.c b/source3/lib/util_cmdline.c
index 80c3ecd..539fa55 100644
--- a/source3/lib/util_cmdline.c
+++ b/source3/lib/util_cmdline.c
@@ -123,6 +123,9 @@ bool set_cmdline_auth_info_signing_state(struct user_auth_info *auth_info,
int get_cmdline_auth_info_signing_state(const struct user_auth_info *auth_info)
{
+ if (auth_info->smb_encrypt) {
+ return SMB_SIGNING_REQUIRED;
+ }
return auth_info->signing_state;
}
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 16b21bd..d9c9e27 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -203,7 +203,9 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
/* If a password was not supplied then
* try again with a null username. */
if (password[0] || !username[0] ||
+ force_encrypt || smbXcli_conn_signing_mandatory(c->conn) ||
get_cmdline_auth_info_use_kerberos(auth_info) ||
+ get_cmdline_auth_info_use_ccache(auth_info) ||
!NT_STATUS_IS_OK(status = cli_session_setup(c, "",
"", 0,
"", 0,
@@ -952,7 +954,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
"IPC$",
dfs_auth_info,
false,
- smb1cli_conn_encryption_on(rootcli->conn),
+ cli_state_is_encryption_on(rootcli),
smbXcli_conn_protocol(rootcli->conn),
0,
0x20,
@@ -1010,7 +1012,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
dfs_refs[count].share,
dfs_auth_info,
false,
- smb1cli_conn_encryption_on(rootcli->conn),
+ cli_state_is_encryption_on(rootcli),
smbXcli_conn_protocol(rootcli->conn),
0,
0x20,
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 2b53a93..e675f95 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -334,6 +334,19 @@ uint32_t cli_getpid(struct cli_state *cli)
return cli->smb1.pid;
}
+bool cli_state_is_encryption_on(struct cli_state *cli)
+{
+ if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_SMB2_02) {
+ return smb1cli_conn_encryption_on(cli->conn);
+ }
+
+ if (cli->smb2.tcon == NULL) {
+ return false;
+ }
+
+ return smb2cli_tcon_is_encryption_on(cli->smb2.tcon);
+}
+
bool cli_state_has_tcon(struct cli_state *cli)
{
uint32_t tid;
diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c
index a956058..74adade 100644
--- a/source3/libsmb/libsmb_context.c
+++ b/source3/libsmb/libsmb_context.c
@@ -486,7 +486,7 @@ smbc_option_get(SMBCCTX *context,
for (s = context->internal->servers; s; s = s->next) {
num_servers++;
- if (!smb1cli_conn_encryption_on(s->cli->conn)) {
+ if (!cli_state_is_encryption_on(s->cli)) {
return (void *)false;
}
}
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 340cd22..f276b74 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -174,6 +174,7 @@ const char *cli_state_remote_realm(struct cli_state *cli);
uint16_t cli_state_get_vc_num(struct cli_state *cli);
uint32_t cli_setpid(struct cli_state *cli, uint32_t pid);
uint32_t cli_getpid(struct cli_state *cli);
+bool cli_state_is_encryption_on(struct cli_state *cli);
bool cli_state_has_tcon(struct cli_state *cli);
uint32_t cli_state_get_tid(struct cli_state *cli);
uint32_t cli_state_set_tid(struct cli_state *cli, uint32_t tid);
diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c
index 0c5d7e9..97aa39e 100644
--- a/source3/libsmb/pylibsmb.c
+++ b/source3/libsmb/pylibsmb.c
@@ -447,7 +447,7 @@ static int py_cli_state_init(struct py_cli_state *self, PyObject *args,
cli_credentials_get_username(cli_creds),
cli_credentials_get_domain(cli_creds),
cli_credentials_get_password(cli_creds),
- 0, 0);
+ 0, SMB_SIGNING_DEFAULT);
if (!py_tevent_req_wait_exc(self->ev, req)) {
return -1;
}
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 82dcbba..a40ff81 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -4489,6 +4489,9 @@ void reply_writebraw(struct smb_request *req)
}
/* Ensure we don't write bytes past the end of this packet. */
+ /*
+ * This already protects us against CVE-2017-12163.
+ */
if (data + numtowrite > smb_base(req->inbuf) + smb_len(req->inbuf)) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
error_to_writebrawerr(req);
@@ -4589,6 +4592,11 @@ void reply_writebraw(struct smb_request *req)
exit_server_cleanly("secondary writebraw failed");
}
+ /*
+ * We are not vulnerable to CVE-2017-12163
+ * here as we are guarenteed to have numtowrite
+ * bytes available - we just read from the client.
+ */
nwritten = write_file(req,fsp,buf+4,startpos+nwritten,numtowrite);
if (nwritten == -1) {
TALLOC_FREE(buf);
@@ -4670,6 +4678,7 @@ void reply_writeunlock(struct smb_request *req)
connection_struct *conn = req->conn;
ssize_t nwritten = -1;
size_t numtowrite;
+ size_t remaining;
off_t startpos;
const char *data;
NTSTATUS status = NT_STATUS_OK;
@@ -4702,6 +4711,17 @@ void reply_writeunlock(struct smb_request *req)
startpos = IVAL_TO_SMB_OFF_T(req->vwv+2, 0);
data = (const char *)req->buf + 3;
+ /*
+ * Ensure client isn't asking us to write more than
+ * they sent. CVE-2017-12163.
+ */
+ remaining = smbreq_bufrem(req, data);
+ if (numtowrite > remaining) {
+ reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ END_PROFILE(SMBwriteunlock);
+ return;
+ }
+
if (!fsp->print_file && numtowrite > 0) {
init_strict_lock_struct(fsp, (uint64_t)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
@@ -4783,6 +4803,7 @@ void reply_write(struct smb_request *req)
{
connection_struct *conn = req->conn;
size_t numtowrite;
+ size_t remaining;
ssize_t nwritten = -1;
off_t startpos;
const char *data;
@@ -4823,6 +4844,17 @@ void reply_write(struct smb_request *req)
startpos = IVAL_TO_SMB_OFF_T(req->vwv+2, 0);
data = (const char *)req->buf + 3;
+ /*
+ * Ensure client isn't asking us to write more than
+ * they sent. CVE-2017-12163.
+ */
+ remaining = smbreq_bufrem(req, data);
+ if (numtowrite > remaining) {
+ reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ END_PROFILE(SMBwrite);
+ return;
+ }
+
if (!fsp->print_file) {
init_strict_lock_struct(fsp, (uint64_t)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
@@ -5049,6 +5081,9 @@ void reply_write_and_X(struct smb_request *req)
goto out;
}
} else {
+ /*
+ * This already protects us against CVE-2017-12163.
+ */
if (smb_doff > smblen || smb_doff + numtowrite < numtowrite ||
smb_doff + numtowrite > smblen) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
@@ -5477,6 +5512,7 @@ void reply_writeclose(struct smb_request *req)
{
connection_struct *conn = req->conn;
size_t numtowrite;
+ size_t remaining;
ssize_t nwritten = -1;
NTSTATUS close_status = NT_STATUS_OK;
off_t startpos;
@@ -5510,6 +5546,17 @@ void reply_writeclose(struct smb_request *req)
mtime = convert_time_t_to_timespec(srv_make_unix_date3(req->vwv+4));
data = (const char *)req->buf + 1;
+ /*
+ * Ensure client isn't asking us to write more than
+ * they sent. CVE-2017-12163.
+ */
+ remaining = smbreq_bufrem(req, data);
+ if (numtowrite > remaining) {
+ reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ END_PROFILE(SMBwriteclose);
+ return;
+ }
+
if (fsp->print_file == NULL) {
init_strict_lock_struct(fsp, (uint64_t)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
@@ -6105,6 +6152,9 @@ void reply_printwrite(struct smb_request *req)
numtowrite = SVAL(req->buf, 1);
+ /*
+ * This already protects us against CVE-2017-12163.
+ */
if (req->buflen < numtowrite + 3) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
END_PROFILE(SMBsplwr);
--
Samba Shared Repository
More information about the samba-cvs
mailing list