mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>,
	devicetree@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
	David Gibson <dgibson@redhat.com>, Rob Herring <robh@kernel.org>,
	Saravana Kannan <saravanak@google.com>
Subject: Re: libfdt: check return value of fdt_num_mem_rsv() in fdt_pack()
Date: Wed, 3 Jul 2024 10:43:31 +0200	[thread overview]
Message-ID: <8c69a0dc-8178-44fc-86c1-da67109ddd39@web.de> (raw)
In-Reply-To: <530a2dcf-82ad-4e59-a162-5d3080766e6c@canonical.com>

>>> 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

  reply	other threads:[~2024-07-03  8:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 21:54 [PATCH 1/1] " Heinrich Schuchardt
2024-07-02 12:54 ` [PATCH] " Markus Elfring
2024-07-02 20:27   ` Heinrich Schuchardt
2024-07-03  8:43     ` Markus Elfring [this message]
2024-07-02 17:31 ` [PATCH 1/1] " Rob Herring
2024-07-02 20:31   ` Heinrich Schuchardt

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=8c69a0dc-8178-44fc-86c1-da67109ddd39@web.de \
    --to=markus.elfring@web.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dgibson@redhat.com \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=saravanak@google.com \
    /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

all inboxes | Powered by JetHome®