From: Nicholas Mc Guire <der.herr@hofr.at>
To: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: RO data
Date: Mon, 3 Dec 2018 07:59:09 +0100 [thread overview]
Message-ID: <20181203065909.GA29596@osadl.at> (raw)
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
reply other threads:[~2018-12-03 6:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181203065909.GA29596@osadl.at \
--to=der.herr@hofr.at \
--cc=kernelnewbies@kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).