mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	ovl: check ERR_PTR() return value from ovl_encode_fh()
Another fix for an issue reported by 0-day robot.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 8ed5eec9d6 ("ovl: encode pure upper file handles")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
			
			
This commit is contained in:
		
							parent
							
								
									2aed489d16
								
							
						
					
					
						commit
						9b6faee074
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
					@ -108,6 +108,9 @@ static int ovl_d_to_fh(struct dentry *dentry, char *buf, int buflen)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Encode an upper or origin file handle */
 | 
						/* Encode an upper or origin file handle */
 | 
				
			||||||
	fh = ovl_encode_fh(origin ?: ovl_dentry_upper(dentry), !origin);
 | 
						fh = ovl_encode_fh(origin ?: ovl_dentry_upper(dentry), !origin);
 | 
				
			||||||
 | 
						err = PTR_ERR(fh);
 | 
				
			||||||
 | 
						if (IS_ERR(fh))
 | 
				
			||||||
 | 
							goto fail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = -EOVERFLOW;
 | 
						err = -EOVERFLOW;
 | 
				
			||||||
	if (fh->len > buflen)
 | 
						if (fh->len > buflen)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue