[PATCH 2/2 V6] lib/show_mem.c: Add dma-buf counter to show_mem dump.

2021-04-20 Thread Peter Enderborg
On system where dma-buf is used it can be many clients that adds up to a lot of memory. This can be relevant for OOM handling when running out of memory or how system handle this memory. It may be to free with a kill. Suggested-by: Michal Hocko Signed-off-by: Peter Enderborg --- lib/show_mem.c

[PATCH 1/2 V6] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-20 Thread Peter Enderborg
does not do to much pre-allocations, finding memory leaks in userspace, such as not all clients close down the reference to the buffer. Signed-off-by: Peter Enderborg --- Documentation/filesystems/proc.rst | 5 + drivers/dma-buf/dma-buf.c | 12 fs/proc/meminfo.c

[PATCH 0/2 V6]Add dma-buf counter

2021-04-20 Thread Peter Enderborg
The dma-buf counter is a metric for mapped memory used by it's clients. It is a shared buffer that is typically used for interprocess communication or process to hardware communication. In android we used to have ION,. but it is now replaced with dma-buf. ION had some overview metrics that was simi

[PATCH v5] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-17 Thread Peter Enderborg
This adds a total used dma-buf memory. Details can be found in debugfs, however it is not for everyone and not always available. dma-buf are indirect allocated by userspace. So with this value we can monitor and detect userspace applications that have problems. Signed-off-by: Peter Enderborg

[PATCH v4] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-17 Thread Peter Enderborg
This adds a total used dma-buf memory. Details can be found in debugfs, however it is not for everyone and not always available. dma-buf are indirect allocated by userspace. So with this value we can monitor and detect userspace applications that have problems. Signed-off-by: Peter Enderborg

[PATCH v3] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-16 Thread Peter Enderborg
This adds a total used dma-buf memory. Details can be found in debugfs, however it is not for everyone and not always available. dma-buf are indirect allocated by userspace. So with this value we can monitor and detect userspace applications that have problems. Signed-off-by: Peter Enderborg

[PATCH v2] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-16 Thread Peter Enderborg
This adds a total used dma-buf memory. Details can be found in debugfs, however it is not for everyone and not always available. dma-buf are indirect allocated by userspace. So with this value we can monitor and detect userspace applications that have problems. Signed-off-by: Peter Enderborg

[PATCH] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-16 Thread Peter Enderborg
This adds a total used dma-buf memory. Details can be found in debugfs, however it is not for everyone and not always available. Signed-off-by: Peter Enderborg --- drivers/dma-buf/dma-buf.c | 12 fs/proc/meminfo.c | 2 ++ include/linux/dma-buf.h | 1 + 3 files changed

Re: [PATCH v2 00/12] Add build ID to stacktraces

2021-03-25 Thread peter enderborg
On 3/24/21 3:04 AM, Stephen Boyd wrote: > This series adds the kernel's build ID[1] to the stacktrace header printed > in oops messages, warnings, etc. and the build ID for any module that > appears in the stacktrace after the module name. The goal is to make the > stacktrace more self-contained an

Re: [PATCH v2 00/12] Add build ID to stacktraces

