Re: [PATCH] UserfaultFD: Fix stack corruption when zeroing uffd_msg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 08, 2015 at 05:07:27PM +0300, Pavel Emelyanov wrote:
> 
> Signed-off-by: Pavel Emelyanov <xemul@xxxxxxxxxxxxx>
> 
> ---
> 
> diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
> index 026ef99..c89e96f 100644
> --- a/fs/userfaultfd.c
> +++ b/fs/userfaultfd.c
> @@ -134,7 +134,7 @@ static inline void msg_init(struct uffd_msg *msg)
>  	 * Must use memset to zero out the paddings or kernel data is
>  	 * leaked to userland.
>  	 */
> -	memset(&msg, 0, sizeof(struct uffd_msg));
> +	memset(msg, 0, sizeof(struct uffd_msg));

Applied (folded). The memset was originally inline in userfault_msg,
when I introduced msg_init the compiler didn't warn of the & that had
to be removed as it's now called as:

	msg_init(&msg);

All right thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]