diff options
| -rw-r--r-- | fs/nfsd/nfscache.c | 4 | ||||
| -rw-r--r-- | fs/nfsd/nfsfh.c | 2 | ||||
| -rw-r--r-- | include/linux/sunrpc/svc.h | 4 | ||||
| -rw-r--r-- | include/trace/events/sunrpc.h | 17 | ||||
| -rw-r--r-- | net/sunrpc/svc_xprt.c | 5 |
5 files changed, 22 insertions, 10 deletions
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c index 122f69185ef5..83a9694ec485 100644 --- a/fs/nfsd/nfscache.c +++ b/fs/nfsd/nfscache.c | |||
| @@ -490,7 +490,7 @@ found_entry: | |||
| 490 | /* From the hall of fame of impractical attacks: | 490 | /* From the hall of fame of impractical attacks: |
| 491 | * Is this a user who tries to snoop on the cache? */ | 491 | * Is this a user who tries to snoop on the cache? */ |
| 492 | rtn = RC_DOIT; | 492 | rtn = RC_DOIT; |
| 493 | if (!rqstp->rq_secure && rp->c_secure) | 493 | if (!test_bit(RQ_SECURE, &rqstp->rq_flags) && rp->c_secure) |
| 494 | goto out; | 494 | goto out; |
| 495 | 495 | ||
| 496 | /* Compose RPC reply header */ | 496 | /* Compose RPC reply header */ |
| @@ -579,7 +579,7 @@ nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp) | |||
| 579 | spin_lock(&b->cache_lock); | 579 | spin_lock(&b->cache_lock); |
| 580 | drc_mem_usage += bufsize; | 580 | drc_mem_usage += bufsize; |
| 581 | lru_put_end(b, rp); | 581 | lru_put_end(b, rp); |
| 582 | rp->c_secure = rqstp->rq_secure; | 582 | rp->c_secure = test_bit(RQ_SECURE, &rqstp->rq_flags); |
| 583 | rp->c_type = cachetype; | 583 | rp->c_type = cachetype; |
| 584 | rp->c_state = RC_DONE; | 584 | rp->c_state = RC_DONE; |
| 585 | spin_unlock(&b->cache_lock); | 585 | spin_unlock(&b->cache_lock); |
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 88026fc6a981..965b478d50fc 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
| @@ -86,7 +86,7 @@ static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp, | |||
| 86 | int flags = nfsexp_flags(rqstp, exp); | 86 | int flags = nfsexp_flags(rqstp, exp); |
| 87 | 87 | ||
| 88 | /* Check if the request originated from a secure port. */ | 88 | /* Check if the request originated from a secure port. */ |
| 89 | if (!rqstp->rq_secure && !(flags & NFSEXP_INSECURE_PORT)) { | 89 | if (!test_bit(RQ_SECURE, &rqstp->rq_flags) && !(flags & NFSEXP_INSECURE_PORT)) { |
| 90 | RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]); | 90 | RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]); |
| 91 | dprintk("nfsd: request from insecure port %s!\n", | 91 | dprintk("nfsd: request from insecure port %s!\n", |
| 92 | svc_print_addr(rqstp, buf, sizeof(buf))); | 92 | svc_print_addr(rqstp, buf, sizeof(buf))); |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 21678464883a..b60eb7c3f3f7 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -253,8 +253,8 @@ struct svc_rqst { | |||
| 253 | u32 rq_vers; /* program version */ | 253 | u32 rq_vers; /* program version */ |
| 254 | u32 rq_proc; /* procedure number */ | 254 | u32 rq_proc; /* procedure number */ |
| 255 | u32 rq_prot; /* IP protocol */ | 255 | u32 rq_prot; /* IP protocol */ |
| 256 | unsigned short | 256 | #define RQ_SECURE (0) /* secure port */ |
| 257 | rq_secure : 1; /* secure port */ | 257 | unsigned long rq_flags; /* flags field */ |
| 258 | unsigned short rq_local : 1; /* local request */ | 258 | unsigned short rq_local : 1; /* local request */ |
| 259 | 259 | ||
| 260 | void * rq_argp; /* decoded arguments */ | 260 | void * rq_argp; /* decoded arguments */ |
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index 171ca4ff6d99..5eb5f79d9794 100644 --- a/include/trace/events/sunrpc.h +++ b/include/trace/events/sunrpc.h | |||
| @@ -412,6 +412,10 @@ TRACE_EVENT(xs_tcp_data_recv, | |||
| 412 | __entry->copied, __entry->reclen, __entry->offset) | 412 | __entry->copied, __entry->reclen, __entry->offset) |
| 413 | ); | 413 | ); |
| 414 | 414 | ||
| 415 | #define show_rqstp_flags(flags) \ | ||
| 416 | __print_flags(flags, "|", \ | ||
| 417 | { (1UL << RQ_SECURE), "RQ_SECURE"}) | ||
| 418 | |||
| 415 | TRACE_EVENT(svc_recv, | 419 | TRACE_EVENT(svc_recv, |
| 416 | TP_PROTO(struct svc_rqst *rqst, int status), | 420 | TP_PROTO(struct svc_rqst *rqst, int status), |
| 417 | 421 | ||
| @@ -421,16 +425,19 @@ TRACE_EVENT(svc_recv, | |||
| 421 | __field(struct sockaddr *, addr) | 425 | __field(struct sockaddr *, addr) |
| 422 | __field(__be32, xid) | 426 | __field(__be32, xid) |
| 423 | __field(int, status) | 427 | __field(int, status) |
| 428 | __field(unsigned long, flags) | ||
| 424 | ), | 429 | ), |
| 425 | 430 | ||
| 426 | TP_fast_assign( | 431 | TP_fast_assign( |
| 427 | __entry->addr = (struct sockaddr *)&rqst->rq_addr; | 432 | __entry->addr = (struct sockaddr *)&rqst->rq_addr; |
| 428 | __entry->xid = status > 0 ? rqst->rq_xid : 0; | 433 | __entry->xid = status > 0 ? rqst->rq_xid : 0; |
| 429 | __entry->status = status; | 434 | __entry->status = status; |
| 435 | __entry->flags = rqst->rq_flags; | ||
| 430 | ), | 436 | ), |
| 431 | 437 | ||
| 432 | TP_printk("addr=%pIScp xid=0x%x status=%d", __entry->addr, | 438 | TP_printk("addr=%pIScp xid=0x%x status=%d flags=%s", __entry->addr, |
| 433 | be32_to_cpu(__entry->xid), __entry->status) | 439 | be32_to_cpu(__entry->xid), __entry->status, |
| 440 | show_rqstp_flags(__entry->flags)) | ||
| 434 | ); | 441 | ); |
| 435 | 442 | ||
| 436 | DECLARE_EVENT_CLASS(svc_rqst_status, | 443 | DECLARE_EVENT_CLASS(svc_rqst_status, |
| @@ -444,6 +451,7 @@ DECLARE_EVENT_CLASS(svc_rqst_status, | |||
| 444 | __field(__be32, xid) | 451 | __field(__be32, xid) |
| 445 | __field(int, dropme) | 452 | __field(int, dropme) |
| 446 | __field(int, status) | 453 | __field(int, status) |
| 454 | __field(unsigned long, flags) | ||
| 447 | ), | 455 | ), |
| 448 | 456 | ||
| 449 | TP_fast_assign( | 457 | TP_fast_assign( |
| @@ -451,11 +459,12 @@ DECLARE_EVENT_CLASS(svc_rqst_status, | |||
| 451 | __entry->xid = rqst->rq_xid; | 459 | __entry->xid = rqst->rq_xid; |
| 452 | __entry->dropme = (int)rqst->rq_dropme; | 460 | __entry->dropme = (int)rqst->rq_dropme; |
| 453 | __entry->status = status; | 461 | __entry->status = status; |
| 462 | __entry->flags = rqst->rq_flags; | ||
| 454 | ), | 463 | ), |
| 455 | 464 | ||
| 456 | TP_printk("addr=%pIScp rq_xid=0x%x dropme=%d status=%d", | 465 | TP_printk("addr=%pIScp rq_xid=0x%x dropme=%d status=%d flags=%s", |
| 457 | __entry->addr, be32_to_cpu(__entry->xid), __entry->dropme, | 466 | __entry->addr, be32_to_cpu(__entry->xid), __entry->dropme, |
| 458 | __entry->status) | 467 | __entry->status, show_rqstp_flags(__entry->flags)) |
| 459 | ); | 468 | ); |
| 460 | 469 | ||
| 461 | DEFINE_EVENT(svc_rqst_status, svc_process, | 470 | DEFINE_EVENT(svc_rqst_status, svc_process, |
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 5c71ccb9659d..eaa9263c2d28 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
| @@ -797,7 +797,10 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) | |||
| 797 | 797 | ||
| 798 | clear_bit(XPT_OLD, &xprt->xpt_flags); | 798 | clear_bit(XPT_OLD, &xprt->xpt_flags); |
| 799 | 799 | ||
| 800 | rqstp->rq_secure = xprt->xpt_ops->xpo_secure_port(rqstp); | 800 | if (xprt->xpt_ops->xpo_secure_port(rqstp)) |
| 801 | set_bit(RQ_SECURE, &rqstp->rq_flags); | ||
| 802 | else | ||
| 803 | clear_bit(RQ_SECURE, &rqstp->rq_flags); | ||
| 801 | rqstp->rq_chandle.defer = svc_defer; | 804 | rqstp->rq_chandle.defer = svc_defer; |
| 802 | rqstp->rq_xid = svc_getu32(&rqstp->rq_arg.head[0]); | 805 | rqstp->rq_xid = svc_getu32(&rqstp->rq_arg.head[0]); |
| 803 | 806 | ||
