linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Nir Lichtman <nir@lichtman.org>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Documentation: Fix incorrect paths/magic in magic numbers rst
Date: Mon, 04 Nov 2024 13:10:56 -0700	[thread overview]
Message-ID: <87jzdi7oa7.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20241104200328.GA73996@lichtman.org>

Nir Lichtman <nir@lichtman.org> writes:

> On Mon, Nov 04, 2024 at 12:35:30PM -0700, Jonathan Corbet wrote:
>> Nir Lichtman <nir@lichtman.org> writes:
>> 
>> > Fix some no longer true header/c file paths and correct the BAYCOM_MAGIC
>> > value to be decimal as in the source instead of incorrectly hexadecimal
>> >
>> > Signed-off-by: Nir Lichtman <nir@lichtman.org>
>> > ---
>> >  Documentation/staging/magic-number.rst | 6 +++---
>> >  1 file changed, 3 insertions(+), 3 deletions(-)
>> 
>> I've applied this, thanks.  I do continue to wonder about the value of
>> this file in general, though...
>
> Agreed, it feels pretty much like abandoned book keeping that gives minimal
> value since the chance of magics colliding is slim, but I think the general tip
> before the table of magics is pretty good.
>
> What is your opinion about integrating the tip in a different page and deleting
> this page entirely?

Well, that's part of my reasoning, actually.  I assume you're talking
about this:

> It is a **very** good idea to protect kernel data structures with magic
> numbers.  This allows you to check at run time whether (a) a structure
> has been clobbered, or (b) you've passed the wrong structure to a
> routine. 

The thing is, that's really not a guideline that anybody has followed
for many years.  I dug into this a while back:

  https://lwn.net/Articles/915163/

There was a series to remove all of this cruft a couple of years ago
that the author eventually gave up on:

  https://lore.kernel.org/lkml/cover.1668128257.git.nabijaczleweli@nabijaczleweli.xyz/

Honestly, I think the best thing to do is to simply remove the file.

Thanks,

jon

  reply	other threads:[~2024-11-04 20:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-25 13:51 [PATCH] Documentation: Fix incorrect paths/magic in magic numbers rst Nir Lichtman
2024-11-04 19:35 ` Jonathan Corbet
2024-11-04 20:03   ` Nir Lichtman
2024-11-04 20:10     ` Jonathan Corbet [this message]
2024-11-07 21:01       ` Nir Lichtman

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=87jzdi7oa7.fsf@trenco.lwn.net \
    --to=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nir@lichtman.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).