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: <20240712124311.GY14050@ziepe.ca>
Date: Fri, 12 Jul 2024 09:43:11 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Baolu Lu <baolu.lu@...ux.intel.com>
Cc: Kevin Tian <kevin.tian@...el.com>, Joerg Roedel <joro@...tes.org>,
	Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
	Nicolin Chen <nicolinc@...dia.com>, Yi Liu <yi.l.liu@...el.com>,
	iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] iommufd: Add check on user response code

On Fri, Jul 12, 2024 at 10:54:11AM +0800, Baolu Lu wrote:
> diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c
> index 29f522819759..a643d5c7c535 100644
> --- a/drivers/iommu/iommufd/fault.c
> +++ b/drivers/iommu/iommufd/fault.c
> @@ -305,10 +305,10 @@ static ssize_t iommufd_fault_fops_write(struct file
> *filep, const char __user *b
>                 if (rc)
>                         break;
> 
> -               static_assert(IOMMUFD_PAGE_RESP_SUCCESS ==
> -                             IOMMU_PAGE_RESP_SUCCESS);
> -               static_assert(IOMMUFD_PAGE_RESP_INVALID ==
> -                             IOMMU_PAGE_RESP_INVALID);
> +               static_assert((int)IOMMUFD_PAGE_RESP_SUCCESS ==
> +                             (int)IOMMU_PAGE_RESP_SUCCESS);
> +               static_assert((int)IOMMUFD_PAGE_RESP_INVALID ==
> +                             (int)IOMMU_PAGE_RESP_INVALID);
>                 if (response.code != IOMMUFD_PAGE_RESP_SUCCESS &&
>                     response.code != IOMMUFD_PAGE_RESP_INVALID) {
>                         rc = -EINVAL;

Yep, my compiler doesn't warn on that apparently..

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