[PATCH 1/1 v2] binder: free memory on error

2017-08-21 Thread Christian Brauner
On binder_init() the devices string is duplicated and smashed into individual device names which are passed along. However, the original duplicated string wasn't freed in case binder_init() failed. Let's free it on error. Signed-off-by: Christian Brauner <christian.brau...@ubuntu.

[PATCH 0/1] binder: free memory on error

2017-08-21 Thread Christian Brauner
On binder_init() the devices string is duplicated and smashed into individual device names which are passed along. However, if I'm not mistaken the original duplicated string wasn't freed in case binder_init() failed. Christian Christian Brauner (1): binder: free memory on error drivers

[PATCH 0/1 v2] binder: free memory on error

2017-08-21 Thread Christian Brauner
message - call kfree(device_names) on correct position Christian Brauner (1): binder: free memory on error drivers/android/binder.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.13.3 ___ devel mailing list de

[PATCH 1/1] binder: free memory on error

2017-08-21 Thread Christian Brauner
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- drivers/android/binder.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index f7665c31feca..41a11661eed7 100644 --- a/drivers/android/binder.c

Re: [PATCH V3] binder: ipc namespace support for android binder

2018-11-08 Thread Christian Brauner
On Thu, Nov 08, 2018 at 01:02:32PM +, chouryzhou(周威) wrote: > We are working for running android in container, but we found that binder is > not isolated by ipc namespace. Since binder is a form of IPC and therefore > should > be tied to ipc namespace. With this patch, we can run more than

Re: [PATCH V4] binder: ipc namespace support for android binder

2018-11-12 Thread Christian Brauner
On November 12, 2018 8:45:07 AM PST, Todd Kjos wrote: >+christ...@brauner.io +Martijn Coenen > >Christian, > >Does this patch work for your container use-cases? If not, please >comment on this thread. Let's discuss at LPC this week. I have not received an answer to my questions in the last

Re: [PATCH v2 1/2] binderfs: implement "max" mount option

2019-01-03 Thread Christian Brauner
On Wed, Jan 2, 2019 at 12:32 PM Christian Brauner wrote: > > Since binderfs can be mounted by userns root in non-initial user namespaces > some precautions are in order. First, a way to set a maximum on the number > of binder devices that can be allocated per binderfs instance and sec

[PATCH 2/2] binderfs: make each binderfs mount a new instance

2019-01-06 Thread Christian Brauner
te kdbusfs instance in the same IPC namespace by making each mount of kdbusfs a separate instance. I think that makes a lot of sense. Signed-off-by: Christian Brauner --- drivers/android/binderfs.c | 41 ++ 1 file changed, 2 insertions(+), 39 deletions(-)

[PATCH 1/2] binderfs: remove wrong kern_mount() call

2019-01-06 Thread Christian Brauner
The binderfs filesystem never needs to be mounted by the kernel itself. This is conceptually wrong and should never have been done in the first place. Fixes: 3ad20fe393b ("binder: implement binderfs") Signed-off-by: Christian Brauner --- drivers/android/binderfs.c | 10

[PATCH 0/2] binderfs: fixes

2019-01-06 Thread Christian Brauner
details can be found in the commit message for each patch. Thanks! Christian Christian Brauner (2): binderfs: remove wrong kern_mount() call binderfs: make each binderfs mount a new instance drivers/android/binderfs.c | 51 ++ 1 file changed, 2 insertions

[PATCH] selftests: add binderfs selftests

2019-01-16 Thread Christian Brauner
works Cc: Todd Kjos Signed-off-by: Christian Brauner --- tools/testing/selftests/Makefile | 1 + .../selftests/filesystems/binderfs/.gitignore | 1 + .../selftests/filesystems/binderfs/Makefile | 6 + .../filesystems/binderfs/binderfs_test.c | 120

Re: [PATCH] selftests: add binderfs selftests

2019-01-16 Thread Christian Brauner
On January 16, 2019 5:54:50 PM GMT+02:00, Greg KH wrote: >On Wed, Jan 16, 2019 at 02:19:03PM +0100, Christian Brauner wrote: >> This adds the promised selftest for binderfs. It will verify the >following >> things: >> - binderfs mounting works >> - binder device al

Re: [PATCH] selftests: add binderfs selftests

2019-01-16 Thread Christian Brauner
On January 16, 2019 6:42:20 PM GMT+02:00, Greg KH wrote: >On Wed, Jan 16, 2019 at 06:21:12PM +0200, Christian Brauner wrote: >> On January 16, 2019 5:54:50 PM GMT+02:00, Greg KH > wrote: >> >On Wed, Jan 16, 2019 at 02:19:03PM +0100, Christian Brauner wrote: >> >>

[PATCH v1] selftests: add binderfs selftests

2019-01-16 Thread Christian Brauner
works Cc: Todd Kjos Signed-off-by: Christian Brauner --- /* Changelog */ v1: - check for ENODEV on mount failure to detect whether binderfs is available If it is not, skip the test and exit with success. --- tools/testing/selftests/Makefile | 1 + .../selftests/filesystems

Re: [PATCH] selftests: add binderfs selftests

