summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorRand Deeb <rand.sec96@gmail.com>2025-02-20 12:43:49 +0300
committerDave Kleikamp <dave.kleikamp@oracle.com>2025-02-20 09:37:13 -0600
commit70ca3246ad201b53a9f09380b3f29d8bac320383 (patch)
treecca8191d70f9fab878fe5d55fa2cf2fce369ba21 /tools/perf/scripts/python/export-to-postgresql.py
parent9629d7d66c621671d9a47afe27ca9336bfc8a9ea (diff)
fs/jfs: cast inactags to s64 to prevent potential overflow
The expression "inactags << bmp->db_agl2size" in the function dbFinalizeBmap() is computed using int operands. Although the values (inactags and db_agl2size) are derived from filesystem parameters and are usually small, there is a theoretical risk that the shift could overflow a 32-bit int if extreme values occur. According to the C standard, shifting a signed 32-bit int can lead to undefined behavior if the result exceeds its range. In our case, an overflow could miscalculate free blocks, potentially leading to erroneous filesystem accounting. To ensure the arithmetic is performed in 64-bit space, we cast "inactags" to s64 before shifting. This defensive fix prevents any risk of overflow and complies with kernel coding best practices. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Rand Deeb <rand.sec96@gmail.com> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions