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

Re: [PATCH] selinux_sb_copy_data requires a whole page?


On Thu, 23 Jun 2005, Eric Paris wrote:

> Is there a good reason I'm missing why we should require a whole page?
> Maybe somebody else (or an old version of lustre) is going to hit on
> this.  Comments?

Actually, a strcpy() should work ok here, as the last byte of the options 
page will always be null terminated (e.g. in do_mount()).


> --- linux-2.6.9/security/selinux/hooks.c.cor	2005-06-23 16:53:05.000000000 -0400
> +++ linux-2.6.9/security/selinux/hooks.c	2005-06-23 16:54:01.000000000 -0400
> @@ -1980,7 +1980,7 @@ static int selinux_sb_copy_data(struct f
>  		}
>  	} while (*in_end++);
>  
> -	copy_page(in_save, nosec_save);
> +	memcpy(in_save, nosec_save, strlen(nosec_save));
>  	free_page((unsigned long)nosec_save);
>  out:
>  	return rc;
> 
> 
> 
> --
> This message was distributed to subscribers of the selinux mailing list.
> If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
> the words "unsubscribe selinux" without quotes as the message.
> 

-- 
James Morris
<jmorris@xxxxxxxxxx>



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.


This mailing list archive is a service of Copilot Consulting.