Return-Path: Received: from 178.115.242.59.static.drei.at ([178.115.242.59] helo=mail.osadl.at) by shelob.surriel.com with esmtp (Exim 4.91) (envelope-from ) id 1gTiCr-000417-Ex for kernelnewbies@kernelnewbies.org; Mon, 03 Dec 2018 01:59:50 -0500 Date: Mon, 3 Dec 2018 07:59:09 +0100 From: Nicholas Mc Guire To: kernelnewbies Subject: RO data Message-ID: <20181203065909.GA29596@osadl.at> MIME-Version: 1.0 Content-Disposition: inline List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org 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