2019-01-16 Thread Christian Brauner
On Wed, Jan 16, 2019 at 06:57:10PM +0200, Christian Brauner wrote: > On January 16, 2019 6:42:20 PM GMT+02:00, Greg KH > wrote: > >On Wed, Jan 16, 2019 at 06:21:12PM +0200, Christian Brauner wrote: > >> On January 16, 2019 5:54:50 PM GMT+02:00, Greg KH > > wrote: >

Re: [PATCH v1] selftests: add binderfs selftests

2019-01-16 Thread Christian Brauner
On Wed, Jan 16, 2019 at 11:40:50PM +0100, Greg KH wrote: > On Wed, Jan 16, 2019 at 11:27:45PM +0100, Christian Brauner wrote: > > This adds the promised selftest for binderfs. It will verify the following > > things: > > - binderfs mounting works > > - bin

[PATCH v2] selftests: add binderfs selftests

2019-01-17 Thread Christian Brauner
works The tests are performed both privileged and unprivileged. The latter verifies that binderfs behaves correctly in user namespaces. Cc: Todd Kjos Signed-off-by: Christian Brauner --- /* Changelog */ v2: - make failure to create /dev/binderfs directory fatal in all circumstances - make tests run

[PATCH v3] selftests: add binderfs selftests

2019-01-17 Thread Christian Brauner
works The tests are performed both privileged and unprivileged. The latter verifies that binderfs behaves correctly in user namespaces. Cc: Todd Kjos Signed-off-by: Christian Brauner --- /* Changelog */ v3: - s/printf/ksft_print_msg/g - do not report misleading errno on short write v2: - make

Re: [PATCH v1] selftests: add binderfs selftests

2019-01-17 Thread Christian Brauner
On Wed, Jan 16, 2019 at 04:11:55PM -0700, shuah wrote: > Hi Christian, > > On 1/16/19 3:27 PM, Christian Brauner wrote: > > This adds the promised selftest for binderfs. It will verify the following > > things: > > - binderfs mounting works > > - binder device

Re: [PATCH v2] selftests: add binderfs selftests

2019-01-17 Thread Christian Brauner
On Thu, Jan 17, 2019 at 11:55:49AM +0100, Greg KH wrote: > On Thu, Jan 17, 2019 at 11:28:21AM +0100, Christian Brauner wrote: > > This adds the promised selftest for binderfs. It will verify the following > > things: > > - binderfs mounting works > > - bin

[PATCH 4/5] binderfs: kill_litter_super() before cleanup

2019-01-18 Thread Christian Brauner
Al pointed out that first calling kill_litter_super() before cleaning up info is more correct since destroying info doesn't depend on the state of the dentries and inodes. That the opposite remains true is not guaranteed. Suggested-by: Al Viro Signed-off-by: Christian Brauner --- drivers

[PATCH 2/5] binderfs: prevent renaming the control dentry

2019-01-18 Thread Christian Brauner
helper is_binderfs_control_device() since it's now used in two places. Additionally, replace the custom rename dance we did with call to simple_rename(). Suggested-by: Al Viro Signed-off-by: Christian Brauner --- drivers/android/binderfs.c | 33 - 1 file changed, 16

[PATCH 0/5] binderfs: debug galore

2019-01-18 Thread Christian Brauner
Christian Brauner (5): binderfs: remove outdated comment binderfs: prevent renaming the control dentry binderfs: rework binderfs_fill_super() binderfs: kill_litter_super() before cleanup binderfs: drop lock in binderfs_binder_ctl_create drivers/android/binderfs.c | 79

[PATCH 3/5] binderfs: rework binderfs_fill_super()

2019-01-18 Thread Christian Brauner
on error. Suggested-by: Al Viro Signed-off-by: Christian Brauner --- drivers/android/binderfs.c | 35 +-- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index 02c96b5edfa9..c0fa495ee994 100644

[PATCH 1/5] binderfs: remove outdated comment

2019-01-18 Thread Christian Brauner
The comment stems from an early version of that patchset and is just confusing now. Cc: Al Viro Signed-off-by: Christian Brauner --- drivers/android/binderfs.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index e4ff4c3fa371

[PATCH 5/5] binderfs: drop lock in binderfs_binder_ctl_create

2019-01-18 Thread Christian Brauner
The binderfs_binder_ctl_create() call is a no-op on subsequent calls and the first call is done before we unlock the suberblock. Hence, there is no need to take inode_lock() in there. Let's remove it. Suggested-by: Al Viro Signed-off-by: Christian Brauner --- Note, that fs/devptfs

Re: [PATCH 3/5] binderfs: rework binderfs_fill_super()

