On Mon, Oct 11, 2021 at 05:25:29PM +0200, Christophe Leroy wrote:
> There are three architectures with function descriptors, try to
> have common names for the address they contain in order to
> refactor some functions into generic functions later.
>
> powerpc has 'funcaddr'
> ia64 has 'ip'
> pari
On Mon, Oct 11, 2021 at 05:25:30PM +0200, Christophe Leroy wrote:
> There are three architectures with function descriptors, try to
> have common names for the address they contain in order to
> refactor some functions into generic functions later.
>
> powerpc has 'funcaddr'
> ia64 has 'ip'
> pari
On Mon, Oct 11, 2021 at 05:25:31PM +0200, Christophe Leroy wrote:
> Use HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR instead of
> 'dereference_function_descriptor'
> to know whether arch has function descriptors.
>
> Signed-off-by: Christophe Leroy
I'd mention the intentionally-empty #if/#else in the c
On Mon, Oct 11, 2021 at 05:25:32PM +0200, Christophe Leroy wrote:
> We have three architectures using function descriptors, each with its
> own name.
>
> Add a common typedef that can be used in generic code.
>
> Also add a stub typedef for architecture without function descriptors,
nit: funct_d
On Mon, Oct 11, 2021 at 05:25:33PM +0200, Christophe Leroy wrote:
> dereference_function_descriptor() and
> dereference_kernel_function_descriptor() are identical on the
> three architectures implementing them.
>
> Make it common.
>
> Signed-off-by: Christophe Leroy
> ---
> arch/ia64/include/as
On Mon, Oct 11, 2021 at 05:25:34PM +0200, Christophe Leroy wrote:
> LKDTM tests display that the run do_nothing() at a given
> address, but in reality do_nothing() is inlined into the
> caller.
>
> Force it out of line so that it really runs text at the
> displayed address.
>
> Signed-off-by: Chr
On Mon, Oct 11, 2021 at 05:25:35PM +0200, Christophe Leroy wrote:
> WRITE_KERN is supposed to overwrite some kernel text, namely
> do_overwritten() function.
>
> But at the time being it overwrites do_overwritten() function
> descriptor, not function text.
>
> Fix it by dereferencing the function
On Mon, Oct 11, 2021 at 05:25:36PM +0200, Christophe Leroy wrote:
> Behind a location, lkdtm_EXEC_RODATA() executes a real function,
> not a copy of do_nothing().
>
> So do it directly instead of using execute_location().
I don't understand this. Why does the next patch not fix this?
-Kees
>
>
On Mon, Oct 11, 2021 at 05:25:37PM +0200, Christophe Leroy wrote:
> execute_location() and execute_user_location() intent
> to copy do_nothing() text and execute it at a new location.
> However, at the time being it doesn't copy do_nothing() function
> but do_nothing() function descriptor which sti
On Mon, Oct 11, 2021 at 05:25:36PM +0200, Christophe Leroy wrote:
> Behind a location, lkdtm_EXEC_RODATA() executes a real function,
> not a copy of do_nothing().
>
> So do it directly instead of using execute_location().
>
> And fix displayed addresses by dereferencing the function descriptors.
>
Le 13/10/2021 à 09:01, Kees Cook a écrit :
On Mon, Oct 11, 2021 at 05:25:32PM +0200, Christophe Leroy wrote:
We have three architectures using function descriptors, each with its
own name.
Add a common typedef that can be used in generic code.
Also add a stub typedef for architecture withou
On Wed, Oct 13, 2021 at 09:23:56AM +0200, Christophe Leroy wrote:
>
>
> Le 13/10/2021 à 09:01, Kees Cook a écrit :
> > On Mon, Oct 11, 2021 at 05:25:32PM +0200, Christophe Leroy wrote:
> > > We have three architectures using function descriptors, each with its
> > > own name.
> > >
> > > Add a c
Le 13/10/2021 à 09:05, Kees Cook a écrit :
On Mon, Oct 11, 2021 at 05:25:35PM +0200, Christophe Leroy wrote:
WRITE_KERN is supposed to overwrite some kernel text, namely
do_overwritten() function.
But at the time being it overwrites do_overwritten() function
descriptor, not function text.
F
Le 13/10/2021 à 09:09, Kees Cook a écrit :
On Mon, Oct 11, 2021 at 05:25:36PM +0200, Christophe Leroy wrote:
Behind a location, lkdtm_EXEC_RODATA() executes a real function,
not a copy of do_nothing().
So do it directly instead of using execute_location().
I don't understand this. Why does
Le 13/10/2021 à 09:23, Kees Cook a écrit :
On Mon, Oct 11, 2021 at 05:25:36PM +0200, Christophe Leroy wrote:
Behind a location, lkdtm_EXEC_RODATA() executes a real function,
not a copy of do_nothing().
So do it directly instead of using execute_location().
And fix displayed addresses by der
Le 13/10/2021 à 09:39, Christophe Leroy a écrit :
Le 13/10/2021 à 09:23, Kees Cook a écrit :
On Mon, Oct 11, 2021 at 05:25:36PM +0200, Christophe Leroy wrote:
Behind a location, lkdtm_EXEC_RODATA() executes a real function,
not a copy of do_nothing().
So do it directly instead of using ex
> diff --git a/include/linux/trace_recursion.h b/include/linux/trace_recursion.h
> index a9f9c57..101e1fb 100644
> --- a/include/linux/trace_recursion.h
> +++ b/include/linux/trace_recursion.h
> @@ -208,13 +208,29 @@ static __always_inline void trace_clear_recursion(int
> bit)
> * Use this for f
On 09 October 2021 at 03:57 pm, Christian Zigotzky wrote:
> On 09 October 2021 at 12:10 pm, Wolfram Sang wrote:
>>> I still don't have access to any old PASemi hardware but the
changes from
>>> v1 are pretty small and I expect them to still work. Would still be
nice
>>> if someone with access t
On 2021/10/13 下午3:55, Miroslav Benes wrote:
>> diff --git a/include/linux/trace_recursion.h
>> b/include/linux/trace_recursion.h
>> index a9f9c57..101e1fb 100644
>> --- a/include/linux/trace_recursion.h
>> +++ b/include/linux/trace_recursion.h
>> @@ -208,13 +208,29 @@ static __always_inline voi
Le 13/10/2021 à 02:48, Michael Ellerman a écrit :
Christophe Leroy writes:
Le 12/10/2021 à 08:24, Michael Ellerman a écrit :
Liu Shixin writes:
kindly ping.
I was under the impression you were trying to debug why it wasn't
working with Christophe.
The investigation was a bit dormant t
> > Side note... the comment will eventually conflict with peterz's
> > https://lore.kernel.org/all/20210929152429.125997...@infradead.org/.
>
> Steven, would you like to share your opinion on this patch?
>
> If klp_synchronize_transition() will be removed anyway, the comments
> will be meaningl
On 2021/10/13 下午4:25, Miroslav Benes wrote:
>>> Side note... the comment will eventually conflict with peterz's
>>> https://lore.kernel.org/all/20210929152429.125997...@infradead.org/.
>>
>> Steven, would you like to share your opinion on this patch?
>>
>> If klp_synchronize_transition() will b
The testing show that perf_ftrace_function_call() are using smp_processor_id()
with preemption enabled, all the checking on CPU could be wrong after
preemption.
As Peter point out, the section between ftrace_test_recursion_trylock/unlock()
pair require the preemption to be disabled as
'Documenta
As the documentation explained, ftrace_test_recursion_trylock()
and ftrace_test_recursion_unlock() were supposed to disable and
enable preemption properly, however currently this work is done
outside of the function, which could be missing by mistake.
This path will make sure the preemption was di
With CONFIG_DEBUG_PREEMPT we observed reports like:
BUG: using smp_processor_id() in preemptible
caller is perf_ftrace_function_call+0x6f/0x2e0
CPU: 1 PID: 680 Comm: a.out Not tainted
Call Trace:
dump_stack_lvl+0x8d/0xcf
check_preemption_disabled+0x104/0x110
? optimize_nops.is
On 13/10/2021 01:18, Michael Ellerman wrote:
Laurent Vivier writes:
Commit 112665286d08 moved guest_exit() in the interrupt protected
area to avoid wrong context warning (or worse), but the tick counter
cannot be updated and the guest time is accounted to the system time.
To fix the problem po
On Wed, Oct 13, 2021 at 03:36:22PM +0900, Masahiro Yamada wrote:
> Documentation/kbuild/makefiles.rst suggests to use "archclean" for
> cleaning arch/$(SRCARCH)/boot/.
>
> Since commit d92cc4d51643 ("kbuild: require all architectures to have
> arch/$(SRCARCH)/Kbuild"), we can use the "subdir- += b
Documentation/kbuild/makefiles.rst suggests to use "archclean" for
cleaning arch/$(SRCARCH)/boot/.
Since commit d92cc4d51643 ("kbuild: require all architectures to have
arch/$(SRCARCH)/Kbuild"), we can use the "subdir- += boot" trick for
all architectures. This can take advantage of the parallel o
On Wed, Oct 13, 2021 at 8:43 AM Masahiro Yamada wrote:
> Documentation/kbuild/makefiles.rst suggests to use "archclean" for
> cleaning arch/$(SRCARCH)/boot/.
>
> Since commit d92cc4d51643 ("kbuild: require all architectures to have
> arch/$(SRCARCH)/Kbuild"), we can use the "subdir- += boot" trick
On Tue, Oct 12, 2021 at 06:32:12PM -0500, Bjorn Helgaas wrote:
> On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote:
> > Hello,
> >
> > this is v6 of the quest to drop the "driver" member from struct pci_dev
> > which tracks the same data (apart from a constant offset) as dev.driver.
On Wed, Oct 13, 2021 at 2:33 AM Bjorn Helgaas wrote:
> On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote:
> I split some of the bigger patches apart so they only touched one
> driver or subsystem at a time. I also updated to_pci_driver() so it
> returns NULL when given NULL, which
Hi Dan,
Any comments on this patch-set?
Thanks,
Kajol Jain
On 9/28/21 6:11 PM, Kajol Jain wrote:
> Patchset adds performance stats reporting support for nvdimm.
> Added interface includes support for pmu register/unregister
> functions. A structure is added called nvdimm_pmu to be used for
> a
Le 13/10/2021 à 09:02, Kees Cook a écrit :
On Mon, Oct 11, 2021 at 05:25:33PM +0200, Christophe Leroy wrote:
dereference_function_descriptor() and
dereference_kernel_function_descriptor() are identical on the
three architectures implementing them.
Make it common.
Signed-off-by: Christophe L
On Wed, Oct 13, 2021 at 1:20 PM Christophe Leroy
wrote:
> Le 13/10/2021 à 09:02, Kees Cook a écrit :
> > On Mon, Oct 11, 2021 at 05:25:33PM +0200, Christophe Leroy wrote:
> >> dereference_function_descriptor() and
> >> dereference_kernel_function_descriptor() are identical on the
> >> three archit
Le 13/10/2021 à 09:16, Kees Cook a écrit :
On Mon, Oct 11, 2021 at 05:25:37PM +0200, Christophe Leroy wrote:
execute_location() and execute_user_location() intent
to copy do_nothing() text and execute it at a new location.
However, at the time being it doesn't copy do_nothing() function
but d
Le 13/10/2021 à 09:48, Christophe Leroy a écrit :
Le 13/10/2021 à 09:39, Christophe Leroy a écrit :
Le 13/10/2021 à 09:23, Kees Cook a écrit :
On Mon, Oct 11, 2021 at 05:25:36PM +0200, Christophe Leroy wrote:
Behind a location, lkdtm_EXEC_RODATA() executes a real function,
not a copy of
On Wed, 13 Oct 2021 16:34:53 +0800
王贇 wrote:
> On 2021/10/13 下午4:25, Miroslav Benes wrote:
> >>> Side note... the comment will eventually conflict with peterz's
> >>> https://lore.kernel.org/all/20210929152429.125997...@infradead.org/.
> >>
> >> Steven, would you like to share your opinion on
Follow the locking model used within soc-pcm.c
Signed-off-by: Pierre-Louis Bossart
---
sound/soc/fsl/fsl_asrc_dma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
index cd9b36ec0ecb..b67097503836 100644
--- a/sound/soc/fsl/fsl_as
.opd section contains function descriptors used to locate
functions in the kernel. If someone is able to modify a
function descriptor he will be able to run arbitrary
kernel function instead of another.
To avoid that, move .opd section inside read-only memory.
Signed-off-by: Christophe Leroy
---
Michael Ellerman writes:
> Fabiano Rosas writes:
>> Nicholas Piggin writes:
>>
>>> The TIDR SPR only exists on POWER9. Avoid accessing it when the
>>> feature bit for it is not set.
>>
>> Not related to this patch, but how does this work with compat mode? A P9
>> compat mode guest would get an
The page_alloc.c code will call into __kernel_map_pages when
DEBUG_PAGEALLOC is configured and enabled.
As the implementation assumes hash, this should crash spectacularly if
not for a bit of luck in __kernel_map_pages. In this function
linear_map_hash_count is always zero, the for loop exits with
Fix ranges property warnings:
pci@fd00:ranges: 'oneOf' conditional failed, one must be fixed:
Signed-off-by: Anatolij Gustschin
---
arch/powerpc/boot/dts/a4m072.dts| 6 +++---
arch/powerpc/boot/dts/charon.dts| 6 +++---
arch/powerpc/boot/dts/digsy_mtc.dts | 6 +++---
arch/powerpc/boo
This series fixes localbus, memory and pci node build warnings.
It was tested with current linux-next on digsy_mtc and tqm5200
boards.
Anatolij Gustschin (4):
powerpc/5200: dts: add missing pci ranges
powerpc/5200: dts: fix pci ranges warnings
powerpc/5200: dts: fix memory node unit name
p
Fixes build warnings:
Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but
no unit name
Signed-off-by: Anatolij Gustschin
---
arch/powerpc/boot/dts/charon.dts| 2 +-
arch/powerpc/boot/dts/digsy_mtc.dts | 2 +-
arch/powerpc/boot/dts/lite5200.dts | 2 +-
arch/powerp
Fix build warnings like:
localbus:ranges: 'oneOf' conditional failed, one must be fixed
...
Warning (unit_address_vs_reg): /localbus: node has a reg or ranges property,
but no unit name
Warning (simple_bus_reg): /localbus/flash@0,0: simple-bus unit address format
error, expected "0"
Signed-off-b
Add ranges property to fix build warnings:
Warning (pci_bridge): /pci@fd00: missing ranges for PCI bridge (or not a
bridge)
Signed-off-by: Anatolij Gustschin
---
arch/powerpc/boot/dts/mpc5200b.dtsi | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/boot/dts/
Hi Arnd, Rob,
On Tue, 12 Oct 2021 16:39:56 +0200
Arnd Bergmann a...@arndb.de wrote:
...
>Grant Likely was the original maintainer for MPC52xx until 2011,
>Anatolij Gustschin is still listed as maintainer since then but hasn't
>been active in it for a while either. Anatolij can probably best judge
On Wed, Oct 13, 2021 at 5:12 PM Anatolij Gustschin wrote:
>
> Hi Arnd, Rob,
>
> On Tue, 12 Oct 2021 16:39:56 +0200
> Arnd Bergmann a...@arndb.de wrote:
> ...
> >Grant Likely was the original maintainer for MPC52xx until 2011,
> >Anatolij Gustschin is still listed as maintainer since then but hasn'
On Wed, 13 Oct 2021 17:17:25 -0500
Rob Herring robh...@kernel.org wrote:
...
>In general, you shouldn't need to be changing the drivers. Can you
>tell me which warnings need driver changes?
ethernet and mdio drivers share registers, so they use same unit-address:
arch/powerpc/boot/dts/tqm5200.dts
Fix build warning:
Warning (spi_bus_bridge): /soc5200@f000/psc@2000: node name for SPI buses
should be 'spi'
Signed-off-by: Anatolij Gustschin
---
arch/powerpc/boot/dts/motionpro.dts | 4
arch/powerpc/boot/dts/o2d.dtsi | 6 +-
2 files changed, 9 insertions(+), 1 deletion(-)
d
On Wed, Oct 13, 2021 at 5:28 PM Anatolij Gustschin wrote:
>
> On Wed, 13 Oct 2021 17:17:25 -0500
> Rob Herring robh...@kernel.org wrote:
> ...
> >In general, you shouldn't need to be changing the drivers. Can you
> >tell me which warnings need driver changes?
>
> ethernet and mdio drivers share re
For 64-bit book3s the default should be 64K as that's what modern CPUs
are designed for.
The following defconfigs already set CONFIG_PPC_64K_PAGES:
cell_defconfig
pasemi_defconfig
powernv_defconfig
ppc64_defconfig
pseries_defconfig
skiroot_defconfig
The have the option removed from the def
On Wed, Oct 13, 2021 at 10:51:31AM +0200, Uwe Kleine-König wrote:
> On Tue, Oct 12, 2021 at 06:32:12PM -0500, Bjorn Helgaas wrote:
> > On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote:
> > > Hello,
> > >
> > > this is v6 of the quest to drop the "driver" member from struct pci_dev
Hello,
On Wed, Oct 13, 2021 at 05:54:28AM -0500, Bjorn Helgaas wrote:
> On Wed, Oct 13, 2021 at 10:51:31AM +0200, Uwe Kleine-König wrote:
> > On Tue, Oct 12, 2021 at 06:32:12PM -0500, Bjorn Helgaas wrote:
> > > diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c
> > > index d997c9c3eb
On Wed, Oct 13, 2021 at 12:26:42PM +0300, Andy Shevchenko wrote:
> On Wed, Oct 13, 2021 at 2:33 AM Bjorn Helgaas wrote:
> > On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote:
>
> > I split some of the bigger patches apart so they only touched one
> > driver or subsystem at a time.
On Wed, Oct 13, 2021 at 06:33:56AM -0500, Bjorn Helgaas wrote:
> On Wed, Oct 13, 2021 at 12:26:42PM +0300, Andy Shevchenko wrote:
> > On Wed, Oct 13, 2021 at 2:33 AM Bjorn Helgaas wrote:
> > > On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote:
...
> > It's a bit unusual. Other to_
In dcr-low.S we use cmpli with three arguments, instead of four
arguments as defined in the ISA:
cmpli cr0,r3,1024
This appears to be a PPC440-ism, looking at the "PPC440x5 CPU Core
User’s Manual" it shows cmpli having no L field, but implied to be 0 due
to the core being 32-bit. It men
LKDTM tests display that the run do_nothing() at a given
address, but in reality do_nothing() is inlined into the
caller.
Force it out of line so that it really runs text at the
displayed address.
Acked-by: Kees Cook
Signed-off-by: Christophe Leroy
---
drivers/misc/lkdtm/perms.c | 4 ++--
1 fi
Behind its location, lkdtm_EXEC_RODATA() executes
lkdtm_rodata_do_nothing() which is a real function,
not a copy of do_nothing().
So executes it directly instead of using execute_location().
This is necessary because following patch will fix execute_location()
to use a copy of the function descri
WRITE_KERN is supposed to overwrite some kernel text, namely
do_overwritten() function.
But at the time being it overwrites do_overwritten() function
descriptor, not function text.
Fix it by dereferencing the function descriptor to obtain
function text pointer.
And make do_overwritten() noinline
'struct ppc64_opd_entry' doesn't belong to uapi/asm/elf.h
It was initially in module_64.c and commit 2d291e902791 ("Fix compile
failure with non modular builds") moved it into asm/elf.h
But it was by mistake added outside of __KERNEL__ section,
therefore commit c3617f72036c ("UAPI: (Scripted) Dis
In preparation of making func_desc_t generic, change it to
a struct containing 'addr' element.
In addition this allows using single helpers common to ELFv1 and ELFv2.
Signed-off-by: Christophe Leroy
---
arch/powerpc/kernel/module_64.c | 34 +++--
1 file changed, 15 i
There are three architectures with function descriptors, try to
have common names for the address they contain in order to
refactor some functions into generic functions later.
powerpc has 'funcaddr'
ia64 has 'ip'
parisc has 'addr'
Vote for 'addr' and update 'struct fdesc' accordingly.
Reviewed-
'func_descr_t' is redundant with 'struct ppc64_opd_entry'
Remove it.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/code-patching.h | 2 +-
arch/powerpc/include/asm/types.h | 6 --
arch/powerpc/kernel/signal_64.c | 8
3 files changed, 5 insertions(+),
PPC64/IA64/PARISC have function descriptors. LKDTM doesn't work
on those three architectures because LKDTM messes up function
descriptors with functions.
This series does some cleanup in the three architectures and
refactors function descriptors so that it can then easily use it
in a generic way i
There are three architectures with function descriptors, try to
have common names for the address they contain in order to
refactor some functions into generic functions later.
powerpc has 'funcaddr'
ia64 has 'ip'
parisc has 'addr'
Vote for 'addr' and update 'struct ppc64_opd_entry' accordingly.
Add WRITE_OPD to check that you can't modify function
descriptors.
Gives the following result when function descriptors are
not protected:
lkdtm: Performing direct entry WRITE_OPD
lkdtm: attempting bad 16 bytes write at c269b358
lkdtm: FAIL: survived bad write
We have three architectures using function descriptors, each with its
own name.
Add a common typedef that can be used in generic code.
Also add a stub typedef for architecture without function descriptors,
to avoid a forest of #ifdefs.
It replaces the similar func_desc_t previously defined in
ar
execute_location() and execute_user_location() intent
to copy do_nothing() text and execute it at a new location.
However, at the time being it doesn't copy do_nothing() function
but do_nothing() function descriptor which still points to the
original text. So at the end it still executes do_nothing
Replace HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR by
HAVE_FUNCTION_DESCRIPTORS and use it instead of
'dereference_function_descriptor' macro to know
whether an arch has function descriptors.
To limit churn in one of the following patches, use
an #ifdef/#else construct with empty first part
instead of a
dereference_function_descriptor() and
dereference_kernel_function_descriptor() are identical on the
three architectures implementing them.
Make them common and put them out-of-line in kernel/extable.c
which is one of the users and has similar type of functions.
Reviewed-by: Kees Cook
Reviewed-by
On Thu, Oct 14, 2021 at 7:49 AM Christophe Leroy
wrote:
>
> We have three architectures using function descriptors, each with its
> own name.
>
> Add a common typedef that can be used in generic code.
>
> Also add a stub typedef for architecture without function descriptors,
> to avoid a forest of
72 matches
Mail list logo