[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] subdom: Fix -Werror=address failure in tmp_emulator
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 4 Aug 2023 13:36:20 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HV54gh0Z4zJqoYvIH9ELbPuFlkJX6szzPHSkoj+N1V8=; b=Q8w3x2oAlAbB/UcNEkz4XOkTIs8NlnXLyPrdzlrjXLaYMMuLiPaO7gmMBDdzDHlKjC9KoYdRIYQzkitQcq2jLfLkbQ5mNLQ79xwk+dKgP0wl249xUKMGXkfPQ88ibUywpEtQVNCG04sCIDhVJwsUOjldX7EzBdaelIFIZjBRBRpDkYCLoxaS1dc1JR22XA5BVN1f2qSFO09wu7LV9i6FOS9yaPCGOd3JWvFMmGlKk1/hPjX1YfCdCv1pbuhw+weRT4OxZ8LjTvq2E80jA9c3QyPt7NcjTCwjjKxrxikdsXzWjqtchHy4bFGiRLPHw6ci0xP4KRib6Ei6X2d1rDJN1w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SvVLZxD/lP36qNJrPkTgikBncJ+6uZBfdTHgav/2hUXoZdMJx7f6irDAQvr/sKKgczm1f3yQY7pj8eJAza1zwMZluPO6od2iH0k91B8WySuLPDYHhVCWCXH2O4AGD9ehEQpU97ZwtTC7YjMX5WrOrQSfAgc6PaqSIe2LTEd/xEJz0Pz48b98xGt21zfENNPsddSgUBr9d9n1PFvWsrfoepjVccJMWMkHGePMWiVbfK7JoPsSl5ML7Jlpi36XQYeM6Kp8JLk1F5qAFozRFFlXT9P7dxcmAwdOHFGMa245LA0IPeUBsGAbzLNAyBlnrOjn1MKok8XoWPbGVYJBTk8RMg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Jason Andryuk <jandryuk@xxxxxxxxx>, Daniel Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Christopher Clark <christopher.w.clark@xxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Fri, 04 Aug 2023 11:36:44 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 04.08.2023 11:29, Andrew Cooper wrote:
> On 04/08/2023 8:23 am, Jan Beulich wrote:
>> On 03.08.2023 22:36, Andrew Cooper wrote:
>>> The opensuse-tumbleweed build jobs currently fail with:
>>>
>>> /builds/xen-project/xen/stubdom/tpm_emulator-x86_64/crypto/rsa.c: In
>>> function 'rsa_private':
>>> /builds/xen-project/xen/stubdom/tpm_emulator-x86_64/crypto/rsa.c:56:7:
>>> error: the comparison will always evaluate as 'true' for the address of 'p'
>>> will never be NULL [-Werror=address]
>>> 56 | if (!key->p || !key->q || !key->u) {
>>> | ^
>>> In file included from
>>> /builds/xen-project/xen/stubdom/tpm_emulator-x86_64/crypto/rsa.c:17:
>>> /builds/xen-project/xen/stubdom/tpm_emulator-x86_64/crypto/rsa.h:28:12:
>>> note: 'p' declared here
>>> 28 | tpm_bn_t p;
>>> | ^
>>>
>>> This is because all tpm_bn_t's are 1-element arrays (of either a GMP or
>>> OpenSSL BIGNUM flavour). The author was probably meaning to do value
>>> checks,
>>> but that's not what the code does.
>> Looking at the code, I'm not sure about this. There could as well have been
>> the intention to allow pointers there, then permitting them to be left at
>> NULL. Who knows where that code came from originally.
>
> Do you agree that the patch is no function change, or are you saying
> that you think I got some of my analysis wrong?
Oh, I'm sorry for the potentially ambiguous reply: I agree there's no functional
change. I'm merely not sure about your guessing of value checks being meant.
Jan
|