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] [thread-next>] [day] [month] [year] [list]
Message-ID: <36cc27be-4ba7-4d65-b32b-2a1e0b03b161@socionext.com>
Date: Mon, 17 Feb 2025 20:26:44 +0900
From: Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Cc: Krzysztof Wilczynski <kw@...ux.com>,
 Kishon Vijay Abraham I <kishon@...nel.org>, Arnd Bergmann <arnd@...db.de>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Lorenzo Pieralisi <lpieralisi@...nel.org>,
 Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
 Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
 linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH v3 3/5] misc: pci_endpoint_test: Fix irq_type to convey
 the correct type

Hi Manivannan,

On 2025/02/15 2:25, Manivannan Sadhasivam wrote:
> On Mon, Feb 10, 2025 at 04:58:10PM +0900, Kunihiko Hayashi wrote:
>> There are two variables that indicate the interrupt type to be used
>> in the next test execution, "irq_type" as global and test->irq_type.
>>
>> The global is referenced from pci_endpoint_test_get_irq() to preserve
>> the current type for ioctl(PCITEST_GET_IRQTYPE).
>>
>> The type set in this function isn't reflected in the global "irq_type",
>> so ioctl(PCITEST_GET_IRQTYPE) returns the previous type.
>> As a result, the wrong type will be displayed in "pcitest" as follows:
>>
>>      # pcitest -i 0
>>      SET IRQ TYPE TO LEGACY:         OKAY
>>      # pcitest -I
>>      GET IRQ TYPE:           MSI
>>
> 
> Could you please post the failure with kselftest that got merged into
> v6.14-rc1?

The kselftest doesn't call GET_IRQTYPE, so current kselftest doesn't fail.

If necessary, I can add GET_IRQTYPE test after SET_IRQTYPE of each
interrupt test prior to this patch.

         pci_ep_ioctl(PCITEST_SET_IRQTYPE, 0);
         ASSERT_EQ(0, ret) TH_LOG("Can't set Legacy IRQ type");

+       pci_ep_ioctl(PCITEST_GET_IRQTYPE, 0);
+       ASSERT_EQ(0, ret) TH_LOG("Can't get Legacy IRQ type");

However, pci_ep_ioctl() returns zero if OK, the return value should be
changed to the actual return value.

  #define pci_ep_ioctl(cmd, arg)                 \
  ({                                             \
         ret = ioctl(self->fd, cmd, arg);        \
-       ret = ret < 0 ? -errno : 0;             \
+       ret = ret < 0 ? -errno : ret;           \
  })

Before applying the patch, this test fails.

#  RUN           pci_ep_basic.LEGACY_IRQ_TEST ...
# pci_endpoint_test.c:104:LEGACY_IRQ_TEST:Expected 0 (0) == ret (1)
# pci_endpoint_test.c:104:LEGACY_IRQ_TEST:Can't get Legacy IRQ type
# LEGACY_IRQ_TEST: Test terminated by assertion
#          FAIL  pci_ep_basic.LEGACY_IRQ_TEST

Thank you,

---
Best Regards
Kunihiko Hayashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