summaryrefslogtreecommitdiffstats
path: root/source3/locking
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2014-05-01 10:58:51 -0700
committerJeremy Allison <jra@samba.org>2014-05-02 21:27:07 +0200
commitbed323cebcfcf3298002ea8bc2eb6787419043b6 (patch)
treed6dbb15b6524bc7ecadcb02ced90f9f804502df5 /source3/locking
parente8a323c73138bc132e95facfae011847e7c14aa0 (diff)
downloadsamba-bed323cebcfcf3298002ea8bc2eb6787419043b6.tar.gz
samba-bed323cebcfcf3298002ea8bc2eb6787419043b6.tar.xz
samba-bed323cebcfcf3298002ea8bc2eb6787419043b6.zip
s3 : smbd : Protect all possible code paths from fsp->op == NULL.
In changes to come this will be possible for an INTERNAL_OPEN_ONLY. The protection was already in place for some code paths, this makes the coverage compete. Bug 10564 - Lock order violation and file lost https://bugzilla.samba.org/show_bug.cgi?id=10564 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/brlock.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index ac22ba44d9..e0e042d91b 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -1563,12 +1563,18 @@ void brl_close_fnum(struct messaging_context *msg_ctx,
bool brl_mark_disconnected(struct files_struct *fsp)
{
uint32_t tid = fsp->conn->cnum;
- uint64_t smblctx = fsp->op->global->open_persistent_id;
+ uint64_t smblctx;
uint64_t fnum = fsp->fnum;
unsigned int i;
struct server_id self = messaging_server_id(fsp->conn->sconn->msg_ctx);
struct byte_range_lock *br_lck = NULL;
+ if (fsp->op == NULL) {
+ return false;
+ }
+
+ smblctx = fsp->op->global->open_persistent_id;
+
if (!fsp->op->global->durable) {
return false;
}
@@ -1623,12 +1629,18 @@ bool brl_mark_disconnected(struct files_struct *fsp)
bool brl_reconnect_disconnected(struct files_struct *fsp)
{
uint32_t tid = fsp->conn->cnum;
- uint64_t smblctx = fsp->op->global->open_persistent_id;
+ uint64_t smblctx;
uint64_t fnum = fsp->fnum;
unsigned int i;
struct server_id self = messaging_server_id(fsp->conn->sconn->msg_ctx);
struct byte_range_lock *br_lck = NULL;
+ if (fsp->op == NULL) {
+ return false;
+ }
+
+ smblctx = fsp->op->global->open_persistent_id;
+
if (!fsp->op->global->durable) {
return false;
}