Kernel Newbies archive on lore.kernel.org
 help / Atom feed
* RO data
@ 2018-12-03  6:59 Nicholas Mc Guire
  0 siblings, 0 replies; 1+ messages in thread
From: Nicholas Mc Guire @ 2018-12-03  6:59 UTC (permalink / raw)
  To: kernelnewbies


HI !

 devm_kstrdup_const() will check if the pointer passed
 in is in the RO data section with is_kernel_rodata()
 But this is simply a check for address range - so how
 can one find out at code level reliably what will be in
 that RO data - or is that in principle not possible ?

 The background of this question is that there are cases
 of devm_kstrdup() that do not check the return value
 which can be NULL and are not safe - but rather than
 simply checking the return some look like they could
 be converted to devm_kstrdup_const() which would solve
 the issue in a better way e.g. 
   drivers/hwtracing/coresight/of_coresight.c:of_coresight_parse_endpoint()
 is such a case - so is there are reliable way to 
 assure that some object is in the RO section ? or 
 must one simply assume that it could be RW ?

thx!
hofrat

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-03  6:59 RO data Nicholas Mc Guire

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox