All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Andrew Morton <akpm@linux-foundation.org>,
	Jonathan Corbet <corbet@lwn.net>
Cc: Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Nitin Gote <nitin.r.gote@intel.com>,
	Kees Cook <keescook@chromium.org>
Subject: linux-next: manual merge of the akpm-current tree with the jc_docs tree
Date: Wed, 11 Mar 2020 18:11:20 +1100	[thread overview]
Message-ID: <20200311181120.4fb51c72@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 4013 bytes --]

Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  Documentation/process/deprecated.rst

between commit:

  d8401f504b49 ("docs: deprecated.rst: Add %p to the list")
  76136e028d3b ("docs: deprecated.rst: Clean up fall-through details")
  7929b9836ed0 ("docs: Remove :c:func: from process/deprecated.rst")

from the jc_docs tree and commit:

  eacc9a8c9c2d ("Documentation/checkpatch: prefer stracpy/strscpy over strcpy/strlcpy/strncpy.")

from the akpm-current tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc Documentation/process/deprecated.rst
index e924d3197761,a0ffdc8daef3..000000000000
--- a/Documentation/process/deprecated.rst
+++ b/Documentation/process/deprecated.rst
@@@ -93,44 -93,22 +93,44 @@@ will be NUL terminated. This can lead t
  and other misbehavior due to the missing termination. It also NUL-pads the
  destination buffer if the source contents are shorter than the destination
  buffer size, which may be a needless performance penalty for callers using
- only NUL-terminated strings. The safe replacement is strscpy().
- (Users of strscpy() still needing NUL-padding should instead
- use strscpy_pad().)
+ only NUL-terminated strings. In this case, the safe replacement is
+ stracpy() or strscpy(). If, however, the destination buffer still needs
+ NUL-padding, the safe replacement is stracpy_pad().
  
 -If a caller is using non-NUL-terminated strings, :c:func:`strncpy()` can
 +If a caller is using non-NUL-terminated strings, strncpy()() can
  still be used, but destinations should be marked with the `__nonstring
  <https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html>`_
  attribute to avoid future compiler warnings.
  
  strlcpy()
  ---------
 -:c:func:`strlcpy` reads the entire source buffer first, possibly exceeding
 +strlcpy() reads the entire source buffer first, possibly exceeding
  the given limit of bytes to copy. This is inefficient and can lead to
  linear read overflows if a source string is not NUL-terminated. The
- safe replacement is strscpy().
+ safe replacement is stracpy() or strscpy().
  
 +%p format specifier
 +-------------------
 +Traditionally, using "%p" in format strings would lead to regular address
 +exposure flaws in dmesg, proc, sysfs, etc. Instead of leaving these to
 +be exploitable, all "%p" uses in the kernel are being printed as a hashed
 +value, rendering them unusable for addressing. New uses of "%p" should not
 +be added to the kernel. For text addresses, using "%pS" is likely better,
 +as it produces the more useful symbol name instead. For nearly everything
 +else, just do not add "%p" at all.
 +
 +Paraphrasing Linus's current `guidance <https://lore.kernel.org/lkml/CA+55aFwQEd_d40g4mUCSsVRZzrFPUJt74vc6PPpb675hYNXcKw@mail.gmail.com/>`_:
 +
 +- If the hashed "%p" value is pointless, ask yourself whether the pointer
 +  itself is important. Maybe it should be removed entirely?
 +- If you really think the true pointer value is important, why is some
 +  system state or user privilege level considered "special"? If you think
 +  you can justify it (in comments and commit log) well enough to stand
 +  up to Linus's scrutiny, maybe you can use "%px", along with making sure
 +  you have sensible permissions.
 +
 +And finally, know that a toggle for "%p" hashing will `not be accepted <https://lore.kernel.org/lkml/CA+55aFwieC1-nAs+NFq9RTwaR8ef9hWa4MjNBWL41F-8wM49eA@mail.gmail.com/>`_.
 +
  Variable Length Arrays (VLAs)
  -----------------------------
  Using stack VLAs produces much worse machine code than statically

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2020-03-11  7:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11  7:11 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-07-14  8:19 linux-next: manual merge of the akpm-current tree with the jc_docs tree Stephen Rothwell
2020-04-22  6:01 Stephen Rothwell
2019-10-02  3:18 Stephen Rothwell
2018-05-09 10:25 Stephen Rothwell
2018-05-09 13:28 ` Andrea Parri
2018-05-09 13:30   ` Andrea Parri
2018-05-09 14:59   ` Jonathan Corbet
2018-05-09 16:53     ` Andrea Parri
2018-05-09 17:11       ` Jonathan Corbet
2018-05-09 17:35         ` Andrea Parri
2016-12-14  3:42 Stephen Rothwell
2015-12-31 10:58 Stephen Rothwell
2015-12-31 10:43 Stephen Rothwell
2015-12-31 17:47 ` Elliott, Robert (Persistent Memory)

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=20200311181120.4fb51c72@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=nitin.r.gote@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.