diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-11-06 12:45:15 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-11-06 12:45:15 -0800 |
| commit | c668da99b923bc0527f19e361bb8496be087970f (patch) | |
| tree | 9fe1693f92b7933650c714837dfcd394b49e8a61 | |
| parent | c90841db3524657204c096fd47283817cfdbd2f9 (diff) | |
| parent | 1e39da974ce621ed874c6d3aaf65ad14848c9f0d (diff) | |
| download | linux-c668da99b923bc0527f19e361bb8496be087970f.tar.gz linux-c668da99b923bc0527f19e361bb8496be087970f.tar.bz2 linux-c668da99b923bc0527f19e361bb8496be087970f.zip | |
Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux
Pull fscrypt fix from Eric Biggers:
"Fix an UBSAN warning that started occurring when the block layer
started supporting logical_block_size > PAGE_SIZE"
* tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux:
fscrypt: fix left shift underflow when inode->i_blkbits > PAGE_SHIFT
| -rw-r--r-- | fs/crypto/inline_crypt.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/crypto/inline_crypt.c b/fs/crypto/inline_crypt.c index 5dee7c498bc8..ed6e926226b5 100644 --- a/fs/crypto/inline_crypt.c +++ b/fs/crypto/inline_crypt.c @@ -333,8 +333,7 @@ static bool bh_get_inode_and_lblk_num(const struct buffer_head *bh, inode = mapping->host; *inode_ret = inode; - *lblk_num_ret = ((u64)folio->index << (PAGE_SHIFT - inode->i_blkbits)) + - (bh_offset(bh) >> inode->i_blkbits); + *lblk_num_ret = (folio_pos(folio) + bh_offset(bh)) >> inode->i_blkbits; return true; } |
