Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1795975rwi; Thu, 20 Oct 2022 17:56:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7jx+jdPHS6ThoWwH+jJ1GLRRenDJm70Zkt5GDlfpphdh8CEFCEr9+dAXw8AwrLK2RES3A6 X-Received: by 2002:a05:6402:518d:b0:45d:d319:2a88 with SMTP id q13-20020a056402518d00b0045dd3192a88mr14348561edd.35.1666313763169; Thu, 20 Oct 2022 17:56:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666313763; cv=none; d=google.com; s=arc-20160816; b=peq2Zbo46HGVuop50GKpXMZ+bLkkLWuj34ihIrcjH8kwAiMu2lC9c028ZAqDn4iIbT yQtIMh4dJfZPHHcM9fz2iICc9WAS/iE7gaILv2b+C4nTyFgQdu6fyUrbgBK5BpCvh1j+ ZwUf4oleN1wKBsYd0sbYsSiaWISTyNz8qPeHXK/+o+zETaBYZuvE8Q39e2Xf50uwk32N 6+lfZ4wpBlGM6VZQ18MwVE+vTSJ8QABs+n2a1oFunnv+60iSL2ViNJ2yku8DEboedcyb HF/g++MiL7LL7eVxNx5IAte+MQUEiUI7S2/2wn1NnY0PZQvuTUCIfsoVUI6Fk0vCxdFB Yo4A== 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=0ZH7I2emOxQrduYY/W1d9KXW9lFvva9m+8rWPk887Po=; b=AY+2DUP1rv0iliXVYALMQB1uV9F5Wp/1akQiefxNvHtPaDFaj3xYKykl5Ul53wUE5W cDSCoJonmT9xCZtBozsDV/8N8NtOVkzhshaasTsvTkZta8apEZvN5+kfstuMmvyYDW4L OZy5LCgIerid0VWD5IVgbq0EkgQbnmG8FQwcidjuFiWu7mkD3EXvas4qP8N5qXc4FIr1 xkbyJ5ShUipTkH/oxjZ83TuJ0LTjIz9OX+XXXguWZ2CqqYUpko+c7o7yZVkqyNlF+FLF 8SuJUrjDO8XnXyMP7gqGYvZ2jukC9pjLFK3gxQ67ATmneAAr+XcFFBSn2W3qrd2kfIiv tRSQ== 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 g11-20020a170906520b00b0078334ccc570si16502662ejm.328.2022.10.20.17.55.37; Thu, 20 Oct 2022 17:56:03 -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 S229587AbiJUAti (ORCPT + 99 others); Thu, 20 Oct 2022 20:49:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbiJUAte (ORCPT ); Thu, 20 Oct 2022 20:49:34 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEE9310B44; Thu, 20 Oct 2022 17:49:31 -0700 (PDT) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Mtm2V35bQzVj27; Fri, 21 Oct 2022 08:44:50 +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; Fri, 21 Oct 2022 08:49:29 +0800 From: Xiu Jianfeng To: , , , , , CC: , , Subject: [PATCH v2] apparmor: Use pointer to struct aa_label for lbs_cred Date: Fri, 21 Oct 2022 08:46:04 +0800 Message-ID: <20221021004604.188986-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: dggems704-chm.china.huawei.com (10.3.19.181) 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 fixes it. Fixes: bbd3662a8348 ("Infrastructure management of the cred security blob") Signed-off-by: Xiu Jianfeng --- V2: fixes the comment too --- security/apparmor/lsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index f56070270c69..1e2f40db15c5 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -1194,10 +1194,10 @@ static int apparmor_inet_conn_request(const struct sock *sk, struct sk_buff *skb #endif /* - * The cred blob is a pointer to, not an instance of, an aa_task_ctx. + * The cred blob is a pointer to, not an instance of, an aa_label. */ 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