mirror of
				https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
				synced 2025-11-04 16:52:06 +10:00 
			
		
		
		
	NTFS: Fix a potential overflow by casting (index + 1) to s64 before doing a
left shift using PAGE_CACHE_SHIFT in fs/ntfs/file.c.  Thanks to Andrew
      Morton pointing this out to.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
			
			
This commit is contained in:
		
							parent
							
								
									33bc227e4e
								
							
						
					
					
						commit
						3c6af7fa78
					
				@ -248,7 +248,7 @@ do_non_resident_extend:
 | 
			
		||||
		 * enough to make ntfs_writepage() work.
 | 
			
		||||
		 */
 | 
			
		||||
		write_lock_irqsave(&ni->size_lock, flags);
 | 
			
		||||
		ni->initialized_size = (index + 1) << PAGE_CACHE_SHIFT;
 | 
			
		||||
		ni->initialized_size = (s64)(index + 1) << PAGE_CACHE_SHIFT;
 | 
			
		||||
		if (ni->initialized_size > new_init_size)
 | 
			
		||||
			ni->initialized_size = new_init_size;
 | 
			
		||||
		write_unlock_irqrestore(&ni->size_lock, flags);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user