Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56831a1a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] list entry can not return null
  turn cifs_setattr into a multiplexor that calls the correct function
  move file time and dos attribute setting logic into new function
  spin off cifs_setattr with unix extensions to its own function
  [CIFS] Code cleanup in old sessionsetup code
  [CIFS] cifs_mkdir and cifs_create should respect the setgid bit on parent dir
  Rename CIFSSMBSetFileTimes to CIFSSMBSetFileInfo and add PID arg
  change CIFSSMBSetTimes to CIFSSMBSetPathInfo
  [CIFS] fix trailing whitespace
  bundle up Unix SET_PATH_INFO args into a struct and change name
  Fix missing braces in cifs_revalidate()
  remove locking around tcpSesAllocCount atomic variable
  [CIFS] properly account for new user= field in SPNEGO upcall string allocation
  [CIFS] remove level of indentation from decode_negTokenInit
  [CIFS] cifs send2 not retrying enough in some cases on full socket
  [CIFS] oid should also be checked against class in cifs asn
parents 6724cce8 ad8b15f0
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
Version 1.54
------------
Fix premature write failure on congested networks (we would give up
on EAGAIN from the socket too quickly on large writes).
Cifs_mkdir and cifs_create now respect the setgid bit on parent dir.
Fix endian problems in acl (mode from/to cifs acl) on bigendian
architectures.

Version 1.53
------------
DFS support added (Microsoft Distributed File System client support needed
+124 −134
Original line number Diff line number Diff line
@@ -483,6 +483,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,

	asn1_open(&ctx, security_blob, length);

	/* GSSAPI header */
	if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
		cFYI(1, ("Error decoding negTokenInit header"));
		return 0;
@@ -490,15 +491,16 @@ decode_negTokenInit(unsigned char *security_blob, int length,
		   || (tag != ASN1_EOC)) {
		cFYI(1, ("cls = %d con = %d tag = %d", cls, con, tag));
		return 0;
	} else {
		/*      remember to free obj->oid */
	}

	/* Check for SPNEGO OID -- remember to free obj->oid */
	rc = asn1_header_decode(&ctx, &end, &cls, &con, &tag);
	if (rc) {
			if ((tag == ASN1_OJI) && (con == ASN1_PRI)) {
		if ((tag == ASN1_OJI) && (con == ASN1_PRI) &&
		    (cls == ASN1_UNI)) {
			rc = asn1_oid_decode(&ctx, end, &oid, &oidlen);
			if (rc) {
					rc = compare_oid(oid, oidlen,
							 SPNEGO_OID,
				rc = compare_oid(oid, oidlen, SPNEGO_OID,
						 SPNEGO_OID_LEN);
				kfree(oid);
			}
@@ -506,6 +508,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
			rc = 0;
	}

	/* SPNEGO OID not present or garbled -- bail out */
	if (!rc) {
		cFYI(1, ("Error decoding negTokenInit header"));
		return 0;
@@ -566,22 +569,17 @@ decode_negTokenInit(unsigned char *security_blob, int length,
		if ((tag == ASN1_OJI) && (con == ASN1_PRI)) {
			if (asn1_oid_decode(&ctx, end, &oid, &oidlen)) {

					cFYI(1,
					  ("OID len = %d oid = 0x%lx 0x%lx "
					   "0x%lx 0x%lx",
					   oidlen, *oid, *(oid + 1),
					   *(oid + 2), *(oid + 3)));
				cFYI(1, ("OID len = %d oid = 0x%lx 0x%lx "
					 "0x%lx 0x%lx", oidlen, *oid,
					 *(oid + 1), *(oid + 2), *(oid + 3)));

					if (compare_oid(oid, oidlen,
							MSKRB5_OID,
				if (compare_oid(oid, oidlen, MSKRB5_OID,
						MSKRB5_OID_LEN))
					use_kerberos = true;
					else if (compare_oid(oid, oidlen,
							     KRB5_OID,
				else if (compare_oid(oid, oidlen, KRB5_OID,
						     KRB5_OID_LEN))
					use_kerberos = true;
					else if (compare_oid(oid, oidlen,
							     NTLMSSP_OID,
				else if (compare_oid(oid, oidlen, NTLMSSP_OID,
						     NTLMSSP_OID_LEN))
					use_ntlmssp = true;

@@ -593,19 +591,16 @@ decode_negTokenInit(unsigned char *security_blob, int length,
	}

	if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
			cFYI(1,
			     ("Error decoding last part negTokenInit exit3"));
		cFYI(1, ("Error decoding last part negTokenInit exit3"));
		return 0;
	} else if ((cls != ASN1_CTX) || (con != ASN1_CON)) {
		/* tag = 3 indicating mechListMIC */
			cFYI(1,
			     ("Exit 4 cls = %d con = %d tag = %d end = %p (%d)",
		cFYI(1, ("Exit 4 cls = %d con = %d tag = %d end = %p (%d)",
			 cls, con, tag, end, *end));
		return 0;
	}
	if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
			cFYI(1,
			     ("Error decoding last part negTokenInit exit5"));
		cFYI(1, ("Error decoding last part negTokenInit exit5"));
		return 0;
	} else if ((cls != ASN1_UNI) || (con != ASN1_CON)
		   || (tag != ASN1_SEQ)) {
@@ -614,29 +609,24 @@ decode_negTokenInit(unsigned char *security_blob, int length,
	}

	if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
			cFYI(1,
			     ("Error decoding last part negTokenInit exit 7"));
		cFYI(1, ("Error decoding last part negTokenInit exit 7"));
		return 0;
	} else if ((cls != ASN1_CTX) || (con != ASN1_CON)) {
			cFYI(1,
			     ("Exit 8 cls = %d con = %d tag = %d end = %p (%d)",
		cFYI(1, ("Exit 8 cls = %d con = %d tag = %d end = %p (%d)",
			 cls, con, tag, end, *end));
		return 0;
	}
	if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
			cFYI(1,
			     ("Error decoding last part negTokenInit exit9"));
		cFYI(1, ("Error decoding last part negTokenInit exit9"));
		return 0;
	} else if ((cls != ASN1_UNI) || (con != ASN1_PRI)
		   || (tag != ASN1_GENSTR)) {
			cFYI(1,
			     ("Exit10 cls = %d con = %d tag = %d end = %p (%d)",
		cFYI(1, ("Exit10 cls = %d con = %d tag = %d end = %p (%d)",
			 cls, con, tag, end, *end));
		return 0;
	}
	cFYI(1, ("Need to call asn1_octets_decode() function for %s",
		 ctx.pointer));	/* is this UTF-8 or ASCII? */
	}

	if (use_kerberos)
		*secType = Kerberos;
+24 −29
Original line number Diff line number Diff line
@@ -79,7 +79,6 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
	spin_lock(&GlobalMid_Lock);
	list_for_each(tmp, &server->pending_mid_q) {
		mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
		if (mid_entry) {
		cERROR(1, ("State: %d Cmd: %d Pid: %d Tsk: %p Mid %d",
			mid_entry->midState,
			(int)mid_entry->command,
@@ -101,7 +100,6 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
				mid_entry->resp_buf, 62);
		}
	}
	}
	spin_unlock(&GlobalMid_Lock);
}
#endif /* CONFIG_CIFS_DEBUG2 */
@@ -163,9 +161,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
				mid_entry = list_entry(tmp1, struct
					mid_q_entry,
					qhead);
				if (mid_entry) {
					seq_printf(m,
							"State: %d com: %d pid:"
				seq_printf(m, "State: %d com: %d pid:"
						" %d tsk: %p mid %d\n",
						mid_entry->midState,
						(int)mid_entry->command,
@@ -173,7 +169,6 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
						mid_entry->tsk,
						mid_entry->mid);
			}
			}
			spin_unlock(&GlobalMid_Lock);
		}

+11 −7
Original line number Diff line number Diff line
@@ -66,8 +66,8 @@ struct key_type cifs_spnego_key_type = {
	.describe	= user_describe,
};

#define MAX_VER_STR_LEN   9 /* length of longest version string e.g.
				strlen(";ver=0xFF") */
#define MAX_VER_STR_LEN   8 /* length of longest version string e.g.
				strlen("ver=0xFF") */
#define MAX_MECH_STR_LEN 13 /* length of longest security mechanism name, eg
			       in future could have strlen(";sec=ntlmsspi") */
#define MAX_IPV6_ADDR_LEN 42 /* eg FEDC:BA98:7654:3210:FEDC:BA98:7654:3210/60 */
@@ -81,11 +81,15 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
	struct key *spnego_key;
	const char *hostname = server->hostname;

	/* BB: come up with better scheme for determining length */
	/* length of fields (with semicolons): ver=0xyz ipv4= ipaddress host=
	   hostname sec=mechanism uid=0x uid */
	desc_len = MAX_VER_STR_LEN + 5 + MAX_IPV6_ADDR_LEN + 1 + 6 +
		  strlen(hostname) + MAX_MECH_STR_LEN + 8 + (sizeof(uid_t) * 2);
	/* length of fields (with semicolons): ver=0xyz ip4=ipaddress
	   host=hostname sec=mechanism uid=0xFF user=username */
	desc_len = MAX_VER_STR_LEN +
		   6 /* len of "host=" */ + strlen(hostname) +
		   5 /* len of ";ipv4=" */ + MAX_IPV6_ADDR_LEN +
		   MAX_MECH_STR_LEN +
		   7 /* len of ";uid=0x" */ + (sizeof(uid_t) * 2) +
		   6 /* len of ";user=" */ + strlen(sesInfo->userName) + 1;

	spnego_key = ERR_PTR(-ENOMEM);
	description = kzalloc(desc_len, GFP_KERNEL);
	if (description == NULL)
+33 −38
Original line number Diff line number Diff line
@@ -931,7 +931,6 @@ static int cifs_oplock_thread(void *dummyarg)
		} else {
			oplock_item = list_entry(GlobalOplock_Q.next,
						struct oplock_q_entry, qhead);
			if (oplock_item) {
			cFYI(1, ("found oplock item to write out"));
			pTcon = oplock_item->tcon;
			inode = oplock_item->pinode;
@@ -944,11 +943,10 @@ static int cifs_oplock_thread(void *dummyarg)
				the call */
			/* mutex_lock(&inode->i_mutex);*/
			if (S_ISREG(inode->i_mode)) {
					rc =
					   filemap_fdatawrite(inode->i_mapping);
					if (CIFS_I(inode)->clientCanCacheRead
									 == 0) {
						waitrc = filemap_fdatawait(inode->i_mapping);
				rc = filemap_fdatawrite(inode->i_mapping);
				if (CIFS_I(inode)->clientCanCacheRead == 0) {
					waitrc = filemap_fdatawait(
							      inode->i_mapping);
					invalidate_remote_inode(inode);
				}
				if (rc == 0)
@@ -974,8 +972,6 @@ static int cifs_oplock_thread(void *dummyarg)
						false /* wait flag */);
				cFYI(1, ("Oplock release rc = %d", rc));
			}
			} else
				spin_unlock(&GlobalMid_Lock);
			set_current_state(TASK_INTERRUPTIBLE);
			schedule_timeout(1);  /* yield in case q were corrupt */
		}
@@ -1001,8 +997,7 @@ static int cifs_dnotify_thread(void *dummyarg)
		list_for_each(tmp, &GlobalSMBSessionList) {
			ses = list_entry(tmp, struct cifsSesInfo,
				cifsSessionList);
			if (ses && ses->server &&
			     atomic_read(&ses->server->inFlight))
			if (ses->server && atomic_read(&ses->server->inFlight))
				wake_up_all(&ses->server->response_q);
		}
		read_unlock(&GlobalSMBSeslock);
Loading