Re: [PATCH] binder: fix async_free_space accounting for empty parcels

2021-12-23 Thread Christian Brauner
oid: binder: Move buffer out of area shared with > user space") > Signed-off-by: Todd Kjos > --- Looks good. Acked-by: Christian Brauner ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v2 3/4] binder: read pre-translated fds from sender buffer

2021-12-01 Thread Christian Brauner
ent checks. Previously the alignment checks would > have been done in a different place, but this lets us print more > useful error messages. > > Reviewed-by: Martijn Coenen > Signed-off-by: Todd Kjos > --- Looks good. Acked-by: Christian Brauner

Re: [PATCH v2 1/4] binder: fix handling of error during copy

2021-12-01 Thread Christian Brauner
Suggested-by: Dan Carpenter > Signed-off-by: Todd Kjos > --- Looks good. Acked-by: Christian Brauner ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v2 2/4] binder: avoid potential data leakage when copying txn

2021-12-01 Thread Christian Brauner
re visible to the > target prior to the fixups. > > Instead of copying all of the data first, copy data only > after any needed fixups have been applied. > > Fixes: 457b9a6f09f0 ("Staging: android: add binder driver") > Reviewed-by: Martijn Coenen > Signed-off-by

Re: [PATCH] binder: fix test regression due to sender_euid change

2021-11-16 Thread Christian Brauner
tigation. It is a partial > reversion because subsequent patches rely on proc->cred. > > Cc: sta...@vger.kernel.org # 4.4+ > Fixes: 29bc22ac5e5b ("binder: use euid from cred instead of using task") > Signed-off-by: Todd Kjos > Change-Id: I9b1769a3510fed250bb

Re: [PATCH] binder: don't detect sender/target during buffer cleanup

2021-10-18 Thread Christian Brauner
ow > 'is_failure' can be used to accurately detect this case. > > Fixes: 44d8047f1d87 ("binder: use standard functions to allocate fds") > Signed-off-by: Todd Kjos > --- Looks good to me. Acked-by: Christian Brauner __

Re: [PATCH] binder: make sure fd closes complete

2021-08-31 Thread Christian Brauner
or the file object may never be > dereferenced -- which can lead to hung processes. > > Force the binder thread back to userspace if an fd is closed during > BC_FREE_BUFFER handling. > > Signed-off-by: Todd Kjos > --- Looks good. Th

Re: [PATCH 2/2] binder: Use receive_fd() to receive file from another process

2021-04-16 Thread Christian Brauner
On Fri, Apr 16, 2021 at 05:58:25PM +0200, Christian Brauner wrote: > On Fri, Apr 16, 2021 at 03:35:59PM +, Al Viro wrote: > > On Fri, Apr 16, 2021 at 05:13:10PM +0200, Christian Brauner wrote: > > > > > My point here was more that the _file_ has already been opened _be

Re: [PATCH 2/2] binder: Use receive_fd() to receive file from another process

2021-04-16 Thread Christian Brauner
On Fri, Apr 16, 2021 at 03:35:59PM +, Al Viro wrote: > On Fri, Apr 16, 2021 at 05:13:10PM +0200, Christian Brauner wrote: > > > My point here was more that the _file_ has already been opened _before_ > > that call to io_uring_add_task_file(). But any potential non-trivial &

Re: [PATCH 2/2] binder: Use receive_fd() to receive file from another process

2021-04-16 Thread Christian Brauner
On Fri, Apr 16, 2021 at 02:09:35PM +, Al Viro wrote: > On Fri, Apr 16, 2021 at 03:42:52PM +0200, Christian Brauner wrote: > > > > are drivers/dma-buf/sw_sync.c and drivers/dma-buf/sync_file.c, etc. > > > > > > FWIW, pretty much all ioctls that return

Re: [PATCH 2/2] binder: Use receive_fd() to receive file from another process

2021-04-16 Thread Christian Brauner
On Fri, Apr 16, 2021 at 05:55:16AM +, Al Viro wrote: > On Fri, Apr 16, 2021 at 05:19:50AM +, Al Viro wrote: > > On Thu, Apr 01, 2021 at 12:40:34PM +0200, Christian Brauner wrote: > > > > and see whether all of them can be switched to simply using > > > re

