lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <madfnttjnm5spfc3jxnvcvcwccdz2q4yqqjsz7hiey7mqy3jfi@4siu67gqsp6f>
Date:   Wed, 13 Sep 2023 12:45:15 -0700
From:   Davidlohr Bueso <dave@...olabs.net>
To:     Dan Williams <dan.j.williams@...el.com>
Cc:     Ira Weiny <ira.weiny@...el.com>,
        Jonathan Cameron <jonathan.cameron@...wei.com>,
        Dave Jiang <dave.jiang@...el.com>,
        Alison Schofield <alison.schofield@...el.com>,
        Vishal Verma <vishal.l.verma@...el.com>,
        linux-cxl@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cxl/mbox: Fix CEL logic for poison and security commands

On Tue, 12 Sep 2023, Dan Williams wrote:

>Ira Weiny wrote:
>> The following debug output was observed while testing CXL
>>
>> cxl_core:cxl_walk_cel:721: cxl_mock_mem cxl_mem.0: Opcode 0x4300 unsupported by driver
>>
>> opcode 0x4300 (Get Poison) is supported by the driver and the mock
>> device supports it.  The logic should be checking that the opcode is
>> both not poison and not security.
>>
>> Fix the logic to allow poison and security commands.
>>
>> Fixes: ad64f5952ce3 ("cxl/memdev: Only show sanitize sysfs files when supported")
>> Cc: Davidlohr Bueso <dave@...olabs.net>
>> Signed-off-by: Ira Weiny <ira.weiny@...el.com>
>> ---
>>  drivers/cxl/core/mbox.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
>> index ca60bb8114f2..b315bdab9197 100644
>> --- a/drivers/cxl/core/mbox.c
>> +++ b/drivers/cxl/core/mbox.c
>> @@ -716,8 +716,8 @@ static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
>>  		u16 opcode = le16_to_cpu(cel_entry[i].opcode);
>>  		struct cxl_mem_command *cmd = cxl_mem_find_command(opcode);
>>
>> -		if (!cmd && (!cxl_is_poison_command(opcode) ||
>> -			     !cxl_is_security_command(opcode))) {
>> +		if (!cmd && !cxl_is_poison_command(opcode) &&
>> +		    !cxl_is_security_command(opcode)) {
>
>Given that this is going to be a recurring pattern to add optional
>command support, I am not a fan of continuing to expand this boolean
>algebra eye exam.
>
>How about the following to only do the validation check and enabling in
>one place:

Agreed.

Reviewed-by: Davidlohr Bueso <dave@...olabs.net>

... this also is a reminder of the need for regression testing/CI.

Thanks,
Davidlohr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