Re: [PATCH v2 0/5] Support for generalized use of make C={1,2} via a wrapper program

2017-12-17 Thread Joe Perches
On Sun, 2017-12-17 at 22:00 -0700, Jason Gunthorpe wrote:
> On Sun, Dec 17, 2017 at 03:14:10AM +0100, Knut Omang wrote:
> 
> > > I like the ability to add more checkers and keep then in the main
> > > upstream tree. But adding overrides for specific subsystems goes against
> > > the policy that all subsystems should be treated equally.
> > 
> > This is a tool to enable automated testing for as many checks as
> > possible, as soon as possible. Like any tool, it can be misused, but
> > that's IMHO an orthogonal problem that I think the maintainers will
> > be more than capable of preventing.
> > 
> > Think of this as a tightening screw: We eliminate errors class by
> > class or file by file, and in the same commit narrows in the list of
> > exceptions. That way we can fix issues piece by piece while avoiding
> > a lot of regressions in already clean parts.
> 
> Since you used drivers/infiniband as an example for this script..
> 
> I will say I agree with this idea.
> 
> It is not that we *want* infiniband to be different from the rest of
> the kernel, it is that we have this historical situation where we
> don't have a code base that already passes the various static checker
> things.
> 
> I would like it very much if I could run 'make static checker' and see
> no warnings. This helps me know that I when I accept patches I am not
> introducing new problems to code that has already been cleaned up.
> 
> Today when we run checkers we get so many warnings it is too hard to
> make any sense of it.

Here is a list of the checkpatch messages for drivers/infiniband
sorted by type.

Many of these might be corrected by using

$ ./scripts/checkpatch.pl -f --fix-inplace --types= \
  $(git ls-files drivers/infiniband/)

   5243 CHECK:CAMELCASE
   4487 WARNING:LONG_LINE
   1755 CHECK:PARENTHESIS_ALIGNMENT
   1664 CHECK:SPACING