Re: [PATCH 2/2] binder: Use receive_fd() to receive file from another process

2021-04-01 Thread Christian Brauner
On Thu, Apr 01, 2021 at 11:54:45AM +0200, Greg KH wrote: > On Thu, Apr 01, 2021 at 05:09:32PM +0800, Xie Yongji wrote: > > Use receive_fd() to receive file from another process instead of > > combination of get_unused_fd_flags() and fd_install(). This simplifies > > the logic and also makes sure we

Re: [PATCH 0/2] Export receive_fd() to modules and do some cleanups

2021-04-01 Thread Christian Brauner
On Thu, Apr 01, 2021 at 05:09:30PM +0800, Xie Yongji wrote: > This series starts from Christian's comments on the series[1]. > We'd like to export receive_fd() which can not only be used by > our module in the series[1] but also allow further cleanups > like patch 2 does. > > Now this series is ba

Re: [PATCH v3 1/3] binder: BINDER_FREEZE ioctl

2021-03-17 Thread Christian Brauner
On Mon, Mar 15, 2021 at 06:16:28PM -0700, Li Li wrote: > From: Marco Ballesio > > Frozen tasks can't process binder transactions, so a way is required to > inform transmitting ends of communication failures due to the frozen > state of their receiving counterparts. Additionally, races are possibl

Re: [PATCH v3 0/3] Binder: Enable App Freezing Capability

2021-03-17 Thread Christian Brauner
On Mon, Mar 15, 2021 at 06:16:27PM -0700, Li Li wrote: > From: Li Li > > To improve the user experience when switching between recently used > applications, the background applications which are not currently needed > are cached in the memory. Normally, a well designed application will not > cons

Re: [PATCH -next] binder: change error code from postive to negative in binder_transaction

2020-10-29 Thread Christian Brauner
On Mon, Oct 26, 2020 at 07:03:14PM +0800, Zhang Qilong wrote: > Depending on the context, the error return value > here (extra_buffers_size < added_size) should be > negative. > > Signed-off-by: Zhang Qilong > --- Thanks! Acked-

Re: [PATCH] binder: fix UAF when releasing todo list

2020-10-13 Thread Christian Brauner
binder_work element > must not be accessed after releasing the inner_proc_lock while > processing the todo list elements since another thread might be > handling a deref on the node containing the binder_work element > leading to the node being freed

Re: [PATCH v2 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic32

2020-10-09 Thread Christian Brauner
version doesn't change the overflow wrap around behavior. > > Signed-off-by: Shuah Khan > Reviewed-by: Joel Fernandes (Google) > Reviewed-by: Kees Cook > --- Thanks! Reviewed-by: Christian Brauner ___ devel mailing list de...@lin

Re: [PATCH v3 -next] binder: simplify the return expression of binder_mmap

2020-10-02 Thread Christian Brauner
On Tue, Sep 29, 2020 at 09:52:16AM +0800, Liu Shixin wrote: > Simplify the return expression. > > Signed-off-by: Liu Shixin > --- Thanks! Acked-by: Christian Brauner ___ devel mailing list de...@linuxdriverproj

Re: [PATCH -next] binder: simplify the return expression of binder_mmap

2020-09-21 Thread Christian Brauner
On Mon, Sep 21, 2020 at 04:24:23PM +0800, Liu Shixin wrote: > Simplify the return expression. > > Signed-off-by: Liu Shixin > --- Why not is all I can really say. :) But if this is about simplifying you could get rid of the "ret" and "failure string" variables, and the goto in that function comp

Re: [PATCH][next] binder: remove redundant assignment to pointer n

2020-09-11 Thread Christian Brauner
es-Coverity: ("Unused value") > Signed-off-by: Colin Ian King > --- Thanks! Acked-by: Christian Brauner ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH -next] binderfs: make symbol 'binderfs_fs_parameters' static

2020-08-18 Thread Christian Brauner
f binderfs.c, so this commit > marks it static. > > Fixes: 095cf502b31e ("binderfs: port to new mount api") > Reported-by: Hulk Robot > Signed-off-by: Wei Yongjun > --- Thanks! Acked-by: Christian Brauner

