From patchwork Fri Oct 2 12:40:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Reisner X-Patchwork-Id: 51382 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 n92FUlZJ021113 for ; Fri, 2 Oct 2009 15:30:49 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 186FF61AF12; Fri, 2 Oct 2009 11:30:47 -0400 (EDT) Received: from int-mx03.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 n92CeY47002971 for ; Fri, 2 Oct 2009 08:40:34 -0400 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.12]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n92CeYZD024064 for ; Fri, 2 Oct 2009 08:40:34 -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 n92CeO69020354 for ; Fri, 2 Oct 2009 08:40:24 -0400 Received: from localhost.localdomain (unknown [10.9.9.50]) by mail09.linbit.com (LINBIT Mail Daemon) with ESMTP id 7483910888BD; Fri, 2 Oct 2009 14:40:14 +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:08 +0200 Message-Id: <1254487211-11810-6-git-send-email-philipp.reisner@linbit.com> In-Reply-To: <1254487211-11810-5-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> X-RedHat-Spam-Score: -1.5 (AWL) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 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 5/8] dm/connector: Only process connector packages from privileged processes 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/md/dm-log-userspace-transfer.c b/drivers/md/dm-log-userspace-transfer.c index 1327e1a..54abf9e 100644 --- a/drivers/md/dm-log-userspace-transfer.c +++ b/drivers/md/dm-log-userspace-transfer.c @@ -133,6 +133,9 @@ static void cn_ulog_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) { struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1); + if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN)) + return; + spin_lock(&receiving_list_lock); if (msg->len == 0) fill_pkg(msg, NULL);