2019-01-19 Thread Christian Brauner
On Fri, Jan 18, 2019 at 11:03:54PM +, Al Viro wrote: > On Fri, Jan 18, 2019 at 03:53:42PM +0100, Christian Brauner wrote: > > static int binderfs_fill_super(struct super_block *sb, void *data, int > > silent) > > { > > + int ret; > > struct bin

Re: [PATCH 2/5] binderfs: prevent renaming the control dentry

2019-01-19 Thread Christian Brauner
On Fri, Jan 18, 2019 at 10:55:52PM +, Al Viro wrote: > On Fri, Jan 18, 2019 at 03:53:41PM +0100, Christian Brauner wrote: > > We don't allow to unlink it since it is crucial for binderfs to be useable > > but if we allow to rename it we make the unlink trivial to bypass.

Re: [PATCH 0/5] binderfs: debug galore

2019-01-19 Thread Christian Brauner
On Fri, Jan 18, 2019 at 11:26:34PM +, Al Viro wrote: > On Fri, Jan 18, 2019 at 03:53:39PM +0100, Christian Brauner wrote: > > Hey everyone, > > > > Al gave me a really helpful review of binderfs and pointed out a range > > of bugs. The most obvious and serious on

Re: [PATCH -next] binderfs: fix error return code in binderfs_fill_super()

2019-01-15 Thread Christian Brauner
On Wed, Jan 16, 2019 at 03:01:04AM +, Wei Yongjun wrote: > Fix to return a negative error code -ENOMEM from the new_inode() and > d_make_root() error handling cases instead of 0, as done elsewhere in > this function. > > Fixes: 3ad20fe393b3 ("binder: implement binderfs") > Signed-off-by: Wei

Re: [PATCH -next] binderfs: fix error return code in binderfs_fill_super()

2019-01-15 Thread Christian Brauner
On Wed, Jan 16, 2019 at 07:25:46AM +0100, Christian Brauner wrote: > On Wed, Jan 16, 2019 at 03:01:04AM +, Wei Yongjun wrote: > > Fix to return a negative error code -ENOMEM from the new_inode() and > > d_make_root() error handling cases instead of 0, as done elsewhere in &g

[PATCH v1 7/7] binderfs: switch from d_add() to d_instantiate()

2019-01-21 Thread Christian Brauner
0001 R14: ff9c R15: 00c0bc60 Cc: Al Viro Signed-off-by: Christian Brauner --- /* Changelog */ v1: - patch introduced --- drivers/android/binderfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/binderfs.c b/drivers/android/bind

[PATCH v1 2/7] binderfs: prevent renaming the control dentry

2019-01-21 Thread Christian Brauner
to first check whether we're trying to rename the control dentry. If we do EPERM the caller and if not call simple_rename(). Suggested-by: Al Viro Signed-off-by: Christian Brauner --- /* Changelog */ v1: - simplify is_binderfs_control_device() to only take a dentry argument instead of taking

[PATCH v1 6/7] binderfs: drop lock in binderfs_binder_ctl_create

2019-01-21 Thread Christian Brauner
The binderfs_binder_ctl_create() call is a no-op on subsequent calls and the first call is done before we unlock the suberblock. Hence, there is no need to take inode_lock() in there. Let's remove it. Suggested-by: Al Viro Signed-off-by: Christian Brauner --- Note, that fs/devptfs

[PATCH v1 5/7] binderfs: kill_litter_super() before cleanup

2019-01-21 Thread Christian Brauner
Al pointed out that first calling kill_litter_super() before cleaning up info is more correct since destroying info doesn't depend on the state of the dentries and inodes. That the opposite remains true is not guaranteed. Suggested-by: Al Viro Signed-off-by: Christian Brauner --- /* Changelog

[PATCH v1 4/7] binderfs: rework binderfs_binder_device_create()

2019-01-21 Thread Christian Brauner
the existing dentry or a new one. - switch from kmalloc() + strscpy() to kmemdup(): Use a more idiomatic way to copy the name for the new dentry that userspace gave us. Suggested-by: Al Viro Signed-off-by: Christian Brauner --- /* Changelog */ v1: - patch introduced --- drivers/android

[PATCH 2/2] binderfs: use __u32 for device numbers

2019-01-21 Thread Christian Brauner
We allow more then 255 binderfs binder devices to be created since there are workloads that require more than that. If we use __u8 we'll overflow after 255. So let's use a __u32. Note that there's no released kernel with binderfs out there so this is not a regression. Signed-off-by: Christian

[PATCH 1/2] binderfs: use correct include guards in header

2019-01-21 Thread Christian Brauner
When we switched over from binder_ctl.h to binderfs.h we forgot to change the include guards. It's minor but it's obviously correct. Signed-off-by: Christian Brauner --- include/uapi/linux/android/binderfs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/uapi

[PATCH v1 3/7] binderfs: rework binderfs_fill_super()

2019-01-21 Thread Christian Brauner
on error. Suggested-by: Al Viro Signed-off-by: Christian Brauner --- /* Changelog */ v1: - correctly grab and stash a reference to task's ipc_ns to prevent leaks - replace d_alloc_name() + d_lookup() combination with lookup_one_len() - replace kmalloc() + strscpy() with kmemdup() --- drivers/android

[PATCH v1 1/7] binderfs: remove outdated comment

2019-01-21 Thread Christian Brauner
The comment stems from an early version of that patchset and is just confusing now. Cc: Al Viro Signed-off-by: Christian Brauner --- /* Changelog */ v1: - patch unchanged --- drivers/android/binderfs.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/android/binderfs.c b/drivers

[PATCH v1 0/7] binderfs: debug galore

2019-01-21 Thread Christian Brauner
Christian Brauner (7): binderfs: remove outdated comment binderfs: prevent renaming the control dentry binderfs: rework binderfs_fill_super() binderfs: rework binderfs_binder_device_create() binderfs: kill_litter_super() before cleanup binderfs: drop lock in binderfs_binder_ctl_create

Re: [PATCH -next v2] binderfs: fix error return code in binderfs_fill_super()

2019-01-16 Thread Christian Brauner
On Wed, Jan 16, 2019 at 08:34:02AM +, Wei Yongjun wrote: > Fix to return a negative error code -ENOMEM from the new_inode() and > d_make_root() error handling cases instead of 0, as done elsewhere in > this function. > > Fixes: 3ad20fe393b3 ("binder: implement binderfs") This should be:

Re: [PATCH -next v2] binderfs: fix error return code in binderfs_fill_super()

2019-01-16 Thread Christian Brauner
On Wed, Jan 16, 2019 at 09:41:08AM +0100, Christian Brauner wrote: > On Wed, Jan 16, 2019 at 08:34:02AM +, Wei Yongjun wrote: > > Fix to return a negative error code -ENOMEM from the new_inode() and > > d_make_root() error handling cases instead of 0, as done elsewhere in &g

Re: [PATCH v3] selftests: add binderfs selftests

2019-01-23 Thread Christian Brauner
On Thu, Jan 17, 2019 at 12:48:54PM +0100, Christian Brauner wrote: > This adds the promised selftest for binderfs. It will verify the following > things: > - binderfs mounting works > - binder device allocation works > - performing a binder ioctl() request through a binder

[PATCH 1/2] binderfs: respect limit on binder control creation

2019-01-23 Thread Christian Brauner
in binderfs_binder_ctl_create() that we perform in binderfs_binder_device_create(). Fixes: 36bdf3cae09d ("binderfs: reserve devices for initial mount") Signed-off-by: Christian Brauner --- drivers/android/binderfs.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git

[PATCH 2/2] binderfs: remove separate device_initcall()

2019-01-23 Thread Christian Brauner
="". When CONFIG_ANDROID_BINDERFS=n then this always succeeds so there's no regression potential for legacy workloads. Signed-off-by: Christian Brauner --- drivers/android/binder.c | 4 drivers/android/binder_internal.h | 9 + drivers/android/binderfs.c| 4 +--

Re: [PATCH v3] selftests: add binderfs selftests

2019-01-23 Thread Christian Brauner
On Wed, Jan 23, 2019 at 07:15:01AM -0700, shuah wrote: > On 1/23/19 4:00 AM, Greg KH wrote: > > On Wed, Jan 23, 2019 at 11:54:58AM +0100, Christian Brauner wrote: > > > On Thu, Jan 17, 2019 at 12:48:54PM +0100, Christian Brauner wrote: > > > > This adds the

[PATCH v2] binder: implement binderfs

2018-12-13 Thread Christian Brauner
d, minor %d, and " "name %s\n", device.major, device.minor, device.name); exit(EXIT_SUCCESS); } Cc: Martijn Coenen Cc: Greg Kroah-Hartman Signed-off-by: Christian Brauner Acked-by: Todd Kjos --- v1: - pleasing kbo

Re: [PATCH v1] binder: implement binderfs

2018-12-13 Thread Christian Brauner
On Thu, Dec 13, 2018 at 06:56:26PM +0100, Greg Kroah-Hartman wrote: > On Wed, Dec 12, 2018 at 01:51:27PM +0100, Christian Brauner wrote: > > > > Cc: Martijn Coenen > > > > Cc: Todd Kjos > > > > Cc: Greg Kroah-Hartman > > > > Signed-off-

[PATCH] binderfs: implement sysctls

2018-12-21 Thread Christian Brauner
binderfs mounts. 3. /proc/sys/fs/binder/reserved: Ensure that global root can reserve binder devices for the initial binderfs mount in the initial ipc namespace to prevent DOS attacks. This is equivalent to sysctls of devpts. Signed-off-by: Christian Brauner --- drivers/android/binderfs.c

Re: [PATCH] binderfs: implement sysctls

2018-12-21 Thread Christian Brauner
On Fri, Dec 21, 2018 at 02:55:09PM +0100, Greg KH wrote: > On Fri, Dec 21, 2018 at 02:39:09PM +0100, Christian Brauner wrote: > > This implements three sysctls that have very specific goals: > > Ick, why? > > What are these going to be used for? Who will "control&q

Re: [PATCH] binderfs: implement "max" mount option

2018-12-23 Thread Christian Brauner
On Sun, Dec 23, 2018 at 12:29:44PM +0100, Greg KH wrote: > On Sat, Dec 22, 2018 at 10:18:06PM +0100, Christian Brauner wrote: > > Since binderfs can be mounted by userns root in non-initial user namespaces > > some precautions are in order. First, a way to set a maximum on the numbe

Re: [PATCH] binderfs: implement "max" mount option

2018-12-23 Thread Christian Brauner
On Sat, Dec 22, 2018 at 10:18:06PM +0100, Christian Brauner wrote: > Since binderfs can be mounted by userns root in non-initial user namespaces > some precautions are in order. First, a way to set a maximum on the number > of binder devices that can be allocated per binderfs instance a

[PATCH v1 2/2] binderfs: reserve devices for initial mount

2018-12-23 Thread Christian Brauner
ut risking that all minor numbers have already been used up. Cc: Todd Kjos Cc: Greg Kroah-Hartman Signed-off-by: Christian Brauner --- v1: - patch introduced v0: - patch not present --- drivers/android/binderfs.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drive

[PATCH v1 1/2] binderfs: implement "max" mount option

2018-12-23 Thread Christian Brauner
: Greg Kroah-Hartman Signed-off-by: Christian Brauner --- v1: - split reserving devices for the binderfs instance in the initial ipc namespace into a separate patch (cf. [1]) - s/ - use simple int instead of atomic_t for counting devices since we're incrementing and decrementing under a mutex

Re: [PATCH v1] binder: implement binderfs(Internet mail)

2018-12-10 Thread Christian Brauner
On Tue, Dec 11, 2018 at 03:44:48AM +, chouryzhou(周威) wrote: > > chouryzhou@, can you confirm that this implementation works for your > > android-in-container use-case? > > > > -Todd > > > We are running Android Pie in container now. If it works for later Android > release, it will works for

Re: [PATCH v1 1/2] binderfs: implement "max" mount option

2018-12-24 Thread Christian Brauner
On Sun, Dec 23, 2018 at 03:35:49PM +0100, Christian Brauner wrote: > Since binderfs can be mounted by userns root in non-initial user namespaces > some precautions are in order. First, a way to set a maximum on the number > of binder devices that can be allocated per binderfs instance a

Re: [PATCH v1 1/2] binderfs: implement "max" mount option

2018-12-24 Thread Christian Brauner
On Mon, Dec 24, 2018 at 12:45:59PM +0100, Greg KH wrote: > On Mon, Dec 24, 2018 at 12:09:37PM +0100, Christian Brauner wrote: > > On Sun, Dec 23, 2018 at 03:35:49PM +0100, Christian Brauner wrote: > > > Since binderfs can be mounted by userns root in non-initial user > >

[PATCH] binderfs: implement "max" mount option

2018-12-22 Thread Christian Brauner
+gdvw4fkkk8oznair9g5icjlyodo8hykv3o0o1jt...@mail.gmail.com/ [4]: https://lore.kernel.org/lkml/20181221192044.5yvfnuri7gdop...@brauner.io/ Cc: Todd Kjos Cc: Greg Kroah-Hartman Signed-off-by: Christian Brauner --- drivers/android/binderfs.c | 109 +++-- 1 file

[PATCH v3] binder: implement binderfs

2018-12-14 Thread Christian Brauner
d, minor %d, and " "name %s\n", device.major, device.minor, device.name); exit(EXIT_SUCCESS); } Cc: Martijn Coenen Cc: Greg Kroah-Hartman Signed-off-by: Christian Brauner Acked-by: Todd Kjos --- v3: - use strscpy() instea

Re: [PATCH v2] binder: implement binderfs

2018-12-14 Thread Christian Brauner
On Fri, Dec 14, 2018 at 10:11:23AM +0300, Dan Carpenter wrote: > On Thu, Dec 13, 2018 at 10:59:11PM +0100, Christian Brauner wrote: > > +/** > > + * binderfs_new_inode - allocate inode from super block of a binderfs mount > > + * @ref_inode: inode from wich the supe

Re: [PATCH] binderfs: implement sysctls

2018-12-21 Thread Christian Brauner
On Fri, Dec 21, 2018 at 04:37:58PM +0100, Greg KH wrote: > On Fri, Dec 21, 2018 at 03:12:42PM +0100, Christian Brauner wrote: > > On Fri, Dec 21, 2018 at 02:55:09PM +0100, Greg KH wrote: > > > On Fri, Dec 21, 2018 at 02:39:09PM +0100, Christian Brauner wrote: > > > >

Re: [PATCH] binderfs: implement sysctls

2018-12-21 Thread Christian Brauner
On Fri, Dec 21, 2018 at 05:33:16PM +0100, Greg KH wrote: > On Fri, Dec 21, 2018 at 04:59:19PM +0100, Christian Brauner wrote: > > On Fri, Dec 21, 2018 at 04:37:58PM +0100, Greg KH wrote: > > > On Fri, Dec 21, 2018 at 03:12:42PM +0100, Christian Brauner wrote: > > > >

Re: [PATCH v1] binder: implement binderfs

2018-12-12 Thread Christian Brauner
> On Fri, Dec 7, 2018 at 3:26 PM Christian Brauner wrote: > > > > As discussed at Linux Plumbers Conference 2018 in Vancouver [1] this is the > > implementation of binderfs. > > > > binderfs is a backwards-compatible filesystem for Android's binder ipc > > m

[PATCH] binder: implement binderfs

2018-12-04 Thread Christian Brauner
ajor, device.minor, device.suffix); exit(EXIT_SUCCESS); } /* Demo */ A demo of how binderfs works can be found under [2]. [1]: https://goo.gl/JL2tfX [2]: https://asciinema.org/a/zYUCqL7OySASWK9S2yVFq2sxM Cc: Martijn Coenen Cc: Todd Kjos Cc: Greg Kroah-Hartm

Re: [PATCH] binder: implement binderfs

2018-12-05 Thread Christian Brauner
On Wed, Dec 05, 2018 at 09:01:45PM +0100, Greg KH wrote: > On Tue, Dec 04, 2018 at 02:12:39PM +0100, Christian Brauner wrote: > > As discussed at Linux Plumbers Conference 2018 in Vancouver [1] this is the > > implementation of binderfs. If you want to skip reading and just see h

[PATCH v1] binder: implement binderfs

2018-12-07 Thread Christian Brauner
uot;Allocated new binder device with major %d, minor %d, and " "name %s\n", device.major, device.minor, device.name); exit(EXIT_SUCCESS); } /* Demo */ A demo of how binderfs works can be found under [2]. [1]: https://goo.gl/JL2tfX

Re: [PATCH] binder: implement binderfs

2018-12-06 Thread Christian Brauner
On Thu, Dec 06, 2018 at 03:04:03PM +0100, Greg KH wrote: > On Wed, Dec 05, 2018 at 10:42:06PM +0100, Christian Brauner wrote: > > On Wed, Dec 05, 2018 at 09:01:45PM +0100, Greg KH wrote: > > > > /* binder-control */ > > > > Each new binderfs instance comes with

Re: [PATCH V4] binder: ipc namespace support for android binder

2018-11-19 Thread Christian Brauner
rovide backwards > compatibility for non-container use-cases. > > The etherpad notes are at [2] (look at "Dynamically Allocated Binder > Devices" section) > > Christian Brauner will be sending out more details. Ok, sorry for the delay I got caught up in other work

Re: [PATCH v1 1/2] binderfs: implement "max" mount option

2019-01-02 Thread Christian Brauner
On Wed, Jan 02, 2019 at 12:17:31PM +0300, Dan Carpenter wrote: > On Sun, Dec 23, 2018 at 03:35:49PM +0100, Christian Brauner wrote: > > static inline struct binderfs_info *BINDERFS_I(const struct inode *inode) > > @@ -110,10 +132,16 @@ static int binderfs_binder_device_crea

[PATCH v2 2/2] binderfs: reserve devices for initial mount

2019-01-02 Thread Christian Brauner
ut risking that all minor numbers have already been used up. Cc: Todd Kjos Cc: Greg Kroah-Hartman Signed-off-by: Christian Brauner --- v2: - patch unchanged v1: - patch introduced v0: - patch not present --- drivers/android/binderfs.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-)