Re: [PATCH] binder: Remove bogus warning on failed same-process transaction

2020-08-07 Thread Christian Brauner
x27;s > just remove it. > > Fixes: 44d8047f1d87 ("binder: use standard functions to allocate fds") > Reported-by: syzbot+e113a0b970b7b3f39...@syzkaller.appspotmail.com > Signed-off-by: Jann Horn > --- Acked-by: Christian Brauner Thanks! Christian ___

Re: [PATCH] android: binder.h: drop a duplicated word

2020-07-19 Thread Christian Brauner
On Sat, Jul 18, 2020 at 05:27:38PM -0700, Randy Dunlap wrote: > Drop the repeated word "the" in a comment. > > Signed-off-by: Randy Dunlap > Cc: Greg Kroah-Hartman > Cc: Arve Hjønnevåg > Cc: Todd Kjos > Cc: Martijn Coenen > Cc: Joel Fernandes > Cc: Chri

Re: [PATCH v2] binder: Don't use mmput() from shrinker function.

2020-07-16 Thread Christian Brauner
> > Reported-by: syzbot > > Signed-off-by: Tetsuo Handa > > Reviewed-by: Michal Hocko Thanks for the careful review Michal! Does this need a Cc: stable? Otherwise Acked-by: Christian Brauner Thanks! Christian ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] binder: fix null deref of proc->context

2020-06-23 Thread Christian Brauner
On Tue, Jun 23, 2020 at 11:50:21AM +0300, Dan Carpenter wrote: > On Mon, Jun 22, 2020 at 01:07:15PM -0700, Todd Kjos wrote: > > The binder driver makes the assumption proc->context pointer is invariant > > after > > initialization (as documented in the kerneldoc header for struct proc). > > Howeve

Re: [PATCH] binder: fix null deref of proc->context

2020-06-22 Thread Christian Brauner
en we know there are no references > remaining on the binder_proc. > > Fixes: f0fe2c0f050d ("binder: prevent UAF for binderfs devices II") > Signed-off-by: Todd Kjos Thanks, looks good to me! Acked-by: Christian Brauner Christian > --- > drivers/android/binde

Re: [PATCH] staging: android: ion: Skip sync if not mapped

2020-04-20 Thread Christian Brauner
oid/ion/ion.c > > > > +++ b/drivers/staging/android/ion/ion.c > > > > > > Now that we have the dma-buff stuff in the tree, do we even need the > > > ion code in the kernel anymore? Can't we delete it now? > > > >

Re: [PATCH] binderfs: Fix binderfs.c selftest compilation warning

2020-04-11 Thread Christian Brauner
around > initializer [-Wmissing-braces] > struct binderfs_device device_info = { 0 }; > drivers/android/binderfs.c:650:9: warning: (near initialization for > ‘device_info.name’) [-Wmissing-braces] > > Signed-off-by: Tang Bin &g

Re: [PATCH] Documentation: android: binderfs: add 'stats' mount option

2020-04-08 Thread Christian Brauner
lobal stats") > Signed-off-by: Randy Dunlap > Cc: Hridya Valsaraju > Cc: Christian Brauner > Cc: Christian Brauner > Cc: Greg Kroah-Hartman > Cc: de...@driverdev.osuosl.org Thanks! Acked-by: Christian Brauner _

Re: [PATCH] binderfs: remove redundant assignment to pointer ctx

2020-04-02 Thread Christian Brauner
es-Coverity: ("Unused value") > Signed-off-by: Colin Ian King Acked-by: Christian Brauner ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: binderfs interferes with syzkaller?

2020-01-28 Thread Christian Brauner
On Tue, Jan 28, 2020 at 07:46:08AM -0600, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Sun, Jan 26, 2020 at 09:55:35AM +0100, Greg Kroah-Hartman wrote: > >> On Sat, Jan 25, 2020 at 06:49:49PM +0100, Dmitry Vyukov wrote: > >> > Hi binder maintain

Re: binderfs interferes with syzkaller?

