[PATCH 2/2] binder: tell userspace to dump current backtrace when detected oneway spamming

2021-04-09 Thread Hang Lu
is responsible for either more than 50 transactions, or more than 50% of the oneway space). And the detection will restart when the async buffer has returned to a healthy state. Signed-off-by: Hang Lu --- drivers/android/binder.c| 27 --- drivers/android

[PATCH 0/2] binder: tell userspace to dump current backtrace when detected oneway spamming

2021-04-09 Thread Hang Lu
Add feature for binder oneway spamming detection, which tells userspace to dump current backtrace. Fix the missing "BR_FROZEN_REPLY" issue first, then features. Hang Lu (2): binder: fix the missing BR_FROZEN_REPLY in binder_return_strings binder: tell userspace to dump current back

[PATCH 1/2] binder: fix the missing BR_FROZEN_REPLY in binder_return_strings

2021-04-09 Thread Hang Lu
Add BR_FROZEN_REPLY in binder_return_strings to support stat function. Fixes: ae28c1be1e54 ("binder: BINDER_GET_FROZEN_INFO ioctl") Signed-off-by: Hang Lu --- drivers/android/binder.c | 3 ++- drivers/android/binder_internal.h | 2 +- 2 files changed, 3 insertions(+), 2

Re: [PATCH v4] binder: tell userspace to dump current backtrace when detected oneway spamming

2021-04-09 Thread Hang Lu
On 4/9/2021 2:08 PM, Greg KH wrote: > On Fri, Apr 09, 2021 at 11:40:57AM +0800, Hang Lu wrote: >> When async binder buffer got exhausted, some normal oneway transactions >> will also be discarded and may cause system or application failures. By >> that time, the binder debu

[PATCH v4] binder: tell userspace to dump current backtrace when detected oneway spamming

2021-04-08 Thread Hang Lu
is responsible for either more than 50 transactions, or more than 50% of the oneway space). And the detection will restart when the async buffer has returned to a healthy state. Signed-off-by: Hang Lu --- v4: add missing BR_FROZEN_REPLY in binder_return_strings and change the size of binder_stats.br

[PATCH v4] binder: tell userspace to dump current backtrace when detecting oneway spamming

2021-04-06 Thread Hang Lu
is responsible for either more than 50 transactions, or more than 50% of the oneway space). And the detection will restart when the async buffer has returned to a healthy state. Signed-off-by: Hang Lu --- v4: add placeholder for BR_FROZEN_REPLY in binder_return_strings for not triggering BUG_ON

[PATCH v3] binder: tell userspace to dump current backtrace when detecting oneway spamming

2021-04-06 Thread Hang Lu
is responsible for either more than 50 transactions, or more than 50% of the oneway space). And the detection will restart when the async buffer has returned to a healthy state. Signed-off-by: Hang Lu --- v3: add BR_ONEWAY_SPAM_SUSPECT to binder_return_strings v2: make the detection on/off switch

[PATCH v2] binder: tell userspace to dump current backtrace when detecting oneway spamming

2021-04-01 Thread Hang Lu
than 50 transactions, or more than 50% of the oneway space). And the detection will restart when the async buffer has returned to a healthy state. Signed-off-by: Hang Lu --- v2: make the detection on/off switch to be per-proc drivers/android/binder.c| 26

Re: [PATCH] binder: tell userspace to dump current backtrace when detecting oneway spamming

2021-04-01 Thread Hang Lu
On 3/31/2021 3:44 PM, Greg KH wrote: > On Wed, Mar 31, 2021 at 03:34:16PM +0800, Hang Lu wrote: >> When async binder buffer got exhausted, some normal oneway transaction >> will also be discarded and finally caused system/app stop. By that time, >> the binder debug in

[PATCH] binder: tell userspace to dump current backtrace when detecting oneway spamming

2021-03-31 Thread Hang Lu
than 50 transactions, or more than 50% of the oneway space). And the detection will restart when the async buffer has returned to a healthy state. Signed-off-by: Hang Lu --- drivers/android/binder.c| 25 ++--- drivers/android/binder_alloc.c | 15