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: <20230424050843.GA9252@lst.de>
Date:   Mon, 24 Apr 2023 07:08:43 +0200
From:   Christoph Hellwig <hch@....de>
To:     Breno Leitao <leitao@...ian.org>
Cc:     Christoph Hellwig <hch@....de>, io-uring@...r.kernel.org,
        linux-nvme@...ts.infradead.org, asml.silence@...il.com,
        axboe@...nel.dk, leit@...com, linux-kernel@...r.kernel.org,
        linux-block@...r.kernel.org, sagi@...mberg.me, kbusch@...nel.org,
        ming.lei@...hat.com
Subject: Re: [PATCH 1/2] io_uring: Pass whole sqe to commands

On Fri, Apr 21, 2023 at 08:11:31AM -0700, Breno Leitao wrote:
> On Thu, Apr 20, 2023 at 06:57:12AM +0200, Christoph Hellwig wrote:
> > On Wed, Apr 19, 2023 at 03:29:29AM -0700, Breno Leitao wrote:
> > >  	struct nvme_uring_cmd_pdu *pdu = nvme_uring_cmd_pdu(ioucmd);
> > > -	const struct nvme_uring_cmd *cmd = ioucmd->cmd;
> > > +	const struct nvme_uring_cmd *cmd = (struct nvme_uring_cmd *)ioucmd->sqe->cmd;
> > 
> > Please don't add the pointless cast.  And in general avoid the overly
> > long lines.
> 
> If I don't add this cast, the compiler complains with the follow error:
> 
> 	drivers/nvme/host/ioctl.c: In function ‘nvme_uring_cmd_io’:
> 	drivers/nvme/host/ioctl.c:555:37: error: initialization of ‘const struct nvme_uring_cmd *’ from incompatible pointer type ‘const __u8 *’ {aka ‘const unsigned char *’} [-Werror=incompatible-pointer-types]
> 	  const struct nvme_uring_cmd *cmd = ioucmd->sqe->cmd;

Oh.  I think then we need a helper to get the private data from
the io_uring_cmd as an interface that requires casts in all callers
is one asking for bugs.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