2020-01-26 Thread Christian Brauner
On Sat, Jan 25, 2020 at 07:13:03PM +0100, Dmitry Vyukov wrote: > On Sat, Jan 25, 2020 at 6:49 PM Dmitry Vyukov wrote: > > > > Hi binder maintainers, > > > > It seems that something has happened and now syzbot has 0 coverage in > > drivers/android/binder.c: > > https://storage.googleapis.com/syzkal

Re: binderfs interferes with syzkaller?

2020-01-26 Thread Christian Brauner
On Sun, Jan 26, 2020 at 09:55:35AM +0100, Greg Kroah-Hartman wrote: > On Sat, Jan 25, 2020 at 06:49:49PM +0100, Dmitry Vyukov wrote: > > Hi binder maintainers, > > > > It seems that something has happened and now syzbot has 0 coverage in > > drivers/android/binder.c: > > https://storage.googleapis

Re: [PATCH 2/3] binder: Prevent repeated use of ->mmap() via NULL mapping

2019-10-19 Thread Christian Brauner
ping address to > distinguish the mapped case. A valid VMA can't have size zero. > > Fixes: 880211667b20 ("binder: remove kernel vm_area for buffer space") > Cc: sta...@vger.kernel.org > Signed-off-by: Jann Horn Acked-by: Christian Brauner __

Re: [PATCH 3/3] binder: Handle start==NULL in binder_update_page_range()

2019-10-19 Thread Christian Brauner
ng to free_range instead), and > both loops would look nicer if they just iterated upwards through indices. > And the up_read()+mmput() shouldn't be duplicated like that. > > Cc: sta...@vger.kernel.org > Fixes: 457b9a6f09f0 ("Staging: android: add bind

Re: [PATCH 1/3] binder: Fix race between mmap() and binder_alloc_print_pages()

2019-10-19 Thread Christian Brauner
binder_alloc_mmap_handler() paired with a smp_rmb() in binder_alloc_get_vma(). That makes sense to me. Acked-by: Christian Brauner ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] binder: Remove incorrect comment about vm_insert_page() behavior

2019-10-18 Thread Christian Brauner
> Signed-off-by: Jann Horn Seems this has always been the case since its introduction: a145dd411eb2 ("VM: add "vm_insert_page()" function") Acked-by: Christian Brauner ___ devel mailing list de...@linuxdriverproject.org ht

Re: [PATCH 1/2] binder: Don't modify VMA bounds in ->mmap handler

2019-10-16 Thread Christian Brauner
UL); > *(char*)data_mapping = 1; > return 0; > } > > Cc: sta...@vger.kernel.org > Signed-off-by: Jann Horn Hm, aerc kept crashing for me so I'm not sure whether or not prior messages made it so sorry if this arrives multiple times. Acked-by:

Re: [PATCH 2/2] binder: Use common definition of SZ_1K

2019-10-16 Thread Christian Brauner
On Wed Oct 16, 2019 at 5:01 PM Jann Horn wrote: > SZ_1K has been defined in include/linux/sizes.h since v3.6. Get rid of the > duplicate definition. > > Signed-off-by: Jann Horn Acked-by: Christian Brauner ___ devel mai

Re: [PATCH] binder: prevent UAF read in print_binder_transaction_log_entry()

2019-10-09 Thread Christian Brauner
On Wed, Oct 09, 2019 at 10:55:58AM -0400, Joel Fernandes wrote: > On Wed, Oct 09, 2019 at 04:29:11PM +0200, Christian Brauner wrote: > > On Wed, Oct 09, 2019 at 10:21:29AM -0400, Joel Fernandes wrote: > > > On Wed, Oct 09, 2019 at 12:40:12PM +0200, Christian Brauner wrote: >

Re: [PATCH] binder: prevent UAF read in print_binder_transaction_log_entry()

2019-10-09 Thread Christian Brauner
On Wed, Oct 09, 2019 at 10:21:29AM -0400, Joel Fernandes wrote: > On Wed, Oct 09, 2019 at 12:40:12PM +0200, Christian Brauner wrote: > > On Tue, Oct 08, 2019 at 02:05:16PM -0400, Joel Fernandes wrote: > > > On Tue, Oct 08, 2019 at 03:01:59PM +0200, Christian Brauner wrote: >

Re: [PATCH] binder: prevent UAF read in print_binder_transaction_log_entry()

2019-10-09 Thread Christian Brauner
On Tue, Oct 08, 2019 at 02:05:16PM -0400, Joel Fernandes wrote: > On Tue, Oct 08, 2019 at 03:01:59PM +0200, Christian Brauner wrote: > > When a binder transaction is initiated on a binder device coming from a > > binderfs instance, a pointer to the name of the binder device is sta

[PATCH] binder: prevent UAF read in print_binder_transaction_log_entry()

2019-10-08 Thread Christian Brauner
Fixes: 03e2e07e3814 ("binder: Make transaction_log available in binderfs") Link: https://lore.kernel.org/r/cag48ez14q0-f8lqsvcnbyr2o6gpw8shxsm4u5jmd9mpstem...@mail.gmail.com Cc: Joel Fernandes Cc: Todd Kjos Cc: Hridya Valsaraju Signed-off-by: Christian Brauner --- drivers/android/binder

Re: UAF read in print_binder_transaction_log_entry() on ANDROID_BINDERFS kernels

2019-10-07 Thread Christian Brauner
On Mon, Oct 07, 2019 at 10:49:57PM +0200, Jann Horn wrote: > Hi! > > There is a use-after-free read in print_binder_transaction_log_entry() > on ANDROID_BINDERFS kernels because > print_binder_transaction_log_entry() prints the char* e->context_name > as string, and if the transaction occurred on

Re: [PATCH] binder: Fix comment headers on binder_alloc_prepare_to_free()

2019-09-30 Thread Christian Brauner
On Mon, Sep 30, 2019 at 04:12:50PM -0400, Joel Fernandes wrote: > binder_alloc_buffer_lookup() doesn't exist and is named > "binder_alloc_prepare_to_free()". Correct the code comments to reflect > this. > > Signed-off-by: Joel Fernandes (Google)

Re: [PATCH v3 0/4] Add binder state and statistics to binderfs

2019-09-27 Thread Christian Brauner
On Tue, Sep 03, 2019 at 09:16:51AM -0700, Hridya Valsaraju wrote: > Currently, the only way to access binder state and > statistics is through debugfs. We need a way to > access the same even when debugfs is not mounted. > These patches add a mount option to make this > information available in bin

Re: [PATCH v3 0/4] Add binder state and statistics to binderfs

2019-09-04 Thread Christian Brauner
On Wed, Sep 04, 2019 at 04:49:03PM +0200, Greg Kroah-Hartman wrote: > On Wed, Sep 04, 2019 at 10:20:32AM -0400, Joel Fernandes wrote: > > On September 4, 2019 7:19:35 AM EDT, Christian Brauner > > wrote: > > >On Tue, Sep 03, 2019 at 09:16:51AM -0700, Hridya Valsaraju wrot

Re: [PATCH v3 0/4] Add binder state and statistics to binderfs

2019-09-04 Thread Christian Brauner
og > /sys/kernel/debug/binder/proc > /sys/kernel/debug/binder/state > /sys/kernel/debug/binder/stats > /sys/kernel/debug/binder/transaction_log > /sys/kernel/debug/binder/transactions Acked-by: Christian Brauner Btw, I think your counting is off-by-one. :) We usually count the

[RESEND PATCH v3 1/2] binder: Add default binder devices through binderfs when configured

2019-09-04 Thread Christian Brauner
-developed-by: Christian Brauner Signed-off-by: Christian Brauner Signed-off-by: Hridya Valsaraju Reviewed-by: Joel Fernandes (Google) Link: https://lore.kernel.org/r/20190808222727.132744-2-hri...@google.com --- drivers/android/binder.c | 5 +++-- drivers/android/binder_internal.h | 2

[RESEND PATCH v3 0/2] Add default binderfs devices

2019-09-04 Thread Christian Brauner
Hey, This is a resend of Hridya's series to add default binderfs devices. No semantical changes were made. Only Joel's Acks were added by me. Binderfs was created to help provide private binder devices to containers in their own IPC namespace. Currently, every time a new binderfs instance is moun

