diff options
| author | Ricardo Robaina <rrobaina@redhat.com> | 2026-07-02 11:04:11 -0300 |
|---|---|---|
| committer | Paul Moore <paul@paul-moore.com> | 2026-07-08 14:22:14 -0400 |
| commit | 65dfde57d1e29ce2b76fc23dd565eccd5c0bc0f0 (patch) | |
| tree | 05e6547ef53c00bab8270a177bf7129fe85c8f02 /rust/zerocopy/git@git.tavy.me:linux-stable.git | |
| parent | c9a71daaecb2fb1d8c704545cc0b1c920b9bf5d7 (diff) | |
audit: fix potential integer overflow in audit_log_n_hex()
The function calculates new_len as len << 1 for hex encoding. This
has two overflow risks: the shift itself can overflow when len is
large, and the result can be truncated when assigned to new_len
(declared as int) from the size_t calculation.
Fix by using check_shl_overflow() to catch shift overflow and
changing new_len and loop counter i to size_t to prevent truncation.
Cc: stable@vger.kernel.org
Fixes: 168b7173959f ("AUDIT: Clean up logging of untrusted strings")
Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Ricardo Robaina <rrobaina@redhat.com>
[PM: remove vertical whitspace noise]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'rust/zerocopy/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
