shithub: riscv

Download patch

ref: 67edb3bd015c635216f9cd3eaffaf16c228c790f
parent: 481a4c75fd157edda9c00b66ee727dc6002aa818
author: cinap_lenrek <[email protected]>
date: Tue Sep 10 17:17:23 EDT 2019

ip/cifsd: exit to close connection when we get malformed smb header (fixes linux mount hang)

--- a/sys/src/cmd/ip/cifsd/main.c
+++ b/sys/src/cmd/ip/cifsd/main.c
@@ -85,10 +85,12 @@
 	if((n = unpack(h, h, e, "lb____bww{.________}__wwww", &magic,
 		&r.cmd, &r.flags, &r.flags2, &hpid, &sig, &r.tid, &r.pid, &r.uid, &r.mid)) == 0){
 		logit("bad smb header");
+		exits("botch");
 		return;
 	}
 	if(magic != MAGIC){
 		logit("bad smb magic");
+		exits("botch");
 		return;
 	}
 	r.pid |= hpid<<16;