910 WARNING:FUNCTION_ARGUMENTS
742 CHECK:OPEN_ENDED_LINE
685 CHECK:BRACES
643 CHECK:UNNECESSARY_PARENTHESES
478 WARNING:SIZEOF_PARENTHESIS
361 WARNING:UNSPECIFIED_INT
342 WARNING:LONG_LINE_COMMENT
338 ERROR:SPACING
338 CHECK:LINE_SPACING
306 WARNING:SPLIT_STRING
278 WARNING:SPACING
242 WARNING:SYMBOLIC_PERMS
194 WARNING:BLOCK_COMMENT_STYLE
175 CHECK:BIT_MACRO
158 WARNING:SPACE_BEFORE_TAB
154 WARNING:LINE_SPACING
139 CHECK:MACRO_ARG_REUSE
133 CHECK:UNCOMMENTED_DEFINITION
122 CHECK:AVOID_BUG
103 CHECK:COMPARISON_TO_NULL
101 WARNING:ENOSYS
 89 WARNING:BRACES
 78 WARNING:PREFER_PR_LEVEL
 74 WARNING:MULTILINE_DEREFERENCE
 59 CHECK:TYPO_SPELLING
 52 WARNING:EMBEDDED_FUNCTION_NAME
 52 CHECK:MULTIPLE_ASSIGNMENTS
 50 CHECK:PREFER_KERNEL_TYPES
 45 WARNING:RETURN_VOID
 39 WARNING:UNNECESSARY_ELSE
 38 ERROR:POINTER_LOCATION
 37 WARNING:ALLOC_WITH_MULTIPLY
 36 CHECK:ALLOC_SIZEOF_STRUCT
 35 CHECK:AVOID_EXTERNS
 34 WARNING:PRINTK_WITHOUT_KERN_LEVEL
 33 ERROR:CODE_INDENT
 32 WARNING:PREFER_PACKED
 32 CHECK:LOGICAL_CONTINUATIONS
 29 WARNING:MEMORY_BARRIER
 29 WARNING:LEADING_SPACE
 28 WARNING:DEEP_INDENTATION
 27 CHECK:USLEEP_RANGE
 23 WARNING:SUSPECT_CODE_INDENT
 23 ERROR:TRAILING_STATEMENTS
 21 WARNING:LONG_LINE_STRING
 20 WARNING:CONSIDER_KSTRTO
 18 WARNING:CONSTANT_COMPARISON
 18 ERROR:OPEN_BRACE
 15 WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE
 14 WARNING:VOLATILE
 14 ERROR:SWITCH_CASE_INDENT_LEVEL
 11 WARNING:OOM_MESSAGE
 11 WARNING:INCLUDE_LINUX
 10 WARNING:SSCANF_TO_KSTRTO
 10 WARNING:INDENTED_LABEL
  9 ERROR:GLOBAL_INITIALISERS
  9 ERROR:COMPLEX_MACRO
  9 ERROR:ASSIGN_IN_IF
  8 WARNING:UNNECESSARY_BREAK
  6 WARNING:PRINTF_L
  6 WARNING:MISORDERED_TYPE
  6 ERROR:INITIALISED_STATIC
  5 WARNING:TABSTOP
  5 WARNING:SINGLE_STATEMENT_DO_WHILE_MACRO
  5 WARNING:NAKED_SSCANF
  4 WARNING:NEEDLESS_IF
  4 ERROR:RETURN_PARENTHESES
  4 CHECK:BOOL_COMPARISON
  3 WARNING:TRAILING_SEMICOLON
  3 WARNING:STATIC_CONST_CHAR_ARRAY
  3 ERROR:TRAILING_WHITESPACE
  2 WARNING:UNNECESSARY_PARENTHESES
  2 WARNING:MISSING_SPACE
  2 WARNING:LOGGING_CONTINUATION
  2 CHECK:ARCH_DEFINES
  1 WARNING:TYPECAST_INT_CONSTANT
  1 WARNING:PREFER_DEV_LEVEL
  1 WARNING:NR_CPUS
  1 WARNING:NEW_TYPEDEFS
  1 WARNING:MINMAX
  1 WARNING:MACRO_WITH_FLOW_CONTROL
  1 WARNING:LINE_CONTINUATIONS
  1 WARNING:DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON
  1 WARNING:DEFAULT_NO_BREAK
  1 WARNING:CONST_STRUCT
  1 WARNING:CONSIDER_COMPLETION
  1 ERROR:WHILE_AFTER_BRACE
  1 ERROR:ELSE_AFTER_BRACE
  1 CHECK:REDUNDANT_CODE

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/5] Support for generalized use of make C={1,2} via a wrapper program

2017-12-17 Thread Jason Gunthorpe
On Sun, Dec 17, 2017 at 03:14:10AM +0100, Knut Omang wrote:

> > I like the ability to add more checkers and keep then in the main
> > upstream tree. But adding overrides for specific subsystems goes against
> > the policy that all subsystems should be treated equally.
> 
> This is a tool to enable automated testing for as many checks as
> possible, as soon as possible. Like any tool, it can be misused, but
> that's IMHO an orthogonal problem that I think the maintainers will
> be more than capable of preventing.
> 
> Think of this as a tightening screw: We eliminate errors class by
> class or file by file, and in the same commit narrows in the list of
> exceptions. That way we can fix issues piece by piece while avoiding
> a lot of regressions in already clean parts.

Since you used drivers/infiniband as an example for this script..

I will say I agree with this idea.

It is not that we *want* infiniband to be different from the rest of
the kernel, it is that we have this historical situation where we
don't have a code base that already passes the various static checker
things.

I would like it very much if I could run 'make static checker' and see
no warnings. This helps me know that I when I accept patches I am not
introducing new problems to code that has already been cleaned up.

Today when we run checkers we get so many warnings it is too hard to
make any sense of it.

Being able to say File X is now clean for check XYZ seems very useful
and may motivate people to clean up the files they actualy care
about...

> > There was discussion at Kernel Summit about how the different
> > subsystems already have different rules. This appears to be a way
> > to make that worse.
> 
> IMHO this is a tool that should help maintainers implement the
> policies they desire.  But the tool itself does not dictate any
> such.

Yes, again, in infiniband we like to see checkpatch be good for new
submission, even if that clashes with surrounding code. For instance
we have a mixture of sizeof foo and sizeof(foo) styles in the same
file/function now.

