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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'nfsd-5.8-2' of git://linux-nfs.org/~bfields/linux into master

Pull nfsd fix from Bruce Fields:
"Just one fix for a NULL dereference if someone happens to read
/proc/fs/nfsd/client/../state at the wrong moment"

* tag 'nfsd-5.8-2' of git://linux-nfs.org/~bfields/linux:
nfsd4: fix NULL dereference in nfsd/clients display code

+19 -1
+19 -1
fs/nfsd/nfs4state.c
··· 507 507 return ret; 508 508 } 509 509 510 + static struct nfsd_file *find_deleg_file(struct nfs4_file *f) 511 + { 512 + struct nfsd_file *ret = NULL; 513 + 514 + spin_lock(&f->fi_lock); 515 + if (f->fi_deleg_file) 516 + ret = nfsd_file_get(f->fi_deleg_file); 517 + spin_unlock(&f->fi_lock); 518 + return ret; 519 + } 520 + 510 521 static atomic_long_t num_delegations; 511 522 unsigned long max_delegations; 512 523 ··· 2455 2444 oo = ols->st_stateowner; 2456 2445 nf = st->sc_file; 2457 2446 file = find_any_file(nf); 2447 + if (!file) 2448 + return 0; 2458 2449 2459 2450 seq_printf(s, "- "); 2460 2451 nfs4_show_stateid(s, &st->sc_stateid); ··· 2494 2481 oo = ols->st_stateowner; 2495 2482 nf = st->sc_file; 2496 2483 file = find_any_file(nf); 2484 + if (!file) 2485 + return 0; 2497 2486 2498 2487 seq_printf(s, "- "); 2499 2488 nfs4_show_stateid(s, &st->sc_stateid); ··· 2528 2513 2529 2514 ds = delegstateid(st); 2530 2515 nf = st->sc_file; 2531 - file = nf->fi_deleg_file; 2516 + file = find_deleg_file(nf); 2517 + if (!file) 2518 + return 0; 2532 2519 2533 2520 seq_printf(s, "- "); 2534 2521 nfs4_show_stateid(s, &st->sc_stateid); ··· 2546 2529 seq_printf(s, ", "); 2547 2530 nfs4_show_fname(s, file); 2548 2531 seq_printf(s, " }\n"); 2532 + nfsd_file_put(file); 2549 2533 2550 2534 return 0; 2551 2535 }