[PATCH v2 1/2] binderfs: implement "max" mount option

2019-01-02 Thread Christian Brauner
: Greg Kroah-Hartman Signed-off-by: Christian Brauner --- v2: - grab mutex to decrement device_count in the one place where it was missing (cf. [changelog-3]). v1: - split reserving devices for the binderfs instance in the initial ipc namespace into a separate patch (cf. [changelog-1]) - s/ - use

Re: [PATCH v1 2/2] binderfs: reserve devices for initial mount

2019-01-03 Thread Christian Brauner
On Thu, Jan 03, 2019 at 12:25:24PM -0800, Todd Kjos wrote: > On Sun, Dec 23, 2018 at 6:36 AM Christian Brauner > wrote: > > > > The binderfs instance in the initial ipc namespace will always have a > > reserve of 4 binder devices unless explicitly capped by specifyi

[PATCH] binderfs: rename header to binderfs.h

2019-01-10 Thread Christian Brauner
It doesn't make sense to call the header binder_ctl.h when its sole existence is tied to binderfs. So give it a sensible name. Users will far more easily remember binderfs.h than binder_ctl.h. Signed-off-by: Christian Brauner --- drivers/android/binderfs.c | 2

[RESEND PATCH] binderfs: reserve devices for initial mount

2019-01-11 Thread Christian Brauner
ut risking that all minor numbers have already been used up. Cc: Todd Kjos Cc: Greg Kroah-Hartman Signed-off-by: Christian Brauner --- v2: - patch unchanged v1: - patch introduced v0: - patch not present --- drivers/android/binderfs.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-)

