diff options
| author | Olivier Certner <olce@FreeBSD.org> | 2025-11-14 20:20:12 +0000 |
|---|---|---|
| committer | Olivier Certner <olce@FreeBSD.org> | 2025-11-15 09:29:49 +0000 |
| commit | 4872b48b175cc637ee38f645d68b8207d9335474 (patch) | |
| tree | 60a45d21b75ee8a621540a7b29825051daa896da /test/recipes/15-test_ecparam_data/valid/(public-mirror) | |
| parent | 8e0b1a1c03a35a5db13e370cb3e62585d3db68e3 (diff) | |
For 32-bit processes on 64-bit architectures, a difference of 'int'
pointers was wrongly used as a number of bytes to copy in a memcpy()
used to internally construct a 64-bit 'struct setcred' from the 32-bit
variant, leading to copying only part of the 32-bit structure, and thus
to requesting credentials with garbage IDs except for the real and
effective user IDs.
This bug was spotted by jhb@, who produced a slightly more invasive fix
in D53757 (a switch to using CP() on all fields). In the interest of
minimizing the diff for possible inclusion in 15.0, the commit here just
limits itself to fixing the number of bytes to copy.
Tested successfully on a VM with 32-bit mdo(1) (and in passing also
tested that the same executable on a kernel without this change exhibits
the bug in practice, in the form of setcred() failing with EINVAL).
Reported by: jhb
Reviewed by: jhb
Fixes: ddb3eb4efe55 ("New setcred() system call and associated MAC hooks")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53767
Diffstat (limited to 'test/recipes/15-test_ecparam_data/valid/(public-mirror)')
0 files changed, 0 insertions, 0 deletions