Re: [PATCH v3 2/2] binder: Validate the default binderfs device names.

2019-09-04 Thread Christian Brauner
On Wed, Sep 04, 2019 at 12:49:39PM +0200, Greg Kroah-Hartman wrote: > On Wed, Sep 04, 2019 at 12:44:32PM +0200, Christian Brauner wrote: > > On Wed, Sep 04, 2019 at 09:19:29AM +0200, Greg Kroah-Hartman wrote: > > > On Fri, Aug 09, 2019 at 11:41:12AM -0700, Hridya Valsaraju wro

[RESEND PATCH v3 2/2] binder: Validate the default binderfs device names.

2019-09-04 Thread Christian Brauner
From: Hridya Valsaraju Length of a binderfs device name cannot exceed BINDERFS_MAX_NAME. This patch adds a check in binderfs_init() to ensure the same for the default binder devices that will be created in every binderfs instance. Co-developed-by: Christian Brauner Signed-off-by: Christian

Re: [PATCH v3 2/2] binder: Validate the default binderfs device names.

2019-09-04 Thread Christian Brauner
On Wed, Sep 04, 2019 at 09:19:29AM +0200, Greg Kroah-Hartman wrote: > On Fri, Aug 09, 2019 at 11:41:12AM -0700, Hridya Valsaraju wrote: > > On Fri, Aug 9, 2019 at 11:14 AM Christian Brauner > > wrote: > > > > > > On Fri, Aug 09, 2019 at 04:55:08PM +0200, Greg Kr

Re: [PATCH] binder: Use kmem_cache for binder_thread

2019-08-30 Thread Christian Brauner
On Fri, Aug 30, 2019 at 08:38:51AM +0200, Greg KH wrote: > On Thu, Aug 29, 2019 at 05:27:22PM +0200, Christian Brauner wrote: > > On Thu, Aug 29, 2019 at 09:53:59AM -0400, Joel Fernandes wrote: > > > On Thu, Aug 29, 2019 at 08:42:29AM +0200, Greg KH wrote: > > > >

Re: [PATCH v2 4/4] binder: Add binder_proc logging to binderfs

2019-08-30 Thread Christian Brauner
this file when debugfs > is not mounted. > > Signed-off-by: Hridya Valsaraju Same as for the previous patch: Please keep my Acked-by if you don't change this patch when you send out a new version. Acked-by: Christian Brauner > --- > > Changes in v2: > - Consistent var

Re: [PATCH v2 3/4] binder: Make transaction_log available in binderfs

