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: <df555e96-b603-f024-a099-45fba40d7ea6@suse.de>
Date: Fri, 11 Aug 2023 12:32:09 +0200
From: Hannes Reinecke <hare@...e.de>
To: Simon Horman <horms@...nel.org>
Cc: Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
 Keith Busch <kbusch@...nel.org>, linux-nvme@...ts.infradead.org,
 Jakub Kicinski <kuba@...nel.org>, Eric Dumazet <edumazet@...gle.com>,
 Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org
Subject: Re: [PATCH 07/17] nvme-tcp: allocate socket file

On 8/11/23 12:19, Simon Horman wrote:
> On Thu, Aug 10, 2023 at 05:06:20PM +0200, Hannes Reinecke wrote:
>> When using the TLS upcall we need to allocate a socket file such
>> that the userspace daemon is able to use the socket.
>>
>> Signed-off-by: Hannes Reinecke <hare@...e.de>
>> Reviewed-by: Sagi Grimberg <sagi@...mberg.me>
> 
> ...
> 
>> @@ -1512,6 +1514,7 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid)
>>   	struct nvme_tcp_ctrl *ctrl = to_tcp_ctrl(nctrl);
>>   	struct nvme_tcp_queue *queue = &ctrl->queues[qid];
>>   	int ret, rcv_pdu_size;
>> +	struct file *sock_file;
>>   
>>   	mutex_init(&queue->queue_lock);
>>   	queue->ctrl = ctrl;
>> @@ -1534,6 +1537,13 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid)
>>   		goto err_destroy_mutex;
>>   	}
>>   
>> +	sock_file = sock_alloc_file(queue->sock, O_CLOEXEC, NULL);
>> +	if (IS_ERR(sock_file)) {
>> +		sock_release(queue->sock);
> 
> Hi Hannes,
> 
> Is it correct to call sock_release() here?
> sock_alloc_file() already does so on error.
> 
> Flagged by Smatch.
> 
Ah, no, you are correct. Will be fixing it up.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		           Kernel Storage Architect
hare@...e.de			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Frankenstr. 146, 90461 Nürnberg
Managing Directors: I. Totev, A. Myers, A. McDonald, M. B. Moerman
(HRB 36809, AG Nürnberg)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