Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4832538rwb; Tue, 8 Aug 2023 14:53:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETEHOvO2aRMGY2s0FwoAWXTrO4FCGcKn9g/Ajq1sPd1LZYS2b3GgZAEFPWhnb5SY0EZU40 X-Received: by 2002:a17:902:b204:b0:1b8:9b74:636b with SMTP id t4-20020a170902b20400b001b89b74636bmr779275plr.68.1691531618430; Tue, 08 Aug 2023 14:53:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691531618; cv=none; d=google.com; s=arc-20160816; b=spWQMzQoF8r1gjPxeOGJ4RQt36pKfqPvzGhWz8yzLhQwT5hV+ing85teKgj4ZWY4Gj HELXlSA45kvB8yGsw0KQi6eCOAcrJ9CVkFskj0JU3oGcUYf4ZNnM97nZ5xt8aSN9StwN 09mCKcztBgnH7dEUhg58frDdjuw42egVuM1exBj+j0qwdg/Qy76Bo1uDzvODHZT1lFe7 PtyvCk+yyF1QM/9NEkg0OfFeh1w76VYmM9JdgIOtzbIjdXw9VpsS/z3ZyHu644ijbjPW 1DSmyyvAO6aLBNyo4tKX27EmizrM+P3BYlHfwf0IcTJkKqg11h5WCeDUDRX0OBp0+BfE f47g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=g4haua1IOmEAZIW6GpRHq65jQw5+tkVRcSl6jTiUYWE=; fh=61Q4C79mbgbNY3MrLboX+5ArALJ7/1bO758JPk8L7p0=; b=mt226eAg7Xp+V/7JUr3i+6ZuwtTV0qjyS2Ipe9YpFvmMFn9HXM0J9uszqDt4SrxVev y36BX+MF7T4rjrf7V/nelQoaVNmm3/HdO031v/v365x7wIhGhHSGFd5jE36TdoEVwfOh rxfEbTdLi3TH9nymayhS0Qw9Q1SDZbxxR7fK218FHloNwaqmOqeqRSp7BUVbKVac9Vp+ pK4oFOXi8GpF8+YI9U9fatAsba2Kzc8AHGh4xqFpObjfDui9DziBwj5HcwYTiRpItyV/ SmgvvfL5v8rssAHwbTiEqiXkNaaqy1hklc8TJf4JEdXP+gc7IE4gFsq9sqvGELDk3dKe lEDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=Sk7TlFRt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a170902d51100b001bbacfdad2fsi5315871plg.291.2023.08.08.14.53.27; Tue, 08 Aug 2023 14:53:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=Sk7TlFRt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235695AbjHHVIK (ORCPT + 99 others); Tue, 8 Aug 2023 17:08:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234996AbjHHVIC (ORCPT ); Tue, 8 Aug 2023 17:08:02 -0400 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 066251FC8C; Tue, 8 Aug 2023 13:39:02 -0700 (PDT) Received: from [192.168.192.83] (unknown [50.47.134.245]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id EC3D33F7B7; Tue, 8 Aug 2023 20:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1691527141; bh=g4haua1IOmEAZIW6GpRHq65jQw5+tkVRcSl6jTiUYWE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Sk7TlFRtjCEL1EgTvHO0+JFUkHXioqPLs/P3V+X2gPA1XLr2blkUd7RNW/wsKMF9r ivUJPqPQovu/t2MFHdzmiCvkD5+izdmPtAcX8TdFMDPZaaCaP6kiQPKZEfFe+UnKFW EEgpjQh6reR1/FlPpDCJ3VANSE964P2NGSVkJ5uyrzgUIJNnqufxBIBK7g5pDxNof7 QWn+OTZetD6pkjCReQNVz/kBadC7e/7kjm0DQqlP38aKgm1JRjxIublUxEDBBWjRM8 hB8n1unTxD69uHUYplqPiS4y3mPy+LIl/Lj7T0AFjj4B/GdbNNFbtxIrkr8RdtrOyR 6a062F51ddwUw== Message-ID: <33790c5c-c23a-7207-c3a7-454af1452ad5@canonical.com> Date: Tue, 8 Aug 2023 13:38:58 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH -next] apparmor: cleanup unused functions in file.h Content-Language: en-US To: Xiu Jianfeng , paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, mike.salvatore@canonical.com Cc: apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230725141259.233391-1-xiujianfeng@huawei.com> From: John Johansen Organization: Canonical In-Reply-To: <20230725141259.233391-1-xiujianfeng@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/25/23 07:12, Xiu Jianfeng wrote: > After changes in commit 33bf60cabcc7 ("LSM: Infrastructure management of > the file security"), aa_alloc_file_ctx() and aa_free_file_ctx() are no > longer used, so remove them, and also remove aa_get_file_label() because > it seems that it's never been used before. > > Signed-off-by: Xiu Jianfeng Acked-by: John Johansen this has been pulled into apparmor-next > --- > security/apparmor/include/file.h | 37 -------------------------------- > 1 file changed, 37 deletions(-) > > diff --git a/security/apparmor/include/file.h b/security/apparmor/include/file.h > index 5be620af33ba..23cb6f9dbe6e 100644 > --- a/security/apparmor/include/file.h > +++ b/security/apparmor/include/file.h > @@ -45,43 +45,6 @@ struct aa_file_ctx { > u32 allow; > }; > > -/** > - * aa_alloc_file_ctx - allocate file_ctx > - * @label: initial label of task creating the file > - * @gfp: gfp flags for allocation > - * > - * Returns: file_ctx or NULL on failure > - */ > -static inline struct aa_file_ctx *aa_alloc_file_ctx(struct aa_label *label, > - gfp_t gfp) > -{ > - struct aa_file_ctx *ctx; > - > - ctx = kzalloc(sizeof(struct aa_file_ctx), gfp); > - if (ctx) { > - spin_lock_init(&ctx->lock); > - rcu_assign_pointer(ctx->label, aa_get_label(label)); > - } > - return ctx; > -} > - > -/** > - * aa_free_file_ctx - free a file_ctx > - * @ctx: file_ctx to free (MAYBE_NULL) > - */ > -static inline void aa_free_file_ctx(struct aa_file_ctx *ctx) > -{ > - if (ctx) { > - aa_put_label(rcu_access_pointer(ctx->label)); > - kfree_sensitive(ctx); > - } > -} > - > -static inline struct aa_label *aa_get_file_label(struct aa_file_ctx *ctx) > -{ > - return aa_get_label_rcu(&ctx->label); > -} > - > /* > * The xindex is broken into 3 parts > * - index - an index into either the exec name table or the variable table