[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8c69a0dc-8178-44fc-86c1-da67109ddd39@web.de>
Date: Wed, 3 Jul 2024 10:43:31 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Heinrich Schuchardt <heinrich.schuchardt@...onical.com>,
devicetree@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>, David Gibson <dgibson@...hat.com>,
Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>
Subject: Re: libfdt: check return value of fdt_num_mem_rsv() in fdt_pack()
>>> fdt_num_mem_rsv() may return -FDT_ERR_TRUNCATED.
>>> In this case fdt_pack() should propagate the error code.
>>
>> 1. Please choose imperative wordings for an improved change description.
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc6#n94
>
> The current subject is an imperative?
Yes.
The requirement for “imperative mood” affects mostly the commit message (or “changelog”),
doesn't it?
>> 2. Would you like to add any tags (like “Fixes” and “Cc”)?
>
> d5db5382c5e5 ("libfdt: Safer access to memory reservations") introduced the check that returns the error code. But before that we could simply overrun the buffer.
Would an other commit be a more appropriate reference?
> I would not know which patch to blame.
Please take another look at a corresponding information source:
https://github.com/dgibson/dtc/blame/main/libfdt/fdt_rw.c#L487-L500
Update candidate:
libfdt: Handle v16 and re-ordered trees for r/w
2007-11-01
https://github.com/dgibson/dtc/commit/a041dcdc48453f26b76bccdb5e2a1ebb3a0ea987#diff-1a98f2be127ff35ab7183bdae1e010189c9992b3bd6e6779fa7b7e451bf72ac4R382
> Whom do you want to Cc?
I suggest to take another look at corresponding information sources.
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v6.10-rc6#n34
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc6#n458
>> 3. How do you think about to use a summary phrase like “Complete error handling
>> in fdt_pack()”?
>
> Why should I choose a less specific subject?
You would like to improve the error detection and corresponding exception handling another bit,
wouldn't you?
* https://cwe.mitre.org/data/definitions/252.html
* https://wiki.sei.cmu.edu/confluence/display/c/EXP12-C.+Do+not+ignore+values+returned+by+functions
Regards,
Markus
Powered by blists - more mailing lists