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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260117182523.6b6c91e7@kernel.org>
Date: Sat, 17 Jan 2026 18:25:23 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Tony Nguyen <anthony.l.nguyen@...el.com>
Cc: davem@...emloft.net, pabeni@...hat.com, edumazet@...gle.com,
 andrew+netdev@...n.ch, netdev@...r.kernel.org, Madhu Chittim
 <madhu.chittim@...el.com>, joshua.a.hay@...el.com, Milena Olech
 <milena.olech@...el.com>, Aleksandr Loktionov
 <aleksandr.loktionov@...el.com>, Samuel Salin <Samuel.salin@...el.com>
Subject: Re: [PATCH net-next 01/10] idpf: introduce local idpf structure to
 store virtchnl queue chunks

On Thu, 15 Jan 2026 15:47:38 -0800 Tony Nguyen wrote:
> +/**
> + * idpf_queue_id_reg_chunk - individual queue ID and register chunk

missing the word struct

> + * @qtail_reg_start: queue tail register offset
> + * @qtail_reg_spacing: queue tail register spacing
> + * @type: queue type of the queues in the chunk
> + * @start_queue_id: starting queue ID in the chunk
> + * @num_queues: number of queues in the chunk
> + */
> +struct idpf_queue_id_reg_chunk {
> +	u64 qtail_reg_start;
> +	u32 qtail_reg_spacing;
> +	u32 type;
> +	u32 start_queue_id;
> +	u32 num_queues;
> +};
> +
> +/**
> + * idpf_queue_id_reg_info - struct to store the queue ID and register chunk

ditto

> + *			    info received over the mailbox
> + * @num_chunks: number of chunks
> + * @queue_chunks: array of chunks
> + */
> +struct idpf_queue_id_reg_info {
> +	u16 num_chunks;
> +	struct idpf_queue_id_reg_chunk *queue_chunks;
> +};

> +static int
> +idpf_vport_init_queue_reg_chunks(struct idpf_vport_config *vport_config,
> +				 struct virtchnl2_queue_reg_chunks *schunks)
> +{
> +	struct idpf_queue_id_reg_info *q_info = &vport_config->qid_reg_info;
> +	u16 num_chunks = le16_to_cpu(schunks->num_chunks);
> +
> +	kfree(q_info->queue_chunks);
> +
> +	q_info->num_chunks = num_chunks;

AI review complains that this is set before the alloc, so if alloc
fails the struct is in inconsistent state. I didn't check if this is
defensive programming or the callers handle this error correctly.
But seems easy to fix, so maybe let's?

> +	q_info->queue_chunks = kcalloc(num_chunks, sizeof(*q_info->queue_chunks),
> +				       GFP_KERNEL);
> +	if (!q_info->queue_chunks)
> +		return -ENOMEM;
> +
> +	for (u16 i = 0; i < num_chunks; i++) {
> +		struct idpf_queue_id_reg_chunk *dchunk = &q_info->queue_chunks[i];
> +		struct virtchnl2_queue_reg_chunk *schunk = &schunks->chunks[i];
> +
> +		dchunk->qtail_reg_start = le64_to_cpu(schunk->qtail_reg_start);
> +		dchunk->qtail_reg_spacing = le32_to_cpu(schunk->qtail_reg_spacing);
> +		dchunk->type = le32_to_cpu(schunk->type);
> +		dchunk->start_queue_id = le32_to_cpu(schunk->start_queue_id);
> +		dchunk->num_queues = le32_to_cpu(schunk->num_queues);
> +	}
> +
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