2021-03-25 Thread peter enderborg
On 3/24/21 9:55 AM, Christoph Hellwig wrote: > On Tue, Mar 23, 2021 at 07:04:31PM -0700, Stephen Boyd wrote: >> x5 : x4 : 0001 >> x3 : 0008 x2 : ff93fef25a70 >> x1 : ff93fef15788 x0 : ffe3622352e0 >> Call trace: >> lkdtm_WARNING+0x28/0x30 [

Re: [PATCH v5 5/8] security/brute: Mitigate a brute force attack

2021-03-11 Thread peter enderborg
On 2/27/21 4:30 PM, John Wood wrote: > In order to mitigate a brute force attack all the offending tasks involved > in the attack must be killed. In other words, it is necessary to kill all > the tasks that share the fork and/or exec statistical data related to the > attack. Moreover, if the attack

Re: [PATCH] RTIC: selinux: ARM64: Move selinux_state to a separate page

2021-02-22 Thread peter enderborg
On 2/17/21 10:42 AM, Will Deacon wrote: > [Please include arm64 and kvm folks for threads involving the stage-2 MMU] > > On Tue, Feb 16, 2021 at 03:47:52PM +0530, Preeti Nagar wrote: >> The changes introduce a new security feature, RunTime Integrity Check >> (RTIC), designed to protect Linux Kernel

Re: [RFC PATCH 0/6] Sleepable tracepoints

2020-10-26 Thread peter enderborg
On 10/23/20 9:53 PM, Michael Jeanson wrote: > When invoked from system call enter/exit instrumentation, accessing > user-space data is a common use-case for tracers. However, tracepoints > currently disable preemption around iteration on the registered > tracepoint probes and invocation of the prob

[PATCH] trace: Return ENOTCONN instead of EBADF

2020-10-12 Thread Peter Enderborg
When there is no clients listening on event the trace return EBADF. The file is not a bad file descriptor and to get the userspace able to do a proper error handling it need a different error code that separate a bad file descriptor from a empty listening. Signed-off-by: Peter Enderborg

Re: [PATCH v7 3/3] binder: add transaction latency tracer

2020-09-07 Thread peter enderborg
On 8/4/20 3:59 PM, Frankie Chang wrote: > +void probe_binder_txn_latency_free(void *ignore, struct binder_transaction > *t, > + int from_proc, int from_thread, > + int to_proc, int to_thread) > +{ > + struct rtc_time tm; >

[PATCH] crypto: Mark tfm buffer as non leak.

2020-09-03 Thread Peter Enderborg
0x1c/0x68 [<06748df3>] crypto_skcipher_init_tfm+0x158/0x1e0 [<17f3270c>] crypto_create_tfm+0x54/0xf0 This is caused by tfm = (struct crypto_tfm *)(mem + tfmsize); that is keept instead of the allocated buffer in mem. Reference counting is done on alg. Signed-off-by

Re: [RFC PATCH] selinux: Add denied trace with permssion filter

2020-09-01 Thread peter enderborg
On 9/1/20 5:31 PM, Paul Moore wrote: > On Mon, Aug 31, 2020 at 11:34 AM peter enderborg wrote: >> On 8/31/20 4:16 PM, Paul Moore wrote: >>> On Thu, Aug 27, 2020 at 10:04 AM peter enderborg wrote: > ... > >>>> Im happly fine with replacing the selinux_audited wi

Re: [RFC PATCH] selinux: Add denied trace with permssion filter

2020-08-31 Thread peter enderborg
On 8/31/20 4:16 PM, Paul Moore wrote: > On Thu, Aug 27, 2020 at 10:04 AM peter enderborg > wrote: >> On 8/27/20 3:30 PM, Paul Moore wrote: >>> On Wed, Aug 26, 2020 at 11:06 AM peter enderborg >>> wrote: >>>> On 8/26/20 4:45 PM, Paul Moore wrote: &g

Re: [RFC PATCH] selinux: Add denied trace with permssion filter

2020-08-27 Thread peter enderborg
On 8/27/20 3:30 PM, Paul Moore wrote: > On Wed, Aug 26, 2020 at 11:06 AM peter enderborg > wrote: >> On 8/26/20 4:45 PM, Paul Moore wrote: >>> On Wed, Aug 26, 2020 at 10:34 AM peter enderborg >>> wrote: >>>> On 8/26/20 3:42 PM, Paul Moore wrote: &

Re: [RFC PATCH] selinux: Add denied trace with permssion filter

2020-08-26 Thread peter enderborg
On 8/26/20 4:45 PM, Paul Moore wrote: > On Wed, Aug 26, 2020 at 10:34 AM peter enderborg > wrote: >> On 8/26/20 3:42 PM, Paul Moore wrote: >>> On Mon, Aug 24, 2020 at 9:23 AM Peter Enderborg >>> wrote: >>>> This adds tracing of all denies. They are

Re: [RFC PATCH] selinux: Add denied trace with permssion filter

2020-08-26 Thread peter enderborg
On 8/26/20 3:42 PM, Paul Moore wrote: > On Mon, Aug 24, 2020 at 9:23 AM Peter Enderborg > wrote: >> This adds tracing of all denies. They are grouped with trace_seq for >> each audit. >> >> A filter can be inserted with a write to it's filter section. &

Re: [RFC PATCH 3/3] selinux: track policy lifetime with refcount

2020-08-25 Thread peter enderborg
On 8/25/20 5:20 PM, Ondrej Mosnacek wrote: > Instead of holding the RCU read lock the whole time while accessing the > policy, add a simple refcount mechanism to track its lifetime. After > this, the RCU read lock is held only for a brief time when fetching the > policy pointer and incrementing the

[RFC PATCH] selinux: Add denied trace with permssion filter

2020-08-24 Thread Peter Enderborg
046 [002] .N.. 156.351738: selinux_denied: trace_seq=2 result=-13 scontext=system_u:system_r:cupsd_t:s0-s0:c0. c1023 tcontext=system_u:object_r:bin_t:s0 tclass=file permission=entrypoint Signed-off-by: Peter Enderborg --- inc

[no subject]

2020-08-24 Thread Peter Enderborg
This is other solution. I dont think needs any plugin support. It will generate one event for eatch denial and there is possible to filter on permission. .

Re: [PATCH v3 3/3] selinux: add permission names to trace event

2020-08-21 Thread peter enderborg
On 8/21/20 3:19 PM, Paul Moore wrote: > On Fri, Aug 21, 2020 at 8:29 AM Stephen Smalley > wrote: >> On Thu, Aug 20, 2020 at 10:31 PM Steven Rostedt wrote: >>> On Wed, 19 Aug 2020 09:11:08 -0400 >>> Stephen Smalley wrote: >>> So we'll need to update this plugin whenever we modify securi

Re: [PATCH v3 3/3] selinux: add permission names to trace event

2020-08-20 Thread peter enderborg
On 8/21/20 4:22 AM, Paul Moore wrote: > On Tue, Aug 18, 2020 at 8:14 AM Stephen Smalley > wrote: >> On Tue, Aug 18, 2020 at 4:11 AM peter enderborg >> wrote: > ... > >>> Is there any other things we need to fix? A part 1&2 now OK? >> They looked ok to

Re: Scheduler benchmarks

2020-08-18 Thread peter enderborg
On 8/18/20 7:53 PM, Muni Sekhar wrote: > On Tue, Aug 18, 2020 at 11:06 PM Greg KH wrote: >> On Tue, Aug 18, 2020 at 11:01:35PM +0530, Muni Sekhar wrote: >>> On Tue, Aug 18, 2020 at 10:44 PM Greg KH wrote: On Tue, Aug 18, 2020 at 10:24:13PM +0530, Muni Sekhar wrote: > On Tue, Aug 18, 2020

Re: [PATCH v3 3/3] selinux: add permission names to trace event

2020-08-18 Thread peter enderborg
On 8/17/20 10:16 PM, Stephen Smalley wrote: > On 8/17/20 1:07 PM, Thiébaud Weksteen wrote: > >> From: Peter Enderborg >> >> In the print out add permissions, it will look like: >> <...>-1042  [007]    201.965142: selinux_audited: >> re

Re: [PATCH v2 1/2] selinux: add tracepoint on denials

2020-08-15 Thread peter enderborg
On 8/14/20 7:46 PM, Steven Rostedt wrote: > On Fri, 14 Aug 2020 19:22:13 +0200 > peter enderborg wrote: > >> On 8/14/20 7:08 PM, Stephen Smalley wrote: >>> On Fri, Aug 14, 2020 at 1:07 PM peter enderborg >>> wrote: >>>> On 8/14/20 6:51 PM, Stephen S

Re: [PATCH v2 1/2] selinux: add tracepoint on denials

2020-08-15 Thread peter enderborg
On 8/14/20 7:46 PM, Steven Rostedt wrote: > On Fri, 14 Aug 2020 19:22:13 +0200 > peter enderborg wrote: > >> On 8/14/20 7:08 PM, Stephen Smalley wrote: >>> On Fri, Aug 14, 2020 at 1:07 PM peter enderborg >>> wrote: >>>> On 8/14/20 6:51 PM, Stephen S

Re: [PATCH v2 1/2] selinux: add tracepoint on denials

2020-08-14 Thread peter enderborg
On 8/14/20 8:30 PM, Steven Rostedt wrote: > On Fri, 14 Aug 2020 20:06:34 +0200 > peter enderborg wrote: > >> Im find with that, but then you  can not do filtering? I would be >> pretty neat with a filter saying tclass=file permission=write. >> > Well, if the m

Re: [PATCH v2 1/2] selinux: add tracepoint on denials

2020-08-14 Thread peter enderborg
On 8/14/20 7:46 PM, Steven Rostedt wrote: > On Fri, 14 Aug 2020 19:22:13 +0200 > peter enderborg wrote: > >> On 8/14/20 7:08 PM, Stephen Smalley wrote: >>> On Fri, Aug 14, 2020 at 1:07 PM peter enderborg >>> wrote: >>>> On 8/14/20 6:51 PM, Stephen S

Re: [PATCH v2 1/2] selinux: add tracepoint on denials

2020-08-14 Thread peter enderborg
On 8/14/20 7:08 PM, Stephen Smalley wrote: > On Fri, Aug 14, 2020 at 1:07 PM peter enderborg > wrote: >> On 8/14/20 6:51 PM, Stephen Smalley wrote: >>> On Fri, Aug 14, 2020 at 9:05 AM Thiébaud Weksteen wrote: >>>> On Thu, Aug 13, 2020 at 5:41 PM Stephen Smalley

Re: [PATCH v2 1/2] selinux: add tracepoint on denials

2020-08-14 Thread peter enderborg
On 8/14/20 6:51 PM, Stephen Smalley wrote: > On Fri, Aug 14, 2020 at 9:05 AM Thiébaud Weksteen wrote: >> On Thu, Aug 13, 2020 at 5:41 PM Stephen Smalley >> wrote: >>> An explanation here of how one might go about decoding audited and >>> tclass would be helpful to users (even better would be a sc

Re: [PATCH v2 2/2] selinux: add basic filtering for audit trace events

2020-08-13 Thread peter enderborg
On 8/13/20 7:38 PM, Steven Rostedt wrote: > On Thu, 13 Aug 2020 19:14:10 +0200 > peter enderborg wrote: > >>> To be clear, userspace tools can't use fixed secid values because >>> secids are dynamically assigned by SELinux and thus secid 42 need >>> no

Re: [PATCH v2 2/2] selinux: add basic filtering for audit trace events

2020-08-13 Thread peter enderborg
On 8/13/20 5:49 PM, Stephen Smalley wrote: > On 8/13/20 11:35 AM, peter enderborg wrote: > >> On 8/13/20 5:05 PM, Casey Schaufler wrote: >>> On 8/13/2020 7:48 AM, Thiébaud Weksteen wrote: >>>> From: Peter Enderborg >>>> >>>> This patch a

Re: [PATCH v2 2/2] selinux: add basic filtering for audit trace events

2020-08-13 Thread peter enderborg
On 8/13/20 5:49 PM, Stephen Smalley wrote: > On 8/13/20 11:35 AM, peter enderborg wrote: > >> On 8/13/20 5:05 PM, Casey Schaufler wrote: >>> On 8/13/2020 7:48 AM, Thiébaud Weksteen wrote: >>>> From: Peter Enderborg >>>> >>>> This patch a

Re: [PATCH v2 2/2] selinux: add basic filtering for audit trace events

2020-08-13 Thread peter enderborg
On 8/13/20 5:05 PM, Casey Schaufler wrote: > On 8/13/2020 7:48 AM, Thiébaud Weksteen wrote: >> From: Peter Enderborg >> >> This patch adds further attributes to the event. These attributes are >> helpful to understand the context of the message and can be used >>

Re: [PATCH 2/2] selinux: add attributes to avc tracepoint

2020-08-06 Thread peter enderborg
On 8/6/20 2:11 PM, Stephen Smalley wrote: > On 8/6/20 4:03 AM, Thiébaud Weksteen wrote: > >> From: Peter Enderborg >> >> Add further attributes to filter the trace events from AVC. > > Please include sample usage and output in the description. > > Im not s

Re: [PATCH 2/2] selinux: add attributes to avc tracepoint

2020-08-06 Thread peter enderborg
On 8/6/20 3:49 PM, Stephen Smalley wrote: > On Thu, Aug 6, 2020 at 9:45 AM Stephen Smalley > wrote: >> On 8/6/20 8:32 AM, Stephen Smalley wrote: >> >>> On 8/6/20 8:24 AM, peter enderborg wrote: >>> >>>> On 8/6/20 2:11 PM, Stephen Smalley wrote:

Re: [PATCH 2/2] selinux: add attributes to avc tracepoint

2020-08-06 Thread peter enderborg
On 8/6/20 5:03 PM, Stephen Smalley wrote: > On Thu, Aug 6, 2020 at 10:51 AM peter enderborg > wrote: >> On 8/6/20 3:49 PM, Stephen Smalley wrote: >>> On Thu, Aug 6, 2020 at 9:45 AM Stephen Smalley >>> wrote: >>>> On 8/6/20 8:32 AM, Stephen Smalley

[tip: core/rcu] rcu: Stop shrinker loop

2020-07-31 Thread tip-bot2 for Peter Enderborg
The following commit has been merged into the core/rcu branch of tip: Commit-ID: c6dfd72b7a3b70a2054db0f73245ea2f762a8452 Gitweb: https://git.kernel.org/tip/c6dfd72b7a3b70a2054db0f73245ea2f762a8452 Author:Peter Enderborg AuthorDate:Thu, 04 Jun 2020 12:23:20 +02:00

Re: [PATCH] RFC: selinux avc trace

2020-07-30 Thread peter enderborg
On 7/30/20 9:29 PM, Steven Rostedt wrote: > On Thu, 30 Jul 2020 21:12:39 +0200 > peter enderborg wrote: > >>>> avc:  denied  { find } for interface=vendor.qti.hardware.perf::IPerf >>>> sid=u:r:permissioncontroller_app:s0:c230,c256,c512,c768 pid=9164 >>>

Re: [PATCH] RFC: selinux avc trace

2020-07-30 Thread peter enderborg
On 7/30/20 7:16 PM, Steven Rostedt wrote: > On Thu, 30 Jul 2020 19:05:49 +0200 > peter enderborg wrote: > >>>> It should be a full structure with a lot of sub strings.  But that make is >>>> even more relevant. >>> So one event instance can have a l

Re: [PATCH] RFC: selinux avc trace

2020-07-30 Thread peter enderborg
On 7/30/20 6:02 PM, Steven Rostedt wrote: > On Thu, 30 Jul 2020 17:31:17 +0200 > peter enderborg wrote: > >> On 7/30/20 5:04 PM, Steven Rostedt wrote: >>> On Thu, 30 Jul 2020 16:29:12 +0200 >>> peter enderborg wrote: >>> >>>> +#undef TRACE_

Re: [PATCH] RFC: selinux avc trace

2020-07-30 Thread peter enderborg
On 7/30/20 4:50 PM, Stephen Smalley wrote: > On Thu, Jul 30, 2020 at 10:29 AM peter enderborg > wrote: >> I did manage to rebase it but this is about my approach. >> >> Compared to Thiébaud Weksteen patch this adds: >> >> 1 Filtering. Types goes to trace so we

Re: [PATCH] RFC: selinux avc trace

2020-07-30 Thread peter enderborg
On 7/30/20 5:04 PM, Steven Rostedt wrote: > On Thu, 30 Jul 2020 16:29:12 +0200 > peter enderborg wrote: > >> +#undef TRACE_SYSTEM >> +#define TRACE_SYSTEM avc >> + >> +#if !defined(_TRACE_AVC_H) || defined(TRACE_HEADER_MULTI_READ) >> +#define _TRACE_A

[PATCH] RFC: selinux avc trace

2020-07-30 Thread peter enderborg
not right) and there are  memory leaks, extra debug info and nonsense variable etc. From: Peter Enderborg Date: Thu, 30 Jul 2020 14:44:53 +0200 Subject: [PATCH] RFC: selinux avc trace This is not done yet. But it shows a trace for selinux avc. ---  include/trace/events/avc.h |  92

Re: [PATCH] selinux: add tracepoint on denials

2020-07-30 Thread peter enderborg
On 7/28/20 6:02 PM, Thiébaud Weksteen wrote: > On Tue, Jul 28, 2020 at 5:12 PM Paul Moore wrote: >> Perhaps it would be helpful if you provided an example of how one >> would be expected to use this new tracepoint? That would help put >> things in the proper perspective. > The best example is the

[PATCH 1/2] tracefs: Remove unnecessary debug_fs checks.

2020-07-16 Thread Peter Enderborg
en tracefs was part of debugfs, it is now standalone and does not need debugfs. When debugfs is in restricted it is compiled in but not active and return EPERM to clients and tracefs wont work if it assumes it is active it is compiled in kernel. Reported-by: kernel test robot Signed-off-by: Peter

[PATCH v8 0/2] debugfs: Add access restriction option

2020-07-16 Thread Peter Enderborg
Since debugfs include sensitive information it need to be treated carefully. But it also has many very useful debug functions for userspace. With this option we can have same configuration for system with need of debugfs and a way to turn it off. This gives a extra protection for exposure on system

[PATCH 2/2] debugfs: Add access restriction option

2020-07-16 Thread Peter Enderborg
debugfs as filesystem, but client can register their parts in the internal structures. This data can be readed with a debugger or saved with a crashkernel. When it is off clients get EPERM error when accessing the functions for registering their components. Signed-off-by: Peter Enderborg --- .../admin

[PATCH 2/2] debugfs: Add access restriction option

2020-07-15 Thread Peter Enderborg
debugfs as filesystem, but client can register their parts in the internal structures. This data can be readed with a debugger or saved with a crashkernel. When it is off clients get EPERM error when accessing the functions for registering their components. Signed-off-by: Peter Enderborg --- .../admin

[PATCH v7 0/2] debugfs: Add access restriction option

2020-07-15 Thread Peter Enderborg
Since debugfs include sensitive information it need to be treated carefully. But it also has many very useful debug functions for userspace. With this option we can have same configuration for system with need of debugfs and a way to turn it off. This gives a extra protection for exposure on system

[PATCH 1/2] tracefs: Remove unnecessary debug_fs checks.

2020-07-15 Thread Peter Enderborg
en tracefs was part of debugfs, it is now standalone and does not need debugfs. When debugfs is in restricted it is compiled in but not active and return EPERM to clients and tracefs wont work if it assumes it is active it is compiled in kernel. Reported-by: kernel test robot Signed-off-by: Peter

[PATCH 1/2] tracefs: Remove unnecessary debug_fs checks.

2020-07-15 Thread Peter Enderborg
en tracefs was part of debugfs, it is now standalone and does not need debugfs. When debugfs is in restricted it is compiled in but not active and return EPERM to clients and tracefs wont work if it assumes it is active it is compiled in kernel. Reported-by: kernel test robot Signed-off-by: Peter

[PATCH v6 0/2] debugfs: Add access restriction option

2020-07-15 Thread Peter Enderborg
Since debugfs include sensitive information it need to be treated carefully. But it also has many very useful debug functions for userspace. With this option we can have same configuration for system with need of debugfs and a way to turn it off. This gives a extra protection for exposure on system

[PATCH 2/2] debugfs: Add access restriction option

2020-07-15 Thread Peter Enderborg
debugfs as filesystem, but client can register their parts in the internal structures. This data can be readed with a debugger or saved with a crashkernel. When it is off clients get EPERM error when accessing the functions for registering their components. Signed-off-by: Peter Enderborg --- .../admin

[PATCH 1/2] tracefs: Remove unnecessary debug_fs checks.

2020-07-15 Thread Peter Enderborg
en tracefs was part of debugfs, it is now standalone and does not need debugfs. When debugfs is in restricted it is compiled in but not active and return EPERM to clients and tracefs wont work if it assumes it is active it is compiled in kernel. Reported-by: kernel test robot Signed-off-by: Peter

[PATCH v5 0/2] debugfs: Add access restriction option

2020-07-15 Thread Peter Enderborg
Since debugfs include sensitive information it need to be treated carefully. But it also has many very useful debug functions for userspace. With this option we can have same configuration for system with need of debugfs and a way to turn it off. This gives a extra protection for exposure on syst

[PATCH 2/2] debugfs: Add access restriction option

2020-07-15 Thread Peter Enderborg
as filesystem, but client can register their parts in the internal structures. This data can be readed with a debugger or saved with a crashkernel. When it is off clients get EPERM error when accessing the functions for registering their components. Signed-off-by: Peter Enderborg --- .../admin

Re: nr_cpu_ids vs AMD 3970x(32 physical CPUs)

2020-07-03 Thread peter enderborg
On 7/3/20 5:57 PM, Uladzislau Rezki wrote: > Hello, folk. > > I have a system based on AMD 3970x CPUs. It has 32 physical cores > and 64 threads. It seems that "nr_cpu_ids" variable is not correctly > set on latest 5.8-rc3 kernel. Please have a look below on dmesg output: > > > urezki@pc638:~$ sud

[PATCH 1/2] tracefs: Remove unnecessary debug_fs checks.

2020-06-22 Thread Peter Enderborg
en tracefs was part of debugfs, it is now standalone and does not need debugfs. When debugfs is in restricted it is compiled in but not active and return EPERM to clients and tracefs wont work if it assumes it is active it is compiled in kernel. Reported-by: kernel test robot Signed-off-by: Peter

[PATCH v4 0/2] debugfs: Add access restriction option

2020-06-22 Thread Peter Enderborg
Since debugfs include sensitive information it need to be treated carefully. But it also has many very useful debug functions for userspace. With this option we can have same configuration for system with need of debugfs and a way to turn it off. This gives a extra protection for exposure on system

[PATCH 2/2] debugfs: Add access restriction option

2020-06-22 Thread Peter Enderborg
as filesystem, but client can register their parts in the internal structures. This data can be readed with a debugger or saved with a crashkernel. When it is off clients get EPERM error when accessing the functions for registering their components. Signed-off-by: Peter Enderborg --- .../admin

[PATCH v3] debugfs: Add access restriction option

2020-06-17 Thread Peter Enderborg
parts in the internal structures. This data can be readed with a debugger or saved with a crashkernel. When it is off clients get EPERM error when accessing the functions for registering their components. Signed-off-by: Peter Enderborg --- v2. Removed MOUNT as part of restrictions. Added API&#

[PATCH v2] debugfs: Add access restriction option

2020-06-11 Thread Peter Enderborg
parts in the internal structures. This data can be readed with a debugger or saved with a crashkernel. When it is off clients get EPERM error when accessing the functions for registering their components. Signed-off-by: Peter Enderborg --- .../admin-guide/kernel-parameters.txt | 11

[PATCH] rcu: Stop shrinker loop

2020-06-04 Thread Peter Enderborg
The count and scan can be separated in time. It is a fair chance that all work is already done when the scan starts. It then might retry. This is can be avoided with returning SHRINK_STOP. Signed-off-by: Peter Enderborg --- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [tip: core/rcu] rcu/tree: Add a shrinker to prevent OOM due to kfree_rcu() batching

2020-06-03 Thread peter enderborg
On 5/11/20 10:59 PM, tip-bot2 for Joel Fernandes (Google) wrote: > The following commit has been merged into the core/rcu branch of tip: > > Commit-ID: 9154244c1ab6c9db4f1f25ac8f73bd46dba64287 > Gitweb: > https://git.kernel.org/tip/9154244c1ab6c9db4f1f25ac8f73bd46dba64287 > Author:

[PATCH] debugfs: Add mount restriction option

2020-05-28 Thread Peter Enderborg
be activated. Signed-off-by: Peter Enderborg --- fs/debugfs/inode.c | 17 - lib/Kconfig.debug | 10 ++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index b7f2e971ecbc..bde37dab77e0 100644 --- a/fs/debugfs/inode.c

Re: [PATCH] mm, compaction: Indicate when compaction is manually triggered by sysctl

2020-05-18 Thread peter enderborg
On 5/11/20 1:26 PM, Guilherme Piccoli wrote: > On Sun, May 10, 2020 at 10:25 PM David Rientjes wrote: >> [...] >> The kernel log is not preferred for this (or drop_caches, really) because >> the amount of info can causing important information to be lost. We don't >> really gain anything by print

Re: [patch] mm, oom: stop reclaiming if GFP_ATOMIC will start failing soon

2020-04-29 Thread peter enderborg
On 4/28/20 9:43 AM, Michal Hocko wrote: > On Mon 27-04-20 16:35:58, Andrew Morton wrote: > [...] >> No consumer of GFP_ATOMIC memory should consume an unbounded amount of >> it. >> Subsystems such as networking will consume a certain amount and >> will then start recycling it. The total amount in-

Re: [PATCH] lib/genalloc.c: include vmalloc.h

2019-01-10 Thread peter enderborg
On 1/7/19 11:56 PM, Andrew Morton wrote: > On Sat, 5 Jan 2019 13:35:33 -0800 Linus Torvalds > wrote: > >> On Sat, Jan 5, 2019 at 1:21 PM Olof Johansson wrote: >>> Fixes build break on most ARM/ARM64 defconfigs: >> Interesting. >> >> Andrew, I thought ARM was one of the platforms that your tree c

Re: [PATCH 0/9] psi: pressure stall information for CPU, memory, and IO v4

2018-09-17 Thread peter enderborg
Will it be part of the backport to 4.9 google android or is it for test only? I guess that this patch is to big for the LTS tree. On 09/07/2018 05:58 PM, Suren Baghdasaryan wrote: > Thanks for the new patchset! Backported to 4.9 and retested on ARMv8 8 > code system running Android. Signals behave

Re: [PATCH RFC] mm: don't raise MEMCG_OOM event due to failed high-order allocation

2018-09-11 Thread peter enderborg
On 09/11/2018 02:11 PM, Michal Hocko wrote: > Why is this a problem though? IIRC this event was deliberately placed > outside of the oom path because we wanted to count allocation failures > and this is also documented that way > > oom > The number of time the cgroup's mem

Re: [PATCH 0/9] psi: pressure stall information for CPU, memory, and IO v3

2018-08-07 Thread peter enderborg
On 08/01/2018 05:19 PM, Johannes Weiner wrote: > > A kernel with CONFIG_PSI=y will create a /proc/pressure directory with > 3 files: cpu, memory, and io. If using cgroup2, cgroups will also have > cpu.pressure, memory.pressure and io.pressure files, which simply > aggregate task stalls at the cgrou

Re: [PATCH 2/9] mm: workingset: tell cache transitions from workingset thrashing

2018-08-01 Thread peter enderborg
On 08/01/2018 05:13 PM, Johannes Weiner wrote: > diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h > index e34a27727b9a..7af1c3c15d8e 100644 > --- a/include/linux/page-flags.h > +++ b/include/linux/page-flags.h > @@ -69,13 +69,14 @@ > */ > enum pageflags { > PG_locked,

Re: [PATCH] mm,oom: Bring OOM notifier callbacks to outside of OOM killer.

2018-06-25 Thread peter enderborg
On 06/25/2018 03:07 PM, Michal Hocko wrote: > On Mon 25-06-18 15:03:40, peter enderborg wrote: >> On 06/20/2018 01:55 PM, Michal Hocko wrote: >>> On Wed 20-06-18 20:20:38, Tetsuo Handa wrote: >>>> Sleeping with oom_lock held can cause AB-BA lockup bug because >>

Re: [PATCH] mm,oom: Bring OOM notifier callbacks to outside of OOM killer.

2018-06-25 Thread peter enderborg
On 06/25/2018 03:07 PM, Michal Hocko wrote: > On Mon 25-06-18 15:03:40, peter enderborg wrote: >> On 06/20/2018 01:55 PM, Michal Hocko wrote: >>> On Wed 20-06-18 20:20:38, Tetsuo Handa wrote: >>>> Sleeping with oom_lock held can cause AB-BA lockup bug because >>

Re: [PATCH] mm,oom: Bring OOM notifier callbacks to outside of OOM killer.

2018-06-25 Thread peter enderborg
On 06/20/2018 01:55 PM, Michal Hocko wrote: > On Wed 20-06-18 20:20:38, Tetsuo Handa wrote: >> Sleeping with oom_lock held can cause AB-BA lockup bug because >> __alloc_pages_may_oom() does not wait for oom_lock. Since >> blocking_notifier_call_chain() in out_of_memory() might sleep, sleeping >> wi

[PATCH V3 1/5 selinux-next] selinux: Make allocation atomic in policydb objects functions.

2018-05-30 Thread Peter Enderborg
From: peter As preparation for RCU the allocation need to be atomic, there is a lot of them so they do in this patch. Signed-off-by: Peter Enderborg --- security/selinux/ss/avtab.c | 8 +-- security/selinux/ss/conditional.c | 14 ++--- security/selinux/ss/ebitmap.c | 3

[PATCH V3 3/5 selinux-next] selinux: sidtab_clone switch to use rwlock.

2018-05-30 Thread Peter Enderborg
We need a copy of sidtabs, so change the generic sidtab_clone as from a function pointer and let it use a read rwlock while do the clone. Signed-off-by: Peter Enderborg --- security/selinux/ss/services.c | 20 +--- security/selinux/ss/sidtab.c | 39

Re: [PATCH] mm:Add watermark slope for high mark

2017-11-24 Thread peter enderborg
On 11/24/2017 11:14 AM, Michal Hocko wrote: > On Fri 24-11-17 11:07:07, Peter Enderborg wrote: >> When tuning the watermark_scale_factor to reduce stalls and compactions >> the high mark is also changed, it changed a bit too much. So this >> patch introduces a slope that can r

Re: [PATCH] mm:Add watermark slope for high mark

2017-11-24 Thread peter enderborg
On 11/24/2017 11:15 AM, Vlastimil Babka wrote: > Agreed. Also if you send a patch adding userspace API or a tuning knob, > please CC linux-api mailing list (did that for this reply). > The cc-list is generated by get_maintainer.pl script.

[PATCH] mm:Add watermark slope for high mark

2017-11-24 Thread Peter Enderborg
When tuning the watermark_scale_factor to reduce stalls and compactions the high mark is also changed, it changed a bit too much. So this patch introduces a slope that can reduce this overhead a bit, or increase it if needed. Signed-off-by: Peter Enderborg --- Documentation/sysctl/vm.txt | 15

Re: [PATCH] Add slowpath enter/exit trace events

2017-11-24 Thread peter enderborg
On 11/23/2017 03:01 PM, Michal Hocko wrote: > I am not sure adding a probe on a production system will fly in many > cases. A static tracepoint would be much easier in that case. But I > agree there are other means to accomplish the same thing. My main point > was to have an easy out-of-the-box way

Re: [PATCH] Add slowpath enter/exit trace events

2017-11-23 Thread peter enderborg
On 11/23/2017 02:43 PM, Tetsuo Handa wrote: > Please see my attempt at > http://lkml.kernel.org/r/1510833448-19918-1-git-send-email-penguin-ker...@i-love.sakura.ne.jp > . > Printing just current thread is not sufficient for me. > > Seems to  me that it is a lot more overhead with timers and stuff.

Re: [PATCH] Add slowpath enter/exit trace events

2017-11-23 Thread peter enderborg
On 11/23/2017 01:47 PM, Michal Hocko wrote: > > This might be true but the other POV is that the trace point with the > additional information is just too disruptive to the rest of the code > and it exposes too many implementation details. >From who do you want to hide details? Is this a security

Re: [PATCH] Add slowpath enter/exit trace events

2017-11-23 Thread peter enderborg
, Michal Hocko wrote: > On Thu 23-11-17 11:43:36, peter.enderb...@sony.com wrote: >> From: Peter Enderborg >> >> The warning of slow allocation has been removed, this is >> a other way to fetch that information. But you need >> to enable the trace. The exit function also

Re: [RFC v2] prctl: prctl(PR_SET_IDLE, PR_IDLE_MODE_KILLME), for stateless idle loops

2017-11-22 Thread peter enderborg
On 11/03/2017 07:35 AM, Shawn Landden wrote: > It is common for services to be stateless around their main event loop. > If a process sets PR_SET_IDLE to PR_IDLE_MODE_KILLME then it > signals to the kernel that epoll_wait() and friends may not complete, > and the kernel may send SIGKILL if resource

Re: [PATCH] time: Make NTP optionnal

2017-11-20 Thread peter enderborg
On 11/20/2017 04:00 PM, Romain Perier wrote: > Hi, > > 2017-11-20 15:10 GMT+01:00 peter enderborg : >> I think it should return a error code at least. > In which case ? The idea was to don't change the behaviour of these > functions (from the "API" point of vie

Re: [PATCH] time: Make NTP optionnal

2017-11-20 Thread peter enderborg
I think it should return a error code at least. On 11/02/2017 07:29 PM, Romain Perier wrote: > On embedded systems with limited space, synchronizing system clock via > NTP might be not needed. > > This commit introduces a new Kconfig entry. When disabled, it compiles > out the adjtimex and clock_a

Re: [RFC] EPOLL_KILLME: New flag to epoll_wait() that subscribes process to death row (new syscall)

2017-11-03 Thread peter enderborg
On 11/01/2017 04:22 PM, Colin Walters wrote: > > On Wed, Nov 1, 2017, at 11:16 AM, Colin Walters wrote: >> as the maintainer of glib2 which is used by a *lot* of things; I'm not > (I meant to say "a" maintainer) > > Also, while I'm not an expert in Android, I think the "what to kill" logic > there

Re: [RESEND v12 0/6] cgroup-aware OOM killer

2017-10-31 Thread peter enderborg
On 10/31/2017 03:34 PM, Michal Hocko wrote: > On Tue 31-10-17 15:17:11, peter enderborg wrote: >> On 10/27/2017 10:05 PM, Johannes Weiner wrote: >>> On Thu, Oct 26, 2017 at 02:03:41PM -0700, David Rientjes wrote: >>>> On Thu, 26 Oct 2017, Johannes Weiner wrote: >

Re: [RESEND v12 0/6] cgroup-aware OOM killer

2017-10-31 Thread peter enderborg
On 10/27/2017 10:05 PM, Johannes Weiner wrote: > On Thu, Oct 26, 2017 at 02:03:41PM -0700, David Rientjes wrote: >> On Thu, 26 Oct 2017, Johannes Weiner wrote: >> The nack is for three reasons: (1) unfair comparison of root mem cgroup usage to bias against that mem cgroup

Re: [RFC PATCH] binder: Don't require the binder lock when killed in binder_thread_read()

2017-04-03 Thread peter enderborg
On 03/31/2017 07:53 PM, Douglas Anderson wrote: > Sometimes when we're out of memory the OOM killer decides to kill a > process that's in binder_thread_read(). If we happen to be waiting > for work we'll get the kill signal and wake up. That's good. ...but > then we try to grab the binder lock b

Re: [RFC 0/1] add support for reclaiming priorities per mem cgroup

2017-03-20 Thread peter enderborg
Hi Tim. Do you have a link to the new version lmkd? On 03/18/2017 12:16 AM, Tim Murray wrote: > Hi all, > > I've been working to improve Android's memory management and drop > lowmemorykiller from the kernel, and I'd like to get some feedback on a small > patch with a lot of side effects. > > C

Re: [PATCH] audit: log module name on delete_module

2017-03-09 Thread peter enderborg
On 03/09/2017 03:08 PM, Richard Guy Briggs wrote: > Record the module name of a delete_module call. > > See: https://github.com/linux-audit/audit-kernel/issues/37 > > Signed-off-by: Richard Guy Briggs > --- > kernel/module.c |2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff -

Re: [PATCH] staging, android: remove lowmemory killer from the tree

2017-02-24 Thread peter enderborg
On 02/24/2017 04:03 PM, Michal Hocko wrote: > On Fri 24-02-17 15:42:49, peter enderborg wrote: >> On 02/24/2017 03:11 PM, Michal Hocko wrote: >>> On Fri 24-02-17 14:16:34, peter enderborg wrote: >>>> On 02/24/2017 01:28 PM, Michal Hocko wrote: >>> [...]

Re: [PATCH] staging, android: remove lowmemory killer from the tree

2017-02-24 Thread peter enderborg
On 02/24/2017 03:11 PM, Michal Hocko wrote: > On Fri 24-02-17 14:16:34, peter enderborg wrote: >> On 02/24/2017 01:28 PM, Michal Hocko wrote: > [...] >>> Yeah, I strongly believe that the chosen approach is completely wrong. >>> Both in abusing the shrinker interfac

  1   2   >