From patchwork Thu Oct 20 02:36:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiu Jianfeng X-Patchwork-Id: 5964 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp28210wrs; Wed, 19 Oct 2022 19:47:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5bYWsPjIEyZh5gWhcFjAW6HyDpW8msaHiZrjgyJDx8U0/ijpFlZ0Z129qgxMY6tqmbvAY2 X-Received: by 2002:aa7:cd10:0:b0:45c:2c83:1208 with SMTP id b16-20020aa7cd10000000b0045c2c831208mr9903955edw.81.1666234028952; Wed, 19 Oct 2022 19:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666234028; cv=none; d=google.com; s=arc-20160816; b=aUy8A3+HYCAYQyD0ReyvbOH+uVnsji6RVZgFcJoq30m6LOK9ahx++B92M4O/XqwZlD wVbKEcJ1/6F9Z4RjwGoM0vmw1XKT6ccxpZLhwtmKjM5r/22W0ynrcO8fqzskXwBdT4mv xYmNWITUrE7Pi9G8/ltCLS0zR4UysImtjJ09ldAhJNCNLfdCexnrkb8IgjVkQIDqKF0f 8DCznlw7AvthI6TZwmaj5JRySJ8xGC5XBNWJy54KVB2nFIccZMRO/SU8bZMJRXoyrQyO EHvas12epbpB0WELhc1Ha3mwKc75cxKEfWlenpPdpgK6ZPuX4XedtVpJ7hGCbYgJ4fIJ 8tnA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y3-20020a170906448300b0078d288ddfc9si13887429ejo.143.2022.10.19.19.45.53; Wed, 19 Oct 2022 19:47:08 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747173013155749724?= X-GMAIL-MSGID: =?utf-8?q?1747173013155749724?= 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), };