changelog shortlog tags branches files raw gz bz2 help

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

changeset 7383: 22d364b65600
parent 7382: 3c09fcb69346
child 7384: cfe13a9d53a3
author: cinap_lenrek@felloff.net
date: Tue, 10 Sep 2019 21:17:23 +0200
files: sys/src/cmd/ip/cifsd/main.c
description: ip/cifsd: exit to close connection when we get malformed smb header (fixes linux mount hang)
     1.1--- a/sys/src/cmd/ip/cifsd/main.c
     1.2+++ b/sys/src/cmd/ip/cifsd/main.c
     1.3@@ -85,10 +85,12 @@ receive(uchar *h, uchar *e)
     1.4 	if((n = unpack(h, h, e, "lb____bww{.________}__wwww", &magic,
     1.5 		&r.cmd, &r.flags, &r.flags2, &hpid, &sig, &r.tid, &r.pid, &r.uid, &r.mid)) == 0){
     1.6 		logit("bad smb header");
     1.7+		exits("botch");
     1.8 		return;
     1.9 	}
    1.10 	if(magic != MAGIC){
    1.11 		logit("bad smb magic");
    1.12+		exits("botch");
    1.13 		return;
    1.14 	}
    1.15 	r.pid |= hpid<<16;