2019-08-30 Thread Christian Brauner
ridya Valsaraju (If you don't change this patch in the next version, please just keep my: Acked-by: Christian Brauner when sending it out. :) > --- > > Changes in v2: > -Consistent variable naming accross functions as per Christian Brauner. > > dr

Re: [PATCH v2 2/4] binder: Add stats, state and transactions files

2019-08-30 Thread Christian Brauner
gs/stats > /dev/binderfs/binder_logs/transactions > > This provides a way to access them even when debugfs is not mounted. > > Signed-off-by: Hridya Valsaraju Just two comments below. If you have addressed them you can add my: Acked-by: Christian Brauner > --- > >

Re: [PATCH] binder: Use kmem_cache for binder_thread

2019-08-29 Thread Christian Brauner
On Thu, Aug 29, 2019 at 09:53:59AM -0400, Joel Fernandes wrote: > On Thu, Aug 29, 2019 at 08:42:29AM +0200, Greg KH wrote: > > On Thu, Aug 29, 2019 at 01:49:53PM +0800, Peikan Tsai wrote: > [snip] > > > The allocated size for each binder_thread is 512 bytes by kzalloc. > > > Because the size of bi

Re: [PATCH 4/4] binder: Add binder_proc logging to binderfs

2019-08-28 Thread Christian Brauner
this file when debugfs > is not mounted. > > Signed-off-by: Hridya Valsaraju I'm still wondering whether there's a nicer way to create those debuf files per-process without doing it in binder_open() but it has worked fine for a long time with debugfs. Also, one minor question below

Re: [PATCH 3/4] binder: Make transaction_log available in binderfs

2019-08-28 Thread Christian Brauner
v/binderfs, the location of > these files will be as follows: > > /dev/binderfs/binder_logs/failed_transaction_log > /dev/binderfs/binder_logs/transaction_log > > This change provides an alternate option to access these files when > debugfs is not mounted. > > Signed-off

Re: [PATCH 2/4] binder: Add stats, state and transactions files

2019-08-28 Thread Christian Brauner
On Tue, Aug 27, 2019 at 01:41:50PM -0700, Hridya Valsaraju wrote: > The following binder stat files currently live in debugfs. > > /sys/kernel/debug/binder/state > /sys/kernel/debug/binder/stats > /sys/kernel/debug/binder/transactions > > This patch makes these files available in a binderfs insta

Re: [PATCH 1/4] binder: add a mount option to show global stats

2019-08-28 Thread Christian Brauner
On Wed, Aug 28, 2019 at 11:22:37AM +0200, Greg Kroah-Hartman wrote: > On Tue, Aug 27, 2019 at 01:41:49PM -0700, Hridya Valsaraju wrote: > > Currently, all binder state and statistics live in debugfs. > > We need this information even when debugfs is not mounted. > > This patch adds the mount option

Re: [PATCH v3 2/2] binder: Validate the default binderfs device names.

2019-08-09 Thread Christian Brauner
or the default binder devices that will be created in every > > binderfs instance. > > > > Co-developed-by: Christian Brauner > > Signed-off-by: Christian Brauner > > Signed-off-by: Hridya Valsaraju > > --- > > drivers/android/binderfs.c | 12 +

Re: [PATCH v3 1/2] binder: Add default binder devices through binderfs when configured

2019-08-09 Thread Christian Brauner
On Fri, Aug 09, 2019 at 04:50:16PM +0200, Greg Kroah-Hartman wrote: > On Thu, Aug 08, 2019 at 03:27:25PM -0700, Hridya Valsaraju wrote: > > Currently, since each binderfs instance needs its own > > private binder devices, every time a binderfs instance is > > mounted, all the default binder devices

Re: [PATCH v2 1/2] binder: Add default binder devices through binderfs when configured

2019-08-07 Thread Christian Brauner
On Wed, Aug 07, 2019 at 02:02:05PM +0300, Dan Carpenter wrote: > On Tue, Aug 06, 2019 at 11:40:05AM -0700, Hridya Valsaraju wrote: > > @@ -467,6 +466,9 @@ static int binderfs_fill_super(struct super_block *sb, > > void *data, int silent) > > int ret; > > struct binderfs_info *info; > >

Re: [PATCH] Add default binder devices through binderfs when configured

2019-08-02 Thread Christian Brauner
erfs instance instead of global devices being created by > > the binder driver. > > > > Co-developed-by: Christian Brauner > > Signed-off-by: Christian Brauner > > Signed-off-by: Hridya Valsaraju > > --- > > drivers/a

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

2019-05-07 Thread Christian Brauner
On Tue, May 07, 2019 at 09:28:47AM -0700, Suren Baghdasaryan wrote: > From: Christian Brauner > Date: Tue, May 7, 2019 at 3:58 AM > To: Sultan Alsawaf > Cc: Greg Kroah-Hartman, open list:ANDROID DRIVERS, Daniel Colascione, > Todd Kjos, Kees Cook, Peter Zijlstra, Martijn Coenen, LKM

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 those

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: 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-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 do

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 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: 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: [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 exclusivel

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-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-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-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-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: [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 > > > aft

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 some

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: > > > &

[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

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] 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: [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 promised

[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|

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

2019-01-23 Thread Christian Brauner
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

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 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-of

[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/in

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

2019-01-21 Thread Christian Brauner
eturn 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/an

[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 --- /* Chan

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

2019-01-21 Thread Christian Brauner
ction down 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 in

[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/de

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

2019-01-21 Thread Christian Brauner
1 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

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

2019-01-21 Thread Christian Brauner
up 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() --- drive

  1   2   >