I certainly don't want to tell people they need to follow some
different style from 10 years ago when they send patches.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/3] doc: update kpt_restrict documentation

2017-12-17 Thread Randy Dunlap
On 12/17/2017 02:30 PM, Tobin C. Harding wrote:
> Recently the behaviour of printk specifier %pK was changed. The
> documentation does not currently mirror this.
> 
> Update documentation for sysctl kpt_restrict.
> 
> Signed-off-by: Tobin C. Harding 
> ---
>  Documentation/sysctl/kernel.txt | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
> index 63663039acb7..6b039aa1427a 100644
> --- a/Documentation/sysctl/kernel.txt
> +++ b/Documentation/sysctl/kernel.txt
> @@ -391,7 +391,8 @@ kptr_restrict:
>  This toggle indicates whether restrictions are placed on
>  exposing kernel addresses via /proc and other interfaces.
>  
> -When kptr_restrict is set to (0), the default, there are no restrictions.
> +When kptr_restrict is set to (0), the default, the address is hashed before

how about:
  is set to 0 (the default),
or
  is set to (0) [the default],


> +printing. (This is the equivalent to %p.)
>  
>  When kptr_restrict is set to (1), kernel pointers printed using the %pK
>  format specifier will be replaced with 0's unless the user has CAP_SYSLOG
> 


-- 
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/3] doc: update printk documentation

2017-12-17 Thread Tobin C. Harding
On Sun, Dec 17, 2017 at 02:34:25PM -0800, Joe Perches wrote:
> On Mon, 2017-12-18 at 09:30 +1100, Tobin C. Harding wrote:
> > This set converts printk-formats.txt -> core-api/printk-formats.rst
> > 
> > We also update the documentation around printing kernel addresses.
> 
> Please also update the comment in lib/vsprintf.c
> 
>  * ** Please update also Documentation/printk-formats.txt when making changes 
> **
> 
> > I'd like to get it _realy_ correct so that future
> 
> sp: realy->really
> 

Damn emphasis plays havoc with the spell checker. I do believe you have
made this comment before Joe ;) I'll learn to spell one day.

Will fix as suggested and re-spin.

thanks,
Tobin
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/3] doc: update printk documentation

2017-12-17 Thread Joe Perches
On Mon, 2017-12-18 at 09:30 +1100, Tobin C. Harding wrote:
> This set converts printk-formats.txt -> core-api/printk-formats.rst
> 
> We also update the documentation around printing kernel addresses.

Please also update the comment in lib/vsprintf.c

 * ** Please update also Documentation/printk-formats.txt when making changes **

> I'd like to get it _realy_ correct so that future

sp: realy->really

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/7] i3c: Add core I3C infrastructure

2017-12-17 Thread Randy Dunlap
On 12/14/17 07:16, Boris Brezillon wrote:
> Add core infrastructure to support I3C in Linux and document it.
> 
> Signed-off-by: Boris Brezillon 
> ---
>  drivers/Kconfig |2 +
>  drivers/Makefile|2 +-
>  drivers/i3c/Kconfig |   24 +
>  drivers/i3c/Makefile|4 +
>  drivers/i3c/core.c  |  573 
>  drivers/i3c/device.c|  344 ++
>  drivers/i3c/internals.h |   34 +
>  drivers/i3c/master.c| 1433 
> +++
>  drivers/i3c/master/Kconfig  |0
>  drivers/i3c/master/Makefile |0
>  include/linux/i3c/ccc.h |  380 +++
>  include/linux/i3c/device.h  |  321 +
>  include/linux/i3c/master.h  |  564 +++
>  include/linux/mod_devicetable.h |   17 +
>  14 files changed, 3697 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/i3c/Kconfig
>  create mode 100644 drivers/i3c/Makefile
>  create mode 100644 drivers/i3c/core.c
>  create mode 100644 drivers/i3c/device.c
>  create mode 100644 drivers/i3c/internals.h
>  create mode 100644 drivers/i3c/master.c
>  create mode 100644 drivers/i3c/master/Kconfig
>  create mode 100644 drivers/i3c/master/Makefile
>  create mode 100644 include/linux/i3c/ccc.h
>  create mode 100644 include/linux/i3c/device.h
>  create mode 100644 include/linux/i3c/master.h
> 
> diff --git a/drivers/i3c/Kconfig b/drivers/i3c/Kconfig
> new file mode 100644
> index ..cf3752412ae9
> --- /dev/null
> +++ b/drivers/i3c/Kconfig
> @@ -0,0 +1,24 @@
> +# SPDX-License-Identifier: GPL-2.0
> +
> +menuconfig I3C
> + tristate "I3C support"
> + select I2C
> + help
> +   I3C is a serial protocol standardized by the MIPI alliance.
> +
> +   It's supposed to be backward compatible with I2C while providing
> +   support for high speed transfers and native interrupt support
> +   without the need for extra pins.
> +
> +   The I3C protocol also standardizes the slave device types and is
> +   mainly design to communicate with sensors.
> +
> +   If you want I3C support, you should say Y here and also to the
> +   specific driver for your bus adapter(s) below.
> +
> +   This I3C support can also be built as a module.  If so, the module
> +   will be called i3c.
> +
> +if I3C
> +source "drivers/i3c/master/Kconfig"
> +endif # I3C