Re: [RESEND PATCH] binderfs: reserve devices for initial mount

2019-01-11 Thread Christian Brauner
On Fri, Jan 11, 2019 at 11:19:40AM +0100, Christian Brauner wrote: > The binderfs instance in the initial ipc namespace will always have a > reserve of 4 binder devices unless explicitly capped by specifying a lower > value via the "max" mount option. > This ensures when bind

Re: [PATCH v2 2/2] binderfs: reserve devices for initial mount

2019-01-11 Thread Christian Brauner
On Fri, Jan 11, 2019 at 10:18:18AM +0100, Greg KH wrote: > On Wed, Jan 02, 2019 at 12:32:19PM +0100, Christian Brauner wrote: > > The binderfs instance in the initial ipc namespace will always have a > > reserve of 4 binder devices unless explicitly capped by specifying a lowe

[PATCH] binderfs: handle !CONFIG_IPC_NS builds

2019-01-11 Thread Christian Brauner
kbuild reported a build faile in [1]. This is triggered when CONFIG_IPC_NS is not set. So let's make the use of init_ipc_ns conditional on CONFIG_IPC_NS being set. [1]: https://lists.01.org/pipermail/kbuild-all/2019-January/056903.html Signed-off-by: Christian Brauner --- drivers/android

Re: [PATCH v1 2/2] binderfs: reserve devices for initial mount

