From patchwork Fri Mar 9 15:38:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nayna X-Patchwork-Id: 10271015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 52AC36016D for ; Fri, 9 Mar 2018 15:41:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 016FA29E82 for ; Fri, 9 Mar 2018 15:41:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BFEA29EA7; Fri, 9 Mar 2018 15:41:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CE1D29F03 for ; Fri, 9 Mar 2018 15:41:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751278AbeCIPkF (ORCPT ); Fri, 9 Mar 2018 10:40:05 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57700 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932221AbeCIPjb (ORCPT ); Fri, 9 Mar 2018 10:39:31 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w29FVW9K099411 for ; Fri, 9 Mar 2018 10:39:30 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gksg6hjyv-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 09 Mar 2018 10:39:30 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 9 Mar 2018 15:39:28 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 9 Mar 2018 15:39:27 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w29FdQgD27263168; Fri, 9 Mar 2018 15:39:26 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EF3F3AE051; Fri, 9 Mar 2018 15:29:59 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B4790AE04D; Fri, 9 Mar 2018 15:29:57 +0000 (GMT) Received: from swastik.in.ibm.com (unknown [9.195.43.182]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 9 Mar 2018 15:29:57 +0000 (GMT) From: Nayna Jain To: dhowells@redhat.com Cc: keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, Nayna Jain Subject: [PATCH v2 2/3] keys: export find_keyring_by_name() Date: Fri, 9 Mar 2018 21:08:02 +0530 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180309153803.25859-1-nayna@linux.vnet.ibm.com> References: <20180309153803.25859-1-nayna@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18030915-0020-0000-0000-00000400CE2D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030915-0021-0000-0000-0000429517C8 Message-Id: <20180309153803.25859-2-nayna@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-09_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803090194 Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch exports the function find_keyring_by_name() to be used by other subsystems. Signed-off-by: Nayna Jain --- Changelog: v2: * Fix the patch description per line length as suggested by Mimi include/linux/key.h | 2 ++ security/keys/internal.h | 2 -- security/keys/keyring.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/key.h b/include/linux/key.h index e58ee10f6e58..c8d332d4103c 100644 --- a/include/linux/key.h +++ b/include/linux/key.h @@ -346,6 +346,8 @@ static inline key_serial_t key_serial(const struct key *key) extern void key_set_timeout(struct key *, unsigned); +extern struct key *find_keyring_by_name(const char *name, bool uid_keyring); + /* * The permissions required on a key that we're looking up. */ diff --git a/security/keys/internal.h b/security/keys/internal.h index 9f8208dc0e55..8aa8d347a1ab 100644 --- a/security/keys/internal.h +++ b/security/keys/internal.h @@ -141,8 +141,6 @@ extern key_ref_t keyring_search_aux(key_ref_t keyring_ref, extern key_ref_t search_my_process_keyrings(struct keyring_search_context *ctx); extern key_ref_t search_process_keyrings(struct keyring_search_context *ctx); -extern struct key *find_keyring_by_name(const char *name, bool uid_keyring); - extern int install_user_keyrings(void); extern int install_thread_keyring_to_cred(struct cred *); extern int install_process_keyring_to_cred(struct cred *); diff --git a/security/keys/keyring.c b/security/keys/keyring.c index 41bcf57e96f2..4b9c3f1166d1 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c @@ -1152,6 +1152,7 @@ struct key *find_keyring_by_name(const char *name, bool uid_keyring) read_unlock(&keyring_name_lock); return keyring; } +EXPORT_SYMBOL(find_keyring_by_name); static int keyring_detect_cycle_iterator(const void *object, void *iterator_data)