> diff --git a/drivers/i3c/core.c b/drivers/i3c/core.c
> new file mode 100644
> index ..7eb8e84acd33
> --- /dev/null
> +++ b/drivers/i3c/core.c
> @@ -0,0 +1,573 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2017 Cadence Design Systems Inc.
> + *
> + * Author: Boris Brezillon 
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 

#include 
#include 
#include 
#include 
#include 


> +#include "internals.h"
> +
> +static DEFINE_IDR(i3c_bus_idr);
> +static DEFINE_MUTEX(i3c_core_lock);
> +

> +/**
> + * i3c_bus_maintenance_lock - Release the bus lock after a maintenance

  unlock

> + * operation
> + * @bus: I3C bus to release the lock on
> + *
> + * Should be called when the bus maintenance operation is done. See
> + * i3c_bus_maintenance_lock() for more details on what these maintenance
> + * operations are.
> + */
> +void i3c_bus_maintenance_unlock(struct i3c_bus *bus)
> +{
> + up_write(>lock);
> +}
> +EXPORT_SYMBOL_GPL(i3c_bus_maintenance_unlock);
> +

> +/**
> + * i3c_bus_normaluse_lock - Release the bus lock after a normal operation

unlock

> + * @bus: I3C bus to release the lock on
> + *
> + * Should be called when a normal operation is done. See
> + * i3c_bus_normaluse_lock() for more details on what these normal operations
> + * are.
> + */
> +void i3c_bus_normaluse_unlock(struct i3c_bus *bus)
> +{
> + up_read(>lock);
> +}
> +EXPORT_SYMBOL_GPL(i3c_bus_normaluse_unlock);



> +static int i3c_device_match(struct device *dev, struct device_driver *drv)

bool?

> +{
> + struct i3c_device *i3cdev;
> + struct i3c_driver *i3cdrv;
> +
> + if (dev->type != _device_type)
> + return 0;
> +
> + i3cdev = dev_to_i3cdev(dev);
> + i3cdrv = drv_to_i3cdrv(drv);
> + if (i3c_device_match_id(i3cdev, i3cdrv->id_table))
> + return 1;
> +
> + return 0;
> +}


> diff --git a/drivers/i3c/device.c b/drivers/i3c/device.c
> new file mode 100644
> index ..dcf51150b7cb
> --- /dev/null
> +++ b/drivers/i3c/device.c
> @@ -0,0 +1,344 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2017 Cadence Design Systems Inc.
> + *
> + * Author: Boris Brezillon 
> + */
> +
> +#include 

#include 
#include 
#include 
#include 
#include 

> +#include "internals.h"



> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> new file mode 100644
> 

[PATCH v2 1/3] doc: convert printk-formats.txt to rst

2017-12-17 Thread Tobin C. Harding
Documentation/printk-formats.txt is a candidate for conversion to
ReStructuredText format. Some effort has already been made to do this
conversion even thought the suffix is currently .txt

