Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag '9p-for-4.21' of git://github.com/martinetd/linux

Pull 9p updates from Dominique Martinet:
"Missing prototype warning fix and a syzkaller fix when a 9p server
advertises a too small msize"

* tag '9p-for-4.21' of git://github.com/martinetd/linux:
9p/net: put a lower bound on msize
net/9p: include trans_common.h to fix missing prototype warning.

+22
+21
net/9p/client.c
··· 181 181 ret = r; 182 182 continue; 183 183 } 184 + if (option < 4096) { 185 + p9_debug(P9_DEBUG_ERROR, 186 + "msize should be at least 4k\n"); 187 + ret = -EINVAL; 188 + continue; 189 + } 184 190 clnt->msize = option; 185 191 break; 186 192 case Opt_trans: ··· 989 983 else if (!strncmp(version, "9P2000", 6)) 990 984 c->proto_version = p9_proto_legacy; 991 985 else { 986 + p9_debug(P9_DEBUG_ERROR, 987 + "server returned an unknown version: %s\n", version); 992 988 err = -EREMOTEIO; 993 989 goto error; 994 990 } 995 991 992 + if (msize < 4096) { 993 + p9_debug(P9_DEBUG_ERROR, 994 + "server returned a msize < 4096: %d\n", msize); 995 + err = -EREMOTEIO; 996 + goto error; 997 + } 996 998 if (msize < c->msize) 997 999 c->msize = msize; 998 1000 ··· 1056 1042 1057 1043 if (clnt->msize > clnt->trans_mod->maxsize) 1058 1044 clnt->msize = clnt->trans_mod->maxsize; 1045 + 1046 + if (clnt->msize < 4096) { 1047 + p9_debug(P9_DEBUG_ERROR, 1048 + "Please specify a msize of at least 4k\n"); 1049 + err = -EINVAL; 1050 + goto free_client; 1051 + } 1059 1052 1060 1053 err = p9_client_version(clnt); 1061 1054 if (err)
+1
net/9p/trans_common.c
··· 14 14 15 15 #include <linux/mm.h> 16 16 #include <linux/module.h> 17 + #include "trans_common.h" 17 18 18 19 /** 19 20 * p9_release_pages - Release pages after the transaction.