From patchwork Fri Oct 2 12:40:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Reisner X-Patchwork-Id: 51384 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n92FUlZN021113 for ; Fri, 2 Oct 2009 15:30:50 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 3944261AF38; Fri, 2 Oct 2009 11:30:48 -0400 (EDT) Received: from int-mx08.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n92CeZQV002985 for ; Fri, 2 Oct 2009 08:40:35 -0400 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.12]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n92CeZSm027695 for ; Fri, 2 Oct 2009 08:40:35 -0400 Received: from mail09.linbit.com (mail09.linbit.com [212.69.161.110]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n92CeOVg020359 for ; Fri, 2 Oct 2009 08:40:25 -0400 Received: from localhost.localdomain (unknown [10.9.9.50]) by mail09.linbit.com (LINBIT Mail Daemon) with ESMTP id 515ED106EF00; Fri, 2 Oct 2009 14:40:16 +0200 (CEST) From: Philipp Reisner To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Andrew Morton , "David S. Miller" , Greg KH Date: Fri, 2 Oct 2009 14:40:11 +0200 Message-Id: <1254487211-11810-9-git-send-email-philipp.reisner@linbit.com> In-Reply-To: <1254487211-11810-8-git-send-email-philipp.reisner@linbit.com> References: <1254487211-11810-1-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-2-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-3-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-4-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-5-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-6-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-7-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-8-git-send-email-philipp.reisner@linbit.com> X-RedHat-Spam-Score: -1.2 (AWL) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.12 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Fri, 02 Oct 2009 11:30:41 -0400 Cc: Evgeniy Polyakov , dm-devel@redhat.com, linux-fbdev-devel@lists.sourceforge.net, Philipp Reisner Subject: [dm-devel] [PATCH 8/8] uvesafb/connector: Disallow unpliviged users to send netlink packets X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index aa7cd95..e35232a 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -72,6 +72,9 @@ static void uvesafb_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *ns struct uvesafb_task *utask; struct uvesafb_ktask *task; + if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN)) + return; + if (msg->seq >= UVESAFB_TASKS_MAX) return;