Changes required to complete conversion

 - Move printk-formats.txt to core-api/printk-formats.rst
 - Add entry to Documentation/core-api/index.rst
 - Remove entry from Documentation/00-INDEX
 - Fix minor grammatical errors.
 - Order heading adornments as suggested by rst docs.
 - Use 'Passed by reference' uniformly.
 - Update pointer documentation around %px specifier.
 - Fix erroneous double backticks (to commas).
 - Simplify documentation for kobject.

Signed-off-by: Tobin C. Harding 
---
 Documentation/00-INDEX |   2 -
 Documentation/core-api/index.rst   |   1 +
 .../printk-formats.rst}| 271 +++--
 3 files changed, 141 insertions(+), 133 deletions(-)
 rename Documentation/{printk-formats.txt => core-api/printk-formats.rst} (57%)

diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX
index 3bec49c33bbb..7023bfaec21c 100644
--- a/Documentation/00-INDEX
+++ b/Documentation/00-INDEX
@@ -346,8 +346,6 @@ prctl/
- directory with info on the priveledge control subsystem
 preempt-locking.txt
- info on locking under a preemptive kernel.
-printk-formats.txt
-   - how to get printk format specifiers right
 process/
- how to work with the mainline kernel development process.
 pps/
diff --git a/Documentation/core-api/index.rst b/Documentation/core-api/index.rst
index d4d54b05d6c5..d55ee6b006ed 100644
--- a/Documentation/core-api/index.rst
+++ b/Documentation/core-api/index.rst
@@ -22,6 +22,7 @@ Core utilities
flexible-arrays
librs
genalloc
+   printk-formats
 
 Interfaces for kernel debugging
 ===
diff --git a/Documentation/printk-formats.txt 
b/Documentation/core-api/printk-formats.rst
similarity index 57%
rename from Documentation/printk-formats.txt
rename to Documentation/core-api/printk-formats.rst
index aa0a776c817a..cf266992261e 100644
--- a/Documentation/printk-formats.txt
+++ b/Documentation/core-api/printk-formats.rst
@@ -5,6 +5,7 @@ How to get printk format specifiers right
 :Author: Randy Dunlap 
 :Author: Andrew Murray 
 
+
 Integer types
 =
 
@@ -25,39 +26,45 @@ Integer types
s64 %lld or %llx
u64 %llu or %llx
 
-If  is dependent on a config option for its size (e.g., ``sector_t``,
-``blkcnt_t``) or is architecture-dependent for its size (e.g., ``tcflag_t``),
-use a format specifier of its largest possible type and explicitly cast to it.
+
+If  is dependent on a config option for its size (e.g., sector_t,
+blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a
+format specifier of its largest possible type and explicitly cast to it.
 
 Example::
 
printk("test: sector number/total blocks: %llu/%llu\n",
(unsigned long long)sector, (unsigned long long)blockcount);
 
-Reminder: ``sizeof()`` result is of type ``size_t``.
+Reminder: sizeof() returns type size_t.
 
-The kernel's printf does not support ``%n``. For obvious reasons, floating
-point formats (``%e, %f, %g, %a``) are also not recognized. Use of any
+The kernel's printf does not support %n. Floating point formats (%e, %f,
+%g, %a) are also not recognized, for obvious reasons. Use of any
 unsupported specifier or length qualifier results in a WARN and early
-return from vsnprintf.
-
-Raw pointer value SHOULD be printed with %p. The kernel supports
-the following extended format specifiers for pointer types:
+return from vsnprintf().
 
-Pointer Types
+Pointer types
 =
 
-Pointers printed without a specifier extension (i.e unadorned %p) are
-hashed to give a unique identifier without leaking kernel addresses to user
-space. On 64 bit machines the first 32 bits are zeroed. If you _really_
-want the address see %px below.
+A raw pointer value may be printed with %p which will hash the address
+before printing. The Kernel also supports extended specifiers for printing
+pointers of different types.
+
+Plain pointers
+--
 
 ::
 
%p  abcdef12 or abcdef12
 
-Symbols/Function Pointers
-=
+Pointers printed without a specifier extension (i.e unadorned %p) are
+hashed to prevent leaking information about the kernel memory layout. This
+has the added benefit of providing a unique identifier. On 64-bit machines
+the first 32 bits are zeroed. If you *really* want the address see %px
+below.
+
+Symbols/Function pointers
+-
 
 ::
 
