From patchwork Fri Nov 8 01:38:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Lee X-Patchwork-Id: 2008204 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xl1n74DxZz1xyk for ; Fri, 8 Nov 2024 12:38:50 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1t9DxK-0004Jc-Vb; Fri, 08 Nov 2024 01:38:34 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1t9DxI-0004I3-MS for kernel-team@lists.ubuntu.com; Fri, 08 Nov 2024 01:38:32 +0000 Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 69BE93F2B5 for ; Fri, 8 Nov 2024 01:38:32 +0000 (UTC) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-7202dfaa53fso1975039b3a.0 for ; Thu, 07 Nov 2024 17:38:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731029911; x=1731634711; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2q/atr0F1XBd1dWhz1rnSbGbrgoV+2NhpEb3Brjcqa0=; b=u8WyvgyMmmaWkyfJnHbRl7qchXc6ecUl9FZo5+h9/w+S/zqrkPtEpv4J+u89bEEene QS3qSVv7dAdM0ibSJNXCNu65snlXIMHF0LPTTqmG8QbeOuzAp4skH5grR0NCHXX++7Om q3drouwnblxnJedFQfsJ74dOw6/8AmlPBF8QsQaTUre3mMUKcQagHrfkxGeLBFf9JaCF oHW/vXTuT6CKMWuxTvNTZktlhTiyAOsPteKKDvNzQT2jy+hOdRsHL8OJWRrhi0RI5D8H 7M8sVnKhLQVtLW+y7EF9KtMyuVelJxeHuj8nhAC9Twhdwo0Ts6LzqQ7UTI0Nrdp0qhgO rvGg== X-Gm-Message-State: AOJu0YzBmvMju8wpKqX/lw+fiHxhWTo1Y4OZ4TNEppESUtckJ8fuoGw5 TUmOI8IbnWzdk/ua/TeCQwiUPH73NTHd2Q9TLCrjVXUPjioJfYFyLq6PPE0RE4LmlhptpFMgtc4 wVtpg7odcqrN6RY5HTOXvtoVs/whKj6/lEmQa79CE+KrYOyoQLneVhrXLrRUYk5CA0grLUt4nvA NaneOfLaVqJCmo X-Received: by 2002:a05:6a20:1588:b0:1d9:76a3:634 with SMTP id adf61e73a8af0-1dc22b93839mr1283316637.42.1731029910984; Thu, 07 Nov 2024 17:38:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUu3UVcgDCrx3W04dFbigtsLlZmhIzEoQZU9/JWahyrth3fkNyydjqthRUFoImDhC1uCR4Pg== X-Received: by 2002:a05:6a20:1588:b0:1d9:76a3:634 with SMTP id adf61e73a8af0-1dc22b93839mr1283293637.42.1731029910626; Thu, 07 Nov 2024 17:38:30 -0800 (PST) Received: from ryan-lee-laptop-13-amd.. (c-76-103-38-92.hsd1.ca.comcast.net. [76.103.38.92]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724079b7712sm2476504b3a.103.2024.11.07.17.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 17:38:30 -0800 (PST) From: Ryan Lee To: kernel-team@lists.ubuntu.com Subject: [SRU][N][PATCH v2 1/2] UBUNTU: SAUCE: apparmor4.0.0 [94/99]: apparmor: allocate xmatch for nullpdf inside aa_alloc_null Date: Thu, 7 Nov 2024 17:38:25 -0800 Message-ID: <20241108013826.93748-2-ryan.lee@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241108013826.93748-1-ryan.lee@canonical.com> References: <20241108013826.93748-1-ryan.lee@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2086210 attach->xmatch was not set when allocating a null profile, which is used in complain mode to allocate a learning profile. This was causing downstream failures in find_attach, which expected a valid xmatch but did not find one under a certain sequence of profile transitions in complain mode. This patch ensures the xmatch is set up properly for null profiles. Signed-off-by: Ryan Lee Signed-off-by: John Johansen Signed-off-by: Timo Aaltonen (cherry picked from commit 2de989ae726b14b6236fdb848563d607e12287b8 oracular:linux) Signed-off-by: Ryan Lee --- security/apparmor/policy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index f503dcd3ac74..638b0d6753ef 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -659,6 +659,7 @@ struct aa_profile *aa_alloc_null(struct aa_profile *parent, const char *name, /* TODO: ideally we should inherit abi from parent */ profile->label.flags |= FLAG_NULL; + profile->attach.xmatch = aa_get_pdb(nullpdb); rules = list_first_entry(&profile->rules, typeof(*rules), list); rules->file = aa_get_pdb(nullpdb); rules->policy = aa_get_pdb(nullpdb);