|
@@ -938,6 +938,8 @@ static ssize_t __write_ports(struct file *file, char *buf, size_t size)
|
|
char transport[16];
|
|
char transport[16];
|
|
int port;
|
|
int port;
|
|
if (sscanf(buf, "%15s %4d", transport, &port) == 2) {
|
|
if (sscanf(buf, "%15s %4d", transport, &port) == 2) {
|
|
|
|
+ if (port < 1 || port > 65535)
|
|
|
|
+ return -EINVAL;
|
|
err = nfsd_create_serv();
|
|
err = nfsd_create_serv();
|
|
if (!err) {
|
|
if (!err) {
|
|
err = svc_create_xprt(nfsd_serv,
|
|
err = svc_create_xprt(nfsd_serv,
|
|
@@ -960,7 +962,7 @@ static ssize_t __write_ports(struct file *file, char *buf, size_t size)
|
|
char transport[16];
|
|
char transport[16];
|
|
int port;
|
|
int port;
|
|
if (sscanf(&buf[1], "%15s %4d", transport, &port) == 2) {
|
|
if (sscanf(&buf[1], "%15s %4d", transport, &port) == 2) {
|
|
- if (port == 0)
|
|
|
|
|
|
+ if (port < 1 || port > 65535)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
if (nfsd_serv) {
|
|
if (nfsd_serv) {
|
|
xprt = svc_find_xprt(nfsd_serv, transport,
|
|
xprt = svc_find_xprt(nfsd_serv, transport,
|