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>] [day] [month] [year] [list]
Message-ID: <2024090244-showpiece-backboned-4aa5@gregkh>
Date: Mon, 2 Sep 2024 08:10:05 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: yi'bin ding <yibin.ding01@...il.com>
Cc: Yibin Ding <Yibin.Ding@...soc.com>, djakov@...nel.org,
	rafael@...nel.org, niuzhiguo84@...il.com, linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org, Hao_hao.Wang@...soc.com,
	Ke.Wang@...soc.com
Subject: Re: [PATCH 1/2] interconnect: Add character pointer initialization

A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Mon, Sep 02, 2024 at 11:03:29AM +0800, yi'bin ding wrote:
> Thanks in advance,
> 
> Why is this needed?  Why not just use the size of the structure?
> 
> answer:Because the memory allocated here is not actually used, it is just
> to prevent the occurrence of null pointer.In order to prevent memory waste,
> I applied for a small amount of memory as possible. If necessary, I can
> submit another revision to change it to the size of the structure or just
> to "1" without the macro definition.

Make it correct please.

> What commit id does this fix?
> 
> answer:commit id:770c69f037c18cfaa37c3d6c6ef8bd257635513f (interconnect:
> Add debugfs test client)
> This commit creates some debugfs nodes, where the src_node and dst_node
> character pointers are not initialized. This will result in accessing null
> pointers when accessing them directly.

Please put the proper Fixes: tag in the changelog text then.

> And where are you freeing this memory you just allocated?
> 
> answer:The memory allocated here will be released when data is written to
> the node. The write operation will call debugfs_write_file_str() function,
> in which a new piece of memory will be allocated to save the new data, and
> then the old memory will be released.

That happens if you write to the file, but what happens if you never
write to the file?  What happens when you remove the driver/module,
shouldn't you free the memory then as well?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