2019-01-03 Thread Christian Brauner
On Thu, Jan 03, 2019 at 01:47:13PM -0800, Todd Kjos wrote: > On Thu, Jan 3, 2019 at 12:34 PM Christian Brauner > wrote: > > > > On Thu, Jan 03, 2019 at 12:25:24PM -0800, Todd Kjos wrote: > > > On Sun, Dec 23, 2018 at 6:36 AM Christian Brauner > > > wrote: &

Re: [PATCH v3] binder: implement binderfs

2018-12-19 Thread Christian Brauner
On Wed, Dec 19, 2018 at 09:47:56AM +0100, Greg KH wrote: > On Fri, Dec 14, 2018 at 01:11:14PM +0100, Christian Brauner wrote: > > As discussed at Linux Plumbers Conference 2018 in Vancouver [1] this is the > > implementation of binderfs. > > > > Looks good to m

[PATCH] binder: fix CONFIG_ANDROID_BINDER_DEVICES

2019-01-26 Thread Christian Brauner
R15: 55b629ebec60 So check for the empty string since strsep() will otherwise return the emtpy string which will cause kobject_add_internal() to panic when trying to add a kobject with an emtpy name. Fixes: ac4812c5ffbb ("binder: Support multiple /dev instances") Cc: Martij

Re: pidfd design

