Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp206217rwi; Wed, 19 Oct 2022 20:05:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6YNDj7N6uswD7A4LJ9EswkMmTSeYy2gRV7l63TojE4iMiTvBc4msUAwCb2lLUJAA//SQbk X-Received: by 2002:a05:6402:440d:b0:450:de54:3fcf with SMTP id y13-20020a056402440d00b00450de543fcfmr9960730eda.312.1666235102824; Wed, 19 Oct 2022 20:05:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666235102; cv=none; d=google.com; s=arc-20160816; b=txYsSyjrEWccdPdYhWQDFDQ2DMxulkCUK96BQ2TqE227hQddvJQeu9dKCdZl4OUE+h TIW84RLdpsyzbodk0JRkqSNvyo9AZDDadsRTlgAYVbfSHlaYqxUY9ktqFRKiuuLy8hPo psrGUyeO5OPRNjSChOCs5Wnqq3587XlA/cmBNhIZAtQdxXdrYOTohZj7DI3AK53cYVdz RQOJ67BHJTBXQYP7DVs1I1NB4xNaupeWljlZfcJVhA/7m0wdGb+t+mFlvI0xiWlTogwd L+TMWbC1EQC62BO8OostGnw9BuZvWw97QJ9bkXTw02R292XJjDyKV8lwtrLhBq/+AR6k xGYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=2Ei+tHgRBLvDGC6nv3JurSfc4FPawv8ZxTFadYrOuM8=; b=Dq5uNenKLGqV0hN3e+9AGQ28/DG2oyE2FjhCENxGWLCrh03E528bI/tj4Ykbl4rILJ SoQe/MyArWd1YLecZiz+hl/rAXw38Xe3QP6zUV9ns5CxyFF1LGGAGI6+R6Nn/2+4yNfL yjHlNfyWQXwoO4PsaUrbxgWXfjhtuq4I9qDCtjNwtVaWIx+7+4jm/rfaZ3t20nxXc4Jq iR3bho7Mv/QV+CelROduffo4DExOWL6csE7QSG55vlLbR2KF6oBllA4DqEI8QyqKFB0O 5LZVRa7hK56CfgJOezd3+++89km5cazTg8tYIEruQ76z5MrNPuPhE9G93ldcT2N70aOR 7KRw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a170906d18700b00770d9e664f8si13104148ejz.152.2022.10.19.20.04.38; Wed, 19 Oct 2022 20:05:02 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230354AbiJTCkQ (ORCPT + 99 others); Wed, 19 Oct 2022 22:40:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230480AbiJTCkM (ORCPT ); Wed, 19 Oct 2022 22:40:12 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBF9DC97C0; Wed, 19 Oct 2022 19:40:09 -0700 (PDT) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MtBZ84pCbzpVlb; Thu, 20 Oct 2022 10:36:48 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.58) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 20 Oct 2022 10:39:56 +0800 From: Xiu Jianfeng To: , , , , , CC: , , Subject: [PATCH] apparmor: Use pointer to struct aa_label for lbs_cred Date: Thu, 20 Oct 2022 10:36:21 +0800 Message-ID: <20221020023621.223121-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.174.58] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500023.china.huawei.com (7.185.36.114) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 According to the implementations of cred_label and set_cred_label, we should use pointer to struct aa_label for lbs_cred instead of struct aa_task_ctx, this patch fix it. Fixes: bbd3662a8348 ("Infrastructure management of the cred security blob") Signed-off-by: Xiu Jianfeng --- security/apparmor/lsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index f56070270c69..fd2f57972a17 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -1197,7 +1197,7 @@ static int apparmor_inet_conn_request(const struct sock *sk, struct sk_buff *skb * The cred blob is a pointer to, not an instance of, an aa_task_ctx. */ struct lsm_blob_sizes apparmor_blob_sizes __lsm_ro_after_init = { - .lbs_cred = sizeof(struct aa_task_ctx *), + .lbs_cred = sizeof(struct aa_label *), .lbs_file = sizeof(struct aa_file_ctx), .lbs_task = sizeof(struct aa_task_ctx), }; -- 2.17.1