On Tue, Jun 17, 2025 at 09:54:29AM +0200, David Hildenbrand wrote:
On 17.06.25 04:05, Lance Yang wrote:
From: Lance Yang <lance.yang@xxxxxxxxx>
The prev pointer was uninitialized, which could lead to undefined behavior
where its address is taken and passed to the visit() callback without being
assigned a value.
So, we are passing the pointer value to visit(), which is not undefined
behavior.
The issue would be if anybody takes a look at the value stored at that
pointer. Because, already passing an uninitialized value to a (non-inlined)
function is undefined behavior according to C.
In madvise_update_vma()->vma_modify_flags_name() we do exactly that,
correct?
Err the parameter there is struct vm_area_struct **prev...
We deref to the prev ptr which is unassigned yes but the pointer to the pointer isn't...
vma = vma_modify_flags_name(&vmi, *prev, ...
We should use Fixes: then.
So no we shouldn't...
Acked-by: David Hildenbrand <david@xxxxxxxxxx>
Sure? :)