2019-03-25 Thread Christian Brauner
On Mon, Mar 25, 2019 at 05:00:17PM -0700, Andy Lutomirski wrote: > On Mon, Mar 25, 2019 at 4:45 PM Christian Brauner > wrote: > > > > On Mon, Mar 25, 2019 at 04:42:14PM -0700, Andy Lutomirski wrote: > > > On Mon, Mar 25, 2019 at 1:23 PM Daniel Colascione > >

Re: pidfd design

2019-03-25 Thread Christian Brauner
On Mon, Mar 25, 2019 at 04:42:14PM -0700, Andy Lutomirski wrote: > On Mon, Mar 25, 2019 at 1:23 PM Daniel Colascione wrote: > > > > On Mon, Mar 25, 2019 at 1:14 PM Jann Horn wrote: > > > > > > On Mon, Mar 25, 2019 at 8:44 PM Andy Lutomirski wrote: > > > > One ioctl on procfs roots to translate

Re: pidfd design

2019-03-28 Thread Christian Brauner
On Mon, Mar 25, 2019 at 05:24:49PM -0700, Andy Lutomirski wrote: > On Mon, Mar 25, 2019 at 5:12 PM Christian Brauner > wrote: > > > > On Mon, Mar 25, 2019 at 05:00:17PM -0700, Andy Lutomirski wrote: > > > On Mon, Mar 25, 2019 at 4:45 PM Christian Brauner > >

Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android

2019-03-16 Thread Christian Brauner
On Sat, Mar 16, 2019 at 11:00:10AM -0700, Daniel Colascione wrote: > On Sat, Mar 16, 2019 at 10:31 AM Suren Baghdasaryan wrote: > > > > On Fri, Mar 15, 2019 at 11:49 AM Joel Fernandes > > wrote: > > > > > > On Fri, Mar 15, 2019 at 07

Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android

2019-03-17 Thread Christian Brauner
On Sat, Mar 16, 2019 at 09:53:06PM -0400, Joel Fernandes wrote: > On Sat, Mar 16, 2019 at 12:37:18PM -0700, Suren Baghdasaryan wrote: > > On Sat, Mar 16, 2019 at 11:57 AM Christian Brauner > > wrote: > > > > > > On Sat, Mar 16, 2019 at 11:00:10AM -0700, Daniel

Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android

2019-03-17 Thread Christian Brauner
On Sun, Mar 17, 2019 at 08:40:19AM -0700, Daniel Colascione wrote: > On Sun, Mar 17, 2019 at 4:42 AM Christian Brauner > wrote: > > > > On Sat, Mar 16, 2019 at 09:53:06PM -0400, Joel Fernandes wrote: > > > On Sat, Mar 16, 2019 at 12:37:18PM -0700, Suren Baghdasaryan wr

Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android

2019-03-19 Thread Christian Brauner
On Mon, Mar 18, 2019 at 07:50:52PM -0400, Joel Fernandes wrote: > On Mon, Mar 18, 2019 at 01:29:51AM +0100, Christian Brauner wrote: > > On Sun, Mar 17, 2019 at 08:40:19AM -0700, Daniel Colascione wrote: > > > On Sun, Mar 17, 2019 at 4:42 AM Christian Brauner > > > wr

Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android

