From patchwork Thu Mar 3 20:30:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wright X-Patchwork-Id: 607291 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p23KUfT8011657 for ; Thu, 3 Mar 2011 20:30:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758714Ab1CCUag (ORCPT ); Thu, 3 Mar 2011 15:30:36 -0500 Received: from sous-sol.org ([216.99.217.87]:36297 "EHLO sequoia.sous-sol.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752594Ab1CCUaf (ORCPT ); Thu, 3 Mar 2011 15:30:35 -0500 Received: from sequoia.sous-sol.org (sequoia.sous-sol.org [127.0.0.1]) by sequoia.sous-sol.org (8.14.3/8.14.3) with ESMTP id p23KUCtk022648; Thu, 3 Mar 2011 12:30:12 -0800 Received: (from chrisw@localhost) by sequoia.sous-sol.org (8.14.3/8.14.3/Submit) id p23KUCoD022647; Thu, 3 Mar 2011 12:30:12 -0800 Date: Thu, 3 Mar 2011 12:30:12 -0800 From: Chris Wright To: James Morris , kaber@trash.net Cc: David Miller , Chris Wright , netdev@vger.kernel.org, dm-devel@redhat.com, linux-security-module@vger.kernel.org, drbd-dev@lists.linbit.com, Evgeniy Polyakov , linux-fbdev@vger.kernel.org Subject: [RFC PATCH 4/2] connector: update callbacks to use security_netlink_recv() Message-ID: <20110303203012.GW4988@sequoia.sous-sol.org> References: <20110303202626.GV4988@sequoia.sous-sol.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110303202626.GV4988@sequoia.sous-sol.org> User-Agent: Mutt/1.5.20 (2009-08-17) X-Virus-Scanned: clamav-milter 0.95.3 at sequoia.sous-sol.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sequoia.sous-sol.org Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 03 Mar 2011 20:30:42 +0000 (UTC) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index fe81c85..8b3301b 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -2177,7 +2177,7 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms return; } - if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) { + if (security_netlink_recv(CAP_SYS_ADMIN)) { retcode = ERR_PERM; goto fail; } diff --git a/drivers/md/dm-log-userspace-transfer.c b/drivers/md/dm-log-userspace-transfer.c index 1f23e04..db34a3a 100644 --- a/drivers/md/dm-log-userspace-transfer.c +++ b/drivers/md/dm-log-userspace-transfer.c @@ -134,7 +134,7 @@ 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(current_cap(), CAP_SYS_ADMIN)) + if (security_netlink_recv(CAP_SYS_ADMIN)) return; spin_lock(&receiving_list_lock); diff --git a/drivers/staging/pohmelfs/config.c b/drivers/staging/pohmelfs/config.c index 39413b7..123295a 100644 --- a/drivers/staging/pohmelfs/config.c +++ b/drivers/staging/pohmelfs/config.c @@ -525,7 +525,7 @@ static void pohmelfs_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *n { int err; - if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) + if (security_netlink_recv(CAP_SYS_ADMIN)) return; switch (msg->flags) { diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index 5180a21..081463a 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -73,7 +73,7 @@ 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(current_cap(), CAP_SYS_ADMIN)) + if (security_netlink_recv(CAP_SYS_ADMIN)) return; if (msg->seq >= UVESAFB_TASKS_MAX)