@@ -69,22 +76,22 @@ Symbols/Function Pointers
%ps versatile_init
%pB prev_fn_of_versatile_init+0x88/0x88
 
-The ``F`` and ``f`` specifiers are for printing function pointers,
-for example, 

[PATCH v2 2/3] doc: update kpt_restrict documentation

2017-12-17 Thread Tobin C. Harding
Recently the behaviour of printk specifier %pK was changed. The
documentation does not currently mirror this.

Update documentation for sysctl kpt_restrict.

Signed-off-by: Tobin C. Harding 
---
 Documentation/sysctl/kernel.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index 63663039acb7..6b039aa1427a 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -391,7 +391,8 @@ kptr_restrict:
 This toggle indicates whether restrictions are placed on
 exposing kernel addresses via /proc and other interfaces.
 
-When kptr_restrict is set to (0), the default, there are no restrictions.
+When kptr_restrict is set to (0), the default, the address is hashed before
+printing. (This is the equivalent to %p.)
 
 When kptr_restrict is set to (1), kernel pointers printed using the %pK
 format specifier will be replaced with 0's unless the user has CAP_SYSLOG
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 3/3] doc: add documentation on printing kernel addresses

2017-12-17 Thread Tobin C. Harding
Hashing addresses printed with printk specifier %p was implemented
recently. During development a number of issues were raised regarding
leaking kernel addresses to userspace. Other documentation was updated but
security/self-protection missed out.

Add self-protection documentation regarding printing kernel addresses.

Signed-off-by: Tobin C. Harding 
---
 Documentation/security/self-protection.rst | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/Documentation/security/self-protection.rst 
b/Documentation/security/self-protection.rst
index 60c8bd8b77bf..0f53826c78b9 100644
--- a/Documentation/security/self-protection.rst
+++ b/Documentation/security/self-protection.rst
@@ -270,6 +270,21 @@ attacks, it is important to defend against exposure of 
both kernel memory
 addresses and kernel memory contents (since they may contain kernel
 addresses or other sensitive things like canary values).
 
+Kernel addresses
+
+
+Printing kernel addresses to userspace leaks sensitive information about
+the kernel memory layout. Care should be exercised when using any printk
+specifier that prints the raw address, currently %px, %p[ad], (and %p[sSb]
+in certain circumstances [*]).  Any file written to using one of these
+specifiers should be readable only by privileged processes.
+
+Kernels 4.14 and older printed the raw address using %p. As of 4.15-rc1
+addresses printed with the specifier %p are hashed before printing.
+
+[*] If KALLSYMS is enabled and symbol lookup fails, the raw address is
+printed. If KALLSYMS is not enabled the raw address is printed.
+
 Unique identifiers
 --
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/3] doc: update printk documentation

2017-12-17 Thread Tobin C. Harding
This set converts printk-formats.txt -> core-api/printk-formats.rst

We also update the documentation around printing kernel addresses.

For v2 I have attempted to toe the line more in regards to 'make as
few changes as possible to complete the conversion'.

This is my first documentation conversion. Please do be hard on this
patch series. I'd like to get it _realy_ correct so that future
conversions will require less review effort. Also if there are any
peculiarities to patching docs (as apposed to C files) please say so.

Thank you for the time already given to reviewing previous versions.

thanks,
Tobin.

v2:
 - Remove conversion/inclusion of kernel-docs from lib/vsprintf.c
 - Add '<>' around file name (in section 'Thanks').
 - Remove a few more double back ticks. 
 - Remove unnecessary [style] edits.

Tobin C. Harding (3):
  doc: convert printk-formats.txt to rst
  doc: update kpt_restrict documentation
  doc: add documentation on printing kernel addresses

 Documentation/00-INDEX |   2 -
 Documentation/core-api/index.rst   |   1 +
 .../printk-formats.rst}| 271 +++--
 Documentation/security/self-protection.rst |  15 ++
 Documentation/sysctl/kernel.txt|   3 +-
 5 files changed, 158 insertions(+), 134 deletions(-)
 rename Documentation/{printk-formats.txt => core-api/printk-formats.rst} (57%)

-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html