Staging: dream, fix buf overflow
PATCH 1/1 Staging: dream, fix buf overflow
Not even compile-tested. I don't have an arm toolchain. --
In vfe_send_msg_no_payload there is a wrong struct vfe_message allocation. It allocates only sizeof(pointer to vfe_message) for a whole structure. Add a dereference to the sizeof to allocate sizeof(vfe_message).
Signed-off-by Jiri Slaby <[email protected]>
--- drivers/staging/dream/camera/msm_vfe8x_proc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/dream/camera/msm_vfe8x_proc.c +1 -1
@@ -818,7 +818,7 @@ static void vfe_send_msg_no_payload(enum VFE_MESSAGE_ID id) {struct vfe_message *msg; - msg =kzalloc (sizeof (msg),GFP_ATOMIC ); + msg =kzalloc (sizeof (*msg),GFP_ATOMIC );if (!msg)return ;
Signature · 1 line
1.6.3.3
Quoted 8 lines · Jiri Slaby
Not even compile-tested. I don't have an arm toolchain. --
In
vfe_send_msg_no_payloadthere is a wrong structvfe_messageallocation. It allocates onlysizeof(pointer to vfe_message)for a whole structure. Add a dereference to the sizeof to allocatesizeof(vfe_message).Signed-off-by Jiri Slaby <[email protected]>
Acked-by Pavel Machek <[email protected]>
(Google, you may want to fix this in your code, too.)
Quoted 17 lines
--- drivers/staging/dream/camera/msm_vfe8x_proc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/staging/dream/camera/msm_vfe8x_proc.c +1
-1@@ -818,7 +818,7 @@ static void vfe_send_msg_no_payload(enum VFE_MESSAGE_ID id) {struct vfe_message *msg; - msg =kzalloc (sizeof (msg),GFP_ATOMIC ); + msg =kzalloc (sizeof (*msg),GFP_ATOMIC );if (!msg)return ;
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html