2019-03-19 Thread Christian Brauner
On Tue, Mar 19, 2019 at 03:48:32PM -0700, Daniel Colascione wrote: > On Tue, Mar 19, 2019 at 3:14 PM Christian Brauner > wrote: > > So I dislike the idea of allocating new inodes from the procfs super > > block. I would like to avoid pinning the whole pidfd concept exclu

Re: pidfd design

2019-03-19 Thread Christian Brauner
On Tue, Mar 19, 2019 at 07:42:52PM -0700, Daniel Colascione wrote: > On Tue, Mar 19, 2019 at 6:52 PM Joel Fernandes wrote: > > > > On Wed, Mar 20, 2019 at 12:10:23AM +0100, Christian Brauner wrote: > > > On Tue, Mar 19, 2019 at 03:48:32PM -0700, Daniel Colascione wrote

Re: pidfd design

2019-03-20 Thread Christian Brauner
On Wed, Mar 20, 2019 at 11:38:35AM -0700, Daniel Colascione wrote: > On Wed, Mar 20, 2019 at 11:26 AM Christian Brauner > wrote: > > On Wed, Mar 20, 2019 at 07:33:51AM -0400, Joel Fernandes wrote: > > > > > > > > > On March 20, 2019 3:02:32 AM EDT, Daniel

Re: pidfd design

2019-03-20 Thread Christian Brauner
On Wed, Mar 20, 2019 at 11:58:57AM -0700, Andy Lutomirski wrote: > On Wed, Mar 20, 2019 at 11:52 AM Christian Brauner > wrote: > > > > You're misunderstanding. Again, I said in my previous mails it should > > accept pidfds optionally as arguments, yes. But I don

Re: pidfd design

2019-03-20 Thread Christian Brauner
On Wed, Mar 20, 2019 at 07:33:51AM -0400, Joel Fernandes wrote: > > > On March 20, 2019 3:02:32 AM EDT, Daniel Colascione wrote: > >On Tue, Mar 19, 2019 at 8:59 PM Christian Brauner > > wrote: > >> > >> On Tue, Mar 19, 2019 at 07:42:52PM -0700, Daniel

Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android

2019-03-12 Thread Christian Brauner
On Tue, Mar 12, 2019 at 7:43 PM Tim Murray wrote: > > On Tue, Mar 12, 2019 at 10:45 AM Sultan Alsawaf > wrote: > > > > On Tue, Mar 12, 2019 at 10:17:43AM -0700, Tim Murray wrote: > > > Knowing whether a SIGKILL'd process has finished reclaiming is as far > > > as I know not possible without

Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android

2019-03-15 Thread Christian Brauner
On Thu, Mar 14, 2019 at 09:36:43PM -0700, Daniel Colascione wrote: > On Thu, Mar 14, 2019 at 8:16 PM Steven Rostedt wrote: > > > > On Thu, 14 Mar 2019 13:49:11 -0700 > > Sultan Alsawaf wrote: > > > > > Perhaps I'm missing something, but if you want to know when a process has > > > died > > >

Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android

2019-03-15 Thread Christian Brauner
On Fri, Mar 15, 2019 at 02:13:24PM -0400, Joel Fernandes wrote: > On Fri, Mar 15, 2019 at 07:03:07PM +0100, Christian Brauner wrote: > > On Thu, Mar 14, 2019 at 09:36:43PM -0700, Daniel Colascione wrote: > > > On Thu, Mar 14, 2019 at 8:16 PM Steven Rostedt > > > wrote:

Re: [PATCH 2/2] binderfs: remove separate device_initcall()

2019-01-30 Thread Christian Brauner
On Wed, Jan 30, 2019 at 03:24:12PM +0100, Greg KH wrote: > On Wed, Jan 23, 2019 at 12:41:16PM +0100, Christian Brauner wrote: > > binderfs should not have a separate device_initcall(). When a kernel is > > compiled with CONFIG_ANDROID_BINDERFS register the files

[PATCH v1] binderfs: remove separate device_initcall()

2019-01-30 Thread Christian Brauner
="". When CONFIG_ANDROID_BINDERFS=n then this always succeeds so there's no regression potential for legacy workloads. Signed-off-by: Christian Brauner --- /* Changelog */ - ensure that device_name is set to NULL so kfree() doesn't freak out --- drivers/android/binder.c | 7 ++

Re: [PATCH 2/2] binderfs: remove separate device_initcall()

2019-01-30 Thread Christian Brauner
On Wed, Jan 30, 2019 at 10:17:39PM +0100, Greg KH wrote: > On Wed, Jan 30, 2019 at 06:01:02PM +0100, Christian Brauner wrote: > > On Wed, Jan 30, 2019 at 03:24:12PM +0100, Greg KH wrote: > > > On Wed, Jan 23, 2019 at 12:41:16PM +0100, Christian Brauner wrote: > > >

Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android

2019-05-07 Thread Christian Brauner
On Tue, May 07, 2019 at 01:12:36AM -0700, Sultan Alsawaf wrote: > On Tue, May 07, 2019 at 09:43:34AM +0200, Greg Kroah-Hartman wrote: > > Given that any "new" android device that gets shipped "soon" should be > > using 4.9.y or newer, is this a real issue? > > It's certainly a real issue for

  1   2   >