mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	nfsd4: fix crash on writing v4_end_grace before nfsd startup
Anatoly Trosinenko reports that this:
1) Checkout fresh master Linux branch (tested with commit e195ca6cb)
2) Copy x84_64-config-4.14 to .config, then enable NFS server v4 and build
3) From `kvm-xfstests shell`:
results in NULL dereference in locks_end_grace.
Check that nfsd has been started before trying to end the grace period.
Reported-by: Anatoly Trosinenko <anatoly.trosinenko@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
			
			
This commit is contained in:
		
							parent
							
								
									b8db159239
								
							
						
					
					
						commit
						62a063b8e7
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -1126,6 +1126,8 @@ static ssize_t write_v4_end_grace(struct file *file, char *buf, size_t size)
 | 
				
			||||||
		case 'Y':
 | 
							case 'Y':
 | 
				
			||||||
		case 'y':
 | 
							case 'y':
 | 
				
			||||||
		case '1':
 | 
							case '1':
 | 
				
			||||||
 | 
								if (nn->nfsd_serv)
 | 
				
			||||||
 | 
									return -EBUSY;
 | 
				
			||||||
			nfsd4_end_grace(nn);
 | 
								nfsd4_end_grace(nn);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue