Received: by 2002:a17:505:610b:b0:1be9:327d:8ee3 with SMTP id tt11csp3133591njc; Tue, 5 Nov 2024 13:51:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXXwIs2vye6H7Ag6oYbZbAzqSXU1VPjoDRRfNNwvkMi0+0Mgsp96goOXjKGIU1KJBwHVGp+YY7zykLvoQ==@linaro.org X-Google-Smtp-Source: AGHT+IG2iWzsUswuW7/CMDryfFJpkpQhXadF1nHXZpNQWz+R7Od6d3apaK8YrUY3TtMV6ZV7NYOV X-Received: by 2002:a05:6214:4a87:b0:6cb:ef22:6274 with SMTP id 6a1803df08f44-6d351a8f3fbmr282718806d6.3.1730843491455; Tue, 05 Nov 2024 13:51:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730843491; cv=none; d=google.com; s=arc-20240605; b=jNLRHmABB3aijdgSF2GYSYf4WWUniE66LHL6tSEnQVFjnNgw1/pk0TSGE25094XJOP +gr5Klbhy5OHEmD6zWRBAtgzZq5k2rLXjy7yTbOVeIZB7Yxy4RM7KLBoz1L3Z+nDkOnW zPjGJl513JrP5nFH9I3BGgAhWCIj4p3YXP+9wtS0a4AXD6olo797jnpyhv8ykKryfM/n 1ngk0Z5aXSQ3Sg4KQb81jN/5c8BWXZGgPhWDQ4QQ9m6S1jcx2mRqnMVomCPE+KaTtagH ldg+WZho9ySoSeF2zUJ2WuFPAnPNVcYTQ1ALFuah29lbHShTixqd3adliSnvwBZe1IBs z8FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=SCRzrwoqB2kaM1wSKS8SxCklGv3d16pW68d1Gs0FUmY=; fh=f8RoGae6YR6/W+bdd1Qvt18k2KHzEO8CHqSY1AFrB0c=; b=bCY5CVscEudBOOwuGnbZYNL3j1D2REh8jDDuPRNrOf/w/F2CnRctIEbJ22PhR/CpxK YjPJ4YqAbY3bVEu+JnzqQmA758hYtpoyRHLf1NdJ/BA4PLMD9G1y2uC3mKG7TZUr7esd rIvB/V6xhe6AvxKx/nBbrX7HE2VVvQQsmV0VsFTW678ltZsfMMhAqDLbhqUgsi6sjcsh E5xa5zxDsBesItf+pd19RV0E+t85ZbdDoXTy7rE8U1y/tF+qQ72UmzSXvEZEY+coDQn2 OASpa1Ub0l3wmXtu0UDX+7TmZeuuTfMNwALG2R6HFp3wEUuMVE0P4FpLZ575GWVJmlYh pCVg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=OQPQBUoT; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d35419655csi153506156d6.437.2024.11.05.13.51.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 13:51:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=OQPQBUoT; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8RRx-0002EP-Ut; Tue, 05 Nov 2024 16:50:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t8RRr-0002C5-Jf; Tue, 05 Nov 2024 16:50:51 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t8RRp-0003ak-PK; Tue, 05 Nov 2024 16:50:51 -0500 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A5Le0Av024574; Tue, 5 Nov 2024 21:50:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=SCRzrw oqB2kaM1wSKS8SxCklGv3d16pW68d1Gs0FUmY=; b=OQPQBUoTlI19LXRzseEJBR llZueAk7FonSd2GgAg5ApDzGQktAX+ccCxXgIte+Bbpwxs7bQ2P9gnXfsk4/Ds9p Hcc1uaggQHcC2MUKKaZO2pqsVsRslq1Vg1wJZ1ZAGr6qHyBQjCI9dgmoJHZ7It7A +NC7eueTJKzRREV8Y/BlcSRDnr9et7lgcujIXOyX5Zx5fkWHCX3vugwzRTnCXyKh iF3Q4FBtsiW0ATLHizasamCX0pHWh4a7CucdGEvENyrKou0g9b6JZ6SKAoR9NEyr AzFxcaXbsKx2YzSdA91rB/cewHQ0pOoj/F8V+Mefc17FMEgE+4PeC8hwcL3gc5RA == Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 42qufn01bd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Nov 2024 21:50:44 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4A5K3LuA008470; Tue, 5 Nov 2024 21:50:43 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([172.16.1.71]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 42nywkmbkh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Nov 2024 21:50:43 +0000 Received: from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com [10.241.53.103]) by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4A5Logqq40960730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Nov 2024 21:50:43 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D78A358063; Tue, 5 Nov 2024 21:50:42 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 69FB458056; Tue, 5 Nov 2024 21:50:42 +0000 (GMT) Received: from [9.47.158.152] (unknown [9.47.158.152]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 5 Nov 2024 21:50:42 +0000 (GMT) Message-ID: <60734922-c31d-4a24-865e-45d03ff53141@linux.ibm.com> Date: Tue, 5 Nov 2024 16:50:42 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PULL 10/17] tests/functional: Convert most Aspeed machine tests To: Peter Maydell Cc: =?UTF-8?Q?C=C3=A9dric_Le_Goater?= , qemu-arm@nongnu.org, qemu-devel@nongnu.org, Thomas Huth , "Daniel P. Berrange" , lena.voytek@canonical.com References: <20241024063507.1585765-1-clg@redhat.com> <20241024063507.1585765-11-clg@redhat.com> <91c2ac92-66b2-45c8-b4fe-e8f8587b0e9c@linux.ibm.com> <2491bc60-9a0b-486a-8f6d-2c4c94332756@linux.ibm.com> <1a1d29b3-c14c-42a9-93ad-c773e3b265df@linux.ibm.com> Content-Language: en-US From: Stefan Berger In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: rXxAu0hM8-7JEzrCZZ0I1OLMo11gWmPs X-Proofpoint-GUID: rXxAu0hM8-7JEzrCZZ0I1OLMo11gWmPs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 adultscore=0 impostorscore=0 malwarescore=0 mlxscore=0 clxscore=1015 mlxlogscore=999 phishscore=0 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2411050167 Received-SPF: pass client-ip=148.163.156.1; envelope-from=stefanb@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: Fr34f7UVZYa5 On 11/5/24 4:34 PM, Peter Maydell wrote: > On Tue, 5 Nov 2024 at 20:12, Stefan Berger wrote: >> On 11/5/24 2:54 PM, Peter Maydell wrote: >>> On Tue, 5 Nov 2024 at 18:36, Stefan Berger wrote: >>> Anyway, the thing here is that we run swtpm like this: >>> >>> swtpm socket -d --tpm2 --tpmstate dir=/path/to/somewhere --ctrl >>> type=unixio,path=/path/to/socket >>> >>> where we use command line arguments to tell it where to >>> put the tpmstate and the socket. >>> >>> Either: >>> (1) there are places where it's not valid for us to tell swtpm to >>> put the tpmstate or to put the control socket >>> (2) it's valid to put those anywhere we like >>> >>> If (1), then swtpm should give a clear error message that we've >>> given it an invalid argument (and its manpage should say what >>> the restrictions are) >> >> There are no restrictions on the swtpm level when it comes to paths. > >>> If (2), then apparmor should not be rejecting this usage >> >> AppArmor file restrictions are all path based. We have support for home >> directory and /tmp, but were missing /var/tmp. So, please. >> >> > > One of swtpm or apparmor must be wrong here and I think it should >>> be fixed. In particular, having the failure mode be "something >> >> As stated, we were going to fix the AppArmor path in the swtpm Ubuntu >> package. > > But AIUI the solution you've proposed is to add the user > temp directory -- abstractions/user-tmp looks like it > adds permissions for $HOME/tmp, /var/tmp and /tmp/. None > of those will fix the failure we ran into, because we're not > using any of those tmp directories. We use a directory > that's a subdirectory of wherever the user put the build > directory, which can be anywhere the user has permissions for. Yes, you are right. The same test failed for me locally due to the usage of /var/tmp/ path but that's not what was originally reported. I am not aware that user-started programs can have an exception from having their profiles applied, nor do I know whether rules exist that allow a user to circumvent any rule. So my guess is we need rules like either one of the following: owner /mnt/** rwkl or worse: owner /** rwkl I don't see another choice than adding one of these rules, maybe even the 2nd. Lena? > > That's why I'm confused -- as far as I can see the only > way to make swtpm work the way its documentation says it > should work is to for apparmor to permit anything > (or at least to permit anything that matches the file paths > the user handed swtmp, if it can do that). and from what I know we need explicit rules for allowing paths. > > Or if you want to say "this has to be in one of these > handful of authorised /tmp/ directories", then it should > say that in the manpage and check that at init time, not fail > near-silently much later. At the moment the docs and the > distro-integration of swtmp disagree, and the effect for > somebody trying to use it is very confusing. We haven't run into this type of a problem with paths in a while. The applications return 'permission denied' but to find the exact reason (LSM) for it one may have to dig into the audit log. > > thanks > -- PMM