[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] device/chario.c (char_write): avoid segmentation fault
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] device/chario.c (char_write): avoid segmentation fault |
Date: |
Sun, 15 Dec 2013 21:40:36 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Marin Ramesa, le Sat 14 Dec 2013 17:58:54 +0100, a écrit :
> + if (strlen(data) != sizeof(struct vm_map_copy))
> + return KERN_INVALID_ARGUMENT;
Err, no, this does not make sense: if data is to be casted into
vm_map_copy, it's not a string, it's some structure with pointers etc.,
you can't expect it to look like a string.
Read about inband data in the mig manual, to understand what is
happening with the vm_map_copy_t copy = (vm_map_copy_t) data; cast.
Samuel