From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754889AbZBQXyb (ORCPT ); Tue, 17 Feb 2009 18:54:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752847AbZBQXyW (ORCPT ); Tue, 17 Feb 2009 18:54:22 -0500 Received: from g1t0026.austin.hp.com ([15.216.28.33]:12219 "EHLO g1t0026.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751413AbZBQXyV (ORCPT ); Tue, 17 Feb 2009 18:54:21 -0500 From: Paul Moore Organization: Hewlett-Packard To: etienne Subject: Re: [PATCH] SMACK smacklabel : apply &MASK to IP inserted in /smack/netlabel Date: Tue, 17 Feb 2009 18:54:17 -0500 User-Agent: KMail/1.11.0 (Linux/2.6.27-gentoo-r8; KDE/4.2.0; i686; ; ) Cc: Casey Schaufler , "Linux-Kernel" , linux-security-module@vger.kernel.org References: <499B178B.9090601@numericable.fr> <499B1ECF.2020809@numericable.fr> In-Reply-To: <499B1ECF.2020809@numericable.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902171854.17203.paul.moore@hp.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 17 February 2009 03:32:15 pm etienne wrote: > ---- > diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c > index 8e42800..5717150 100644 > --- a/security/smack/smackfs.c > +++ b/security/smack/smackfs.c > @@ -765,6 +765,7 @@ static ssize_t smk_write_netlbladdr(struct file *file, > const char __user *buf, mask.s_addr |= bebits; > bebits <<= 1; > } > + newname.sin_addr.s_addr &= mask.s_addr; > /* > * Only allow one writer at a time. Writes should be > * quite rare and small in any case. If you do this you can simplify some of the code in smack_host_label() by removing the code which applies the mask to the stored addresses when comparing addresses. There may be other places as well. -- paul moore linux @ hp