[PATCH] ath10k: Fix ath10k_wmi_tlv_op_pull_peer_stats_info() unlock without lock

2021-04-06 Thread Shuah Khan
_by_ifaddr()") Reported-by: Pavel Machek Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index d97b33f789e4..7efbe03fbc

Re: [PATCH v3 0/3] Add lockdep_assert_not_held()

2021-03-01 Thread Shuah Khan
On 3/1/21 4:02 AM, Kalle Valo wrote: Peter Zijlstra writes: On Mon, Mar 01, 2021 at 10:45:32AM +0200, Kalle Valo wrote: Peter Zijlstra writes: On Fri, Feb 26, 2021 at 05:06:57PM -0700, Shuah Khan wrote: Shuah Khan (3): lockdep: add lockdep_assert_not_held() lockdep: add lockdep

[PATCH v3 2/3] lockdep: add lockdep lock state defines

2021-02-26 Thread Shuah Khan
) and __lock_is_held() to use the new defines. Link: https://lore.kernel.org/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.sk...@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Signed-off-by: Shuah Khan --- include/linux/lockdep.h

[PATCH v3 3/3] ath10k: detect conf_mutex held ath10k_drain_tx() calls

2021-02-26 Thread Shuah Khan
://lore.kernel.org/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.sk...@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Acked-by: Kalle Valo Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/mac.c | 2 ++ 1 file changed, 2 insertions

[PATCH v3 0/3] Add lockdep_assert_not_held()

2021-02-26 Thread Shuah Khan
s the new interface in ath10k_drain_tx() function. Added Kalle Valo's Ack from v1 for this change. Tested on the mainline from yesterday. Shuah Khan (3): lockdep: add lockdep_assert_not_held() lockdep: add lockdep lock state defines ath10k: detect conf_mutex held ath10k_drain_tx() calls

[PATCH v3 1/3] lockdep: add lockdep_assert_not_held()

2021-02-26 Thread Shuah Khan
lockdep_assert_not_held(). Link: https://lore.kernel.org/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.sk...@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Signed-off-by: Shuah Khan --- include/linux/lockdep.h | 11 --- kernel

Re: [PATCH v2 1/3] lockdep: add lockdep_assert_not_held()

2021-02-26 Thread Shuah Khan
On 2/26/21 2:07 PM, Peter Zijlstra wrote: On Fri, Feb 26, 2021 at 10:52:13AM -0700, Shuah Khan wrote: + /* avoid false negative lockdep_assert_not_held() +* and lockdep_assert_held() +*/ That's a coding style fail. Checkpatch didn'

Re: [PATCH v2 2/3] lockdep: add lockdep lock state defines

2021-02-26 Thread Shuah Khan
On 2/26/21 11:03 AM, Johannes Berg wrote: @@ -5475,7 +5476,7 @@ noinstr int lock_is_held_type(const struct lockdep_map *lock, int read) /* avoid false negative lockdep_assert_not_held() * and lockdep_assert_held() */ - return -1;

Re: [PATCH 5/5] ath10k: reduce invalid ht params rate message noise

2021-02-26 Thread Shuah Khan
On 2/11/21 4:24 AM, Kalle Valo wrote: Shuah Khan writes: On 2/10/21 1:28 AM, Kalle Valo wrote: Wen Gong writes: On 2021-02-10 08:42, Shuah Khan wrote: ath10k_mac_get_rate_flags_ht() floods dmesg with the following messages, when it fails to find a match for mcs=7 and rate=1440

[PATCH v2 3/3] ath10k: detect conf_mutex held ath10k_drain_tx() calls

2021-02-26 Thread Shuah Khan
://lore.kernel.org/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.sk...@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Acked-by: Kalle Valo Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/mac.c | 2 ++ 1 file changed, 2 insertions

[PATCH v2 2/3] lockdep: add lockdep lock state defines

2021-02-26 Thread Shuah Khan
/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.sk...@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Signed-off-by: Shuah Khan --- include/linux/lockdep.h | 11 +-- kernel/locking/lockdep.c | 3 ++- 2 files changed, 11 inser

[PATCH v2 1/3] lockdep: add lockdep_assert_not_held()

2021-02-26 Thread Shuah Khan
lockdep_assert_not_held(). Link: https://lore.kernel.org/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.sk...@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Signed-off-by: Shuah Khan --- include/linux/lockdep.h | 11 --- kernel

[PATCH v2 0/3] Add lockdep_assert_not_held()

2021-02-26 Thread Shuah Khan
from yesterday. Shuah Khan (3): lockdep: add lockdep_assert_not_held() lockdep: add lockdep lock state defines ath10k: detect conf_mutex held ath10k_drain_tx() calls drivers/net/wireless/ath/ath10k/mac.c | 2 ++ include/linux/lockdep.h | 18 +++--- kernel/loc

Re: [PATCH 1/2] lockdep: add lockdep_assert_not_held()

2021-02-22 Thread Shuah Khan
On 2/15/21 9:10 AM, Johannes Berg wrote: On Mon, 2021-02-15 at 17:04 +0100, Peter Zijlstra wrote: On Mon, Feb 15, 2021 at 02:12:30PM +0100, Johannes Berg wrote: On Mon, 2021-02-15 at 11:44 +0100, Peter Zijlstra wrote: I think something like so will work, but please double check. Yeah, that l

Re: [PATCH 00/20] Manual replacement of all strlcpy in favor of strscpy

2021-02-22 Thread Shuah Khan
On 2/22/21 8:12 AM, Romain Perier wrote: strlcpy() copy a C-String into a sized buffer, the result is always a valid NULL-terminated that fits in the buffer, howerver it has severals issues. It reads the source buffer first, which is dangerous if it is non NULL-terminated or if the corresponding

Re: [PATCH] Revert "ath9k: fix ath_tx_process_buffer() potential null ptr dereference"

2021-02-18 Thread Shuah Khan
On 2/17/21 11:23 PM, Kalle Valo wrote: Shuah Khan wrote: This reverts commit a56c14bb21b296fb6d395164ab62ef2e419e5069. ath_tx_process_buffer() doesn't dereference or check sta and passes it to ath_tx_complete_aggr() and ath_tx_complete_buf(). ath_tx_complete_aggr() checks the pointer b

[PATCH] Revert "ath9k: fix ath_tx_process_buffer() potential null ptr dereference"

2021-02-17 Thread Shuah Khan
g buffer completion if the pointer (sta) is NULL. Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath9k/xmit.c | 28 --- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k

Re: [PATCH 2/2] ath9k: fix ath_tx_process_buffer() potential null ptr dereference

2021-02-17 Thread Shuah Khan
On 2/17/21 7:56 AM, Shuah Khan wrote: On 2/17/21 12:30 AM, Kalle Valo wrote: Shuah Khan writes: On 2/16/21 12:53 AM, Felix Fietkau wrote: On 2021-02-16 08:03, Kalle Valo wrote: Shuah Khan wrote: ath_tx_process_buffer() references ieee80211_find_sta_by_ifaddr() return pointer (sta

Re: [PATCH 2/2] ath9k: fix ath_tx_process_buffer() potential null ptr dereference

2021-02-17 Thread Shuah Khan
On 2/17/21 12:30 AM, Kalle Valo wrote: Shuah Khan writes: On 2/16/21 12:53 AM, Felix Fietkau wrote: On 2021-02-16 08:03, Kalle Valo wrote: Shuah Khan wrote: ath_tx_process_buffer() references ieee80211_find_sta_by_ifaddr() return pointer (sta) outside null check. Fix it by moving the

Re: [PATCH 2/2] ath9k: fix ath_tx_process_buffer() potential null ptr dereference

2021-02-16 Thread Shuah Khan
On 2/16/21 12:53 AM, Felix Fietkau wrote: On 2021-02-16 08:03, Kalle Valo wrote: Shuah Khan wrote: ath_tx_process_buffer() references ieee80211_find_sta_by_ifaddr() return pointer (sta) outside null check. Fix it by moving the code block under the null check. This problem was found while

[PATCH 2/2] ath10k: detect conf_mutex held ath10k_drain_tx() calls

2021-02-12 Thread Shuah Khan
://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/mac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index c202b167d8c6..7de05b679ad2 100644 --- a

[PATCH 0/2] Add lockdep_assert_not_held()

2021-02-12 Thread Shuah Khan
the second patch in ath10k_drain_tx() function. Shuah Khan (2): lockdep: add lockdep_assert_not_held() ath10k: detect conf_mutex held ath10k_drain_tx() calls drivers/net/wireless/ath/ath10k/mac.c | 2 ++ include/linux/lockdep.h | 7 ++- 2 files changed, 8 insertions(+), 1

[PATCH 1/2] lockdep: add lockdep_assert_not_held()

2021-02-12 Thread Shuah Khan
lockdep_assert_not_held() came up in a discussion on ath10k patch. ath10k_drain_tx() and i915_vma_pin_ww() are examples of functions that can use lockdep_assert_not_held(). Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Signed-off-by: Shuah Khan --- include/linux/lockdep.h | 7

Re: [PATCH] mt76: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()

2021-02-12 Thread Shuah Khan
On 2/11/21 10:36 PM, Felix Fietkau wrote: On 2021-02-12 03:13, Shuah Khan wrote: ieee80211_find_sta_by_ifaddr() must be called under the RCU lock and the resulting pointer is only valid under RCU lock as well. Fix mt76_check_sta() to hold RCU read lock before it calls

[PATCH 2/2] ath9k: fix ath_tx_process_buffer() potential null ptr dereference

2021-02-11 Thread Shuah Khan
of other callers of ieee80211_find_sta_by_ifaddr() that don't hold RCU read lock. Signed-off-by: Shuah Khan --- - Note: This patch is compile tested. I don't have access to hardware. drivers/net/wireless/ath/ath9k/xmit.c | 28 +++ 1 file changed, 16 inserti

[PATCH] rtw88: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()

2021-02-11 Thread Shuah Khan
problem was found while reviewing code to debug RCU warn from ath10k_wmi_tlv_parse_peer_stats_info() and a subsequent manual audit of other callers of ieee80211_find_sta_by_ifaddr() that don't hold RCU read lock. Signed-off-by: Shuah Khan --- - Note: This patch is compile tested. I don&#

[PATCH 1/2] ath9k: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()

2021-02-11 Thread Shuah Khan
problem was found while reviewing code to debug RCU warn from ath10k_wmi_tlv_parse_peer_stats_info() and a subsequent manual audit of other callers of ieee80211_find_sta_by_ifaddr() that don't hold RCU read lock. Signed-off-by: Shuah Khan --- - Note: This patch is compile tested. I don't h

[PATCH] mt76: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()

2021-02-11 Thread Shuah Khan
was found while reviewing code to debug RCU warn from ath10k_wmi_tlv_parse_peer_stats_info() and a subsequent manual audit of other callers of ieee80211_find_sta_by_ifaddr() that don't hold RCU read lock. Signed-off-by: Shuah Khan --- - Note: This patch is compile tested. I don't have

Re: [PATCH 4/5] ath10k: detect conf_mutex held ath10k_drain_tx() calls

2021-02-11 Thread Shuah Khan
On 2/11/21 4:20 AM, Kalle Valo wrote: Shuah Khan writes: On 2/10/21 1:25 AM, Kalle Valo wrote: Shuah Khan writes: ath10k_drain_tx() must not be called with conf_mutex held as workers can use that also. Add check to detect conf_mutex held calls. Signed-off-by: Shuah Khan The commit log

[PATCH v2] ath10k: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()

2021-02-10 Thread Shuah Khan
needed. This problem was found while reviewing code to debug RCU warn from ath10k_wmi_tlv_parse_peer_stats_info(). Link: https://lore.kernel.org/linux-wireless/7230c9e5-2632-b77e-c4f9-10eca557a...@linuxfoundation.org/ Signed-off-by: Shuah Khan --- Changes since v1: - v1 also included fix to

Re: [PATCH 2/5] ath10k: fix WARNING: suspicious RCU usage

2021-02-10 Thread Shuah Khan
On 2/10/21 1:13 AM, Kalle Valo wrote: Shuah Khan wrote: ieee80211_find_sta_by_ifaddr() must be called under the RCU lock and the resulting pointer is only valid under RCU lock as well. Fix ath10k_wmi_tlv_parse_peer_stats_info() to hold RCU lock before it calls ieee80211_find_sta_by_ifaddr

Re: [PATCH 1/5] ath10k: fix conf_mutex lock assert in ath10k_debug_fw_stats_request()

2021-02-10 Thread Shuah Khan
On 2/10/21 1:09 AM, Kalle Valo wrote: Shuah Khan wrote: ath10k_debug_fw_stats_request() is called ath10k_sta_statistics() without holding conf_mutex. ath10k_debug_fw_stats_request() simply returns when CONFIG_ATH10K_DEBUGFS is disabled. When CONFIG_ATH10K_DEBUGFS is enabled

Re: [PATCH 5/5] ath10k: reduce invalid ht params rate message noise

2021-02-10 Thread Shuah Khan
On 2/10/21 1:28 AM, Kalle Valo wrote: Wen Gong writes: On 2021-02-10 08:42, Shuah Khan wrote: ath10k_mac_get_rate_flags_ht() floods dmesg with the following messages, when it fails to find a match for mcs=7 and rate=1440. supported_ht_mcs_rate_nss2: {7, {1300, 2700, 1444, 3000

Re: [PATCH 4/5] ath10k: detect conf_mutex held ath10k_drain_tx() calls

2021-02-10 Thread Shuah Khan
On 2/10/21 1:25 AM, Kalle Valo wrote: Shuah Khan writes: ath10k_drain_tx() must not be called with conf_mutex held as workers can use that also. Add check to detect conf_mutex held calls. Signed-off-by: Shuah Khan The commit log does not answer to "Why?". How did you find

[PATCH 5/5] ath10k: reduce invalid ht params rate message noise

2021-02-09 Thread Shuah Khan
x27;t helping the noise. Use dev_warn_once() instead. Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/mac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 3545ce7dce0a..276321f

[PATCH 4/5] ath10k: detect conf_mutex held ath10k_drain_tx() calls

2021-02-09 Thread Shuah Khan
ath10k_drain_tx() must not be called with conf_mutex held as workers can use that also. Add check to detect conf_mutex held calls. Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/mac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b

[PATCH 2/5] ath10k: fix WARNING: suspicious RCU usage

2021-02-09 Thread Shuah Khan
+0x22/0x30 Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 7b5834157fe5..615157dd6866 100644

[PATCH 3/5] ath10k: change ath10k_offchan_tx_work() peer present msg to a warn

2021-02-09 Thread Shuah Khan
Based on the comment block in this function and the FIXME for this, peer being present for the offchannel tx is unlikely. Peer is deleted once tx is complete. Change peer present msg to a warn to detect this condition. Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/mac.c | 5

[PATCH 1/5] ath10k: fix conf_mutex lock assert in ath10k_debug_fw_stats_request()

2021-02-09 Thread Shuah Khan
nabled at (520903): [] console_unlock+0x4e5/0x5d0 hardirqs last disabled at (520908): [] console_unlock+0x458/0x5d0 softirqs last enabled at (520722): [] asm_call_irq_on_stack+0x12/0x20 softirqs last disabled at (520717): [] asm_call_irq_on_stack+0x12/0x20 Signed-off-by: Shuah Khan --- drivers/net/wireless/ath

[PATCH 0/5] ath10k fixes for warns

2021-02-09 Thread Shuah Khan
and RCU usage bugs. The last patch (5/5) is a fix to reduce invalid ht params rate message noise. Patch 3/4 changes a message from debug to warn. Patch 4 adds detect to assert not calling ath10k_drain_tx() holding conf_mutex. Shuah Khan (5): ath10k: fix conf_mutex lock assert in

Re: rpc_xprt_debugfs_register() - atomic_inc_return() usage

2021-01-21 Thread Shuah Khan
On 1/21/21 10:56 AM, Trond Myklebust wrote: On Wed, 2021-01-20 at 16:52 -0700, Shuah Khan wrote: Hi Anna and Trond, I came across the following while reviewing atomic_inc_return() usages that cast return value to unsigned rpc_xprt_debugfs_register()'s atomic_inc_return() usage looks a bi

rpc_xprt_debugfs_register() - atomic_inc_return() usage

2021-01-20 Thread Shuah Khan
Hi Anna and Trond, I came across the following while reviewing atomic_inc_return() usages that cast return value to unsigned rpc_xprt_debugfs_register()'s atomic_inc_return() usage looks a bit odd. - cur_id isn't initialized - id = (unsigned int)atomic_inc_return(&cur_id); Please note that id

Re: [PATCH] selftests: Skip BPF seftests by default

2020-12-17 Thread Shuah Khan
On 12/17/20 8:53 AM, Shuah Khan wrote: On 12/17/20 6:07 AM, Mark Brown wrote: On Wed, Dec 16, 2020 at 04:05:58PM -0600, Seth Forshee wrote: On Thu, Dec 10, 2020 at 06:52:33PM +, Mark Brown wrote: as part of the wider kselftest build by specifying SKIP_TARGETS, including setting an empty

Re: [PATCH] selftests: Skip BPF seftests by default

2020-12-17 Thread Shuah Khan
On 12/17/20 6:07 AM, Mark Brown wrote: On Wed, Dec 16, 2020 at 04:05:58PM -0600, Seth Forshee wrote: On Thu, Dec 10, 2020 at 06:52:33PM +, Mark Brown wrote: as part of the wider kselftest build by specifying SKIP_TARGETS, including setting an empty SKIP_TARGETS to build everything. They

Re: [PATCH] selftests: Skip BPF seftests by default

2020-12-10 Thread Shuah Khan
On 12/10/20 12:11 PM, Alexei Starovoitov wrote: On Thu, Dec 10, 2020 at 06:52:33PM +, Mark Brown wrote: The BPF selftests have build time dependencies on cutting edge versions of tools in the BPF ecosystem including LLVM which are more involved to satisfy than more typical requirements like

Re: [PATCH v12 5/5] selftest: mhi: Add support to test MHI LOOPBACK channel

2020-11-20 Thread Shuah Khan
On 11/16/20 3:46 PM, Hemant Kumar wrote: Loopback test opens the MHI device file node and writes a data buffer to it. MHI UCI kernel space driver copies the data and sends it to MHI uplink (Tx) LOOPBACK channel. MHI device loops back the same data to MHI downlink (Rx) LOOPBACK channel. This data

Re: Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
On 9/24/19 1:19 PM, Daniel Borkmann wrote: On Tue, Sep 24, 2019 at 12:56:53PM -0600, Shuah Khan wrote: On 9/24/19 12:49 PM, Daniel Borkmann wrote: On Tue, Sep 24, 2019 at 09:48:35AM -0600, Shuah Khan wrote: On 9/24/19 9:43 AM, Yonghong Song wrote: On 9/24/19 8:26 AM, Shuah Khan wrote: Hi

Re: Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
On 9/24/19 12:49 PM, Daniel Borkmann wrote: On Tue, Sep 24, 2019 at 09:48:35AM -0600, Shuah Khan wrote: On 9/24/19 9:43 AM, Yonghong Song wrote: On 9/24/19 8:26 AM, Shuah Khan wrote: Hi Alexei and Daniel, bpf test doesn't build on Linux 5.4 mainline. Do you know what's happening h

Re: Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
On 9/24/19 12:07 PM, tim.b...@sony.com wrote: -Original Message- From: Cristian Marussi on Tuesday, September 24, 2019 7:30 AM Hi Shuah On 24/09/2019 17:39, Shuah Khan wrote: On 9/24/19 10:03 AM, Shuah Khan wrote: On 9/24/19 9:52 AM, Cristian Marussi wrote: Hi Shuah On 24/09

Re: Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
On 9/24/19 10:03 AM, Shuah Khan wrote: On 9/24/19 9:52 AM, Cristian Marussi wrote: Hi Shuah On 24/09/2019 16:26, Shuah Khan wrote: Hi Alexei and Daniel, bpf test doesn't build on Linux 5.4 mainline. Do you know what's happening here. make -C tools/testing/selftests/bpf/ sid

Re: Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
On 9/24/19 9:52 AM, Cristian Marussi wrote: Hi Shuah On 24/09/2019 16:26, Shuah Khan wrote: Hi Alexei and Daniel, bpf test doesn't build on Linux 5.4 mainline. Do you know what's happening here. make -C tools/testing/selftests/bpf/ side question, since I'm writing arm64/ te

Re: Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
On 9/24/19 9:43 AM, Yonghong Song wrote: On 9/24/19 8:26 AM, Shuah Khan wrote: Hi Alexei and Daniel, bpf test doesn't build on Linux 5.4 mainline. Do you know what's happening here. make -C tools/testing/selftests/bpf/ -c progs/test_core_reloc_ptr_as_arr.c -o - || echo &qu

Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
Hi Alexei and Daniel, bpf test doesn't build on Linux 5.4 mainline. Do you know what's happening here. make -C tools/testing/selftests/bpf/ -c progs/test_core_reloc_ptr_as_arr.c -o - || echo "clang failed") | \ llc -march=bpf -mcpu=generic -filetype=obj -o /mnt/data/lkml/linux_5.4/tools/test

Re: [PATCH] selftests: fix bpf build/test workflow regression when KBUILD_OUTPUT is set

2019-05-16 Thread Shuah Khan
On 5/16/19 12:36 PM, Alexei Starovoitov wrote: On Fri, May 10, 2019 at 9:37 PM Alexei Starovoitov wrote: On Fri, May 10, 2019 at 08:52:49PM -0600, Shuah Khan wrote: commit 8ce72dc32578 ("selftests: fix headers_install circular dependency") broke bpf build/test workflow. When KBUILD

Re: [GIT PULL] Kselftest update for Linux 5.2-rc1

2019-05-10 Thread Shuah Khan
On 5/9/19 8:17 PM, Alexei Starovoitov wrote: On Thu, May 09, 2019 at 07:42:09PM -0600, Shuah Khan wrote: On 5/9/19 4:40 PM, Shuah Khan wrote: On 5/9/19 4:20 PM, Alexei Starovoitov wrote: On Mon, May 06, 2019 at 10:56:56AM -0600, Shuah Khan wrote: Hi Linus, Please pull the following

[PATCH] selftests: fix bpf build/test workflow regression when KBUILD_OUTPUT is set

2019-05-10 Thread Shuah Khan
t_verifier: cd tools/testing/selftests/bpf; make; ./test_verifier; Fix it to set OUTPUT only when it is undefined in lib.mk. It didn't need to be set in the first place. Fixes: commit 8ce72dc32578 ("selftests: fix headers_install circular dependency") Reported-by: Alexei Starovoi

[PATCH] tty: Fix WARNING in tty_set_termios

2019-01-25 Thread Shuah Khan
ix the WARN_ON. This fix changes tty_set_termios() to return error and all the callers to check error and bail out. The reproducer is used to reproduce the problem and verify the fix. Reported-by: syzbot+a950165cbb86bdd02...@syzkaller.appspotmail.com Signed-off-by: Shuah Khan --- drivers/bluetoo

Re: selftests/bpf: test_kmod.sh hangs on all devices

2018-10-08 Thread Shuah Khan
Hi Naresh, Please use sh...@kernel.org for faster responses. I updated MAINTAINERS entry a while back removing shua...@osg.samsung.com address due to IT infrastructure changes at Samsung. On 10/08/2018 08:55 AM, Naresh Kamboju wrote: > Daniel, > > On Mon, 8 Oct 2018 at 18:58, Daniel Borkmann wr

Re: [PATCH v4] selftests: add headers_install to lib.mk

2018-07-24 Thread Shuah Khan
On 07/23/2018 02:49 PM, Anders Roxell wrote: > On Thu, 7 Jun 2018 at 13:09, Anders Roxell wrote: >> >> If the kernel headers aren't installed we can't build all the tests. >> Add a new make target rule 'khdr' in the file lib.mk to generate the >> kernel headers and that gets include for every test

Re: [PATCH bpf-next 0/5] fix test_sockmap

2018-05-18 Thread Shuah Khan
On 05/18/2018 01:17 AM, Prashant Bhole wrote: > This series fixes bugs in test_sockmap code. They weren't caught > previously because failure in RX/TX thread was not notified to the > main thread. > > Also fixed data verification logic and slightly improved test output > such that parameters value

[PATCH 24/24] selftests: net: return Kselftest Skip code for skipped tests

2018-05-04 Thread Shuah Khan (Samsung OSG)
message, instead of failing the test when /sys/power/state file open fails. Signed-off-by: Shuah Khan (Samsung OSG) --- tools/testing/selftests/net/fib_tests.sh| 8 +--- tools/testing/selftests/net/netdevice.sh| 16 +-- tools/testing/selftests/net/pmtu.sh | 5

Re: [PATCH] selftest: net: reuseport_bpf_numa: don't fail if no numa support

2018-03-07 Thread Shuah Khan
On 03/07/2018 11:25 AM, David Miller wrote: > From: Anders Roxell > Date: Tue, 6 Mar 2018 16:10:04 +0100 > >> The reuseport_bpf_numa test case fails there's no numa support. The >> test shouldn't fail if there's no support it should be skipped with a >> pass. >> >> Fixes: 3c2c3c16aaf6 ("reusepo

Re: [PATCH] selftests/bpf: update gitignore with test_libbpf_open

2018-02-21 Thread Shuah Khan
On 02/21/2018 05:33 PM, Daniel Borkmann wrote: > Hi Shuah, > > On 02/22/2018 12:03 AM, Shuah Khan wrote: >> On 02/21/2018 03:48 PM, David Miller wrote: >>> From: Anders Roxell >>> Date: Wed, 21 Feb 2018 22:30:01 +0100 >>> >>>> bpf bu

Re: [PATCH] selftests/bpf: update gitignore with test_libbpf_open

2018-02-21 Thread Shuah Khan
On 02/21/2018 03:48 PM, David Miller wrote: > From: Anders Roxell > Date: Wed, 21 Feb 2018 22:30:01 +0100 > >> bpf builds a test program for loading BPF ELF files. Add the executable >> to the .gitignore list. >> >> Signed-off-by: Anders Roxell > > Acked-by: David S. Miller > > Thanks. I wi

[PATCH] selftests: bpf: update .gitignore with missing generated files

2018-01-18 Thread Shuah Khan
Update .gitignore with missing generated files. Signed-off-by: Shuah Khan --- tools/testing/selftests/bpf/.gitignore | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore index 541d9d7fad5a..1e09d77f1948

Re: [PATCH v3 2/2] selftests: bpf: test_kmod.sh: use modprobe on target device

2017-11-07 Thread Shuah Khan
On 11/07/2017 09:35 AM, naresh.kamb...@linaro.org wrote: > From: Naresh Kamboju Odd to see this From: line in the patch. Could you take a look and see where this is coming from? Your gitconfig perhaps. I have to fix this up when I apply the patch which I would like to avoid. > > On ARM and ARM

Re: [PATCH v3 1/2] selftests: bpf: test_kmod.sh: check the module path before insmod

2017-11-07 Thread Shuah Khan
On 11/07/2017 09:35 AM, naresh.kamb...@linaro.org wrote: > From: Naresh Kamboju Odd to see this From: line in the patch. Could you take a look and see where this is coming from? Your gitconfig perhaps. I have to fix this up when I apply the patch which I would like to avoid. > > test_kmod.sh r

Re: [PATCH v2 1/2] selftests: bpf: test_kmod.sh: check if module is present in the path before insert

2017-11-06 Thread Shuah Khan
On 11/06/2017 08:23 AM, Naresh Kamboju wrote: > On 7 September 2017 at 14:46, Daniel Borkmann wrote: >> On 09/07/2017 10:19 AM, naresh.kamb...@linaro.org wrote: >>> >>> From: Naresh Kamboju >>> >>> The test script works when kernel source and build module test_bpf.ko >>> present on the machine. T

Re: [PATCH 3/3][v2] selftests: silence test output by default

2017-09-19 Thread Shuah Khan
On 09/19/2017 07:51 AM, jo...@toxicpanda.com wrote: > From: Josef Bacik > > Some of the networking tests are very noisy and make it impossible to > see if we actually passed the tests as they run. Default to suppressing > the output from any tests run in order to make it easier to track what > f

Re: [PATCH 2/3][v2] selftests: actually run the various net selftests

2017-09-19 Thread Shuah Khan
On 09/19/2017 07:51 AM, jo...@toxicpanda.com wrote: > From: Josef Bacik > > These self tests are just self contained binaries, they are not run by > any of the scripts in the directory. This means they need to be marked > with TEST_GEN_PROGS to actually be run, not TEST_GEN_FILES. > > Signed-of

Re: [PATCH 1/3][v2] selftest: add a reuseaddr test

2017-09-19 Thread Shuah Khan
On 09/19/2017 07:51 AM, jo...@toxicpanda.com wrote: > From: Josef Bacik > > This is to test for a regression introduced by > > b9470c27607b ("inet: kill smallest_size and smallest_port") > > which introduced a problem with reuseaddr and bind conflicts. > > Signed-off-by: Josef Bacik I usuall

Re: [PATCH 2/3] selftests: actually run the various net selftests

2017-09-19 Thread Shuah Khan
On 09/19/2017 12:14 PM, Willem de Bruijn wrote: > On Tue, Sep 19, 2017 at 9:34 AM, Josef Bacik wrote: >> On Mon, Sep 18, 2017 at 04:14:41PM -0600, Shuah Khan wrote: >>> On 09/18/2017 11:32 AM, jo...@toxicpanda.com wrote: >>>> From: Josef Bacik >>>> >

Re: [PATCH 2/3] selftests: actually run the various net selftests

2017-09-18 Thread Shuah Khan
On 09/18/2017 11:32 AM, jo...@toxicpanda.com wrote: > From: Josef Bacik > > These self tests are just self contained binaries, they are not run by > any of the scripts in the directory. This means they need to be marked > with TEST_GEN_PROGS to actually be run, not TEST_GEN_FILES. > > Signed-of

Re: [PATCH 3/3] selftests: silence test output by default

2017-09-18 Thread Shuah Khan
On 09/18/2017 02:19 PM, Josef Bacik wrote: > On Mon, Sep 18, 2017 at 01:48:31PM -0600, Shuah Khan wrote: >> On 09/18/2017 12:24 PM, Josef Bacik wrote: >>> On Mon, Sep 18, 2017 at 12:13:40PM -0600, Shuah Khan wrote: >>>> On 09/18/2017 11:52 AM, Josef Bacik wrote: >&

Re: [PATCH 3/3] selftests: silence test output by default

2017-09-18 Thread Shuah Khan
On 09/18/2017 12:24 PM, Josef Bacik wrote: > On Mon, Sep 18, 2017 at 12:13:40PM -0600, Shuah Khan wrote: >> On 09/18/2017 11:52 AM, Josef Bacik wrote: >>> On Mon, Sep 18, 2017 at 11:46:18AM -0600, Shuah Khan wrote: >>>> On 09/18/2017 11:37 AM, jo...@toxicpanda.com

Re: [PATCH 3/3] selftests: silence test output by default

2017-09-18 Thread Shuah Khan
On 09/18/2017 11:52 AM, Josef Bacik wrote: > On Mon, Sep 18, 2017 at 11:46:18AM -0600, Shuah Khan wrote: >> On 09/18/2017 11:37 AM, jo...@toxicpanda.com wrote: >>> From: Josef Bacik >>> >>> Some of the networking tests are very noisy and make it impossible

Re: [PATCH 3/3] selftests: silence test output by default

2017-09-18 Thread Shuah Khan
On 09/18/2017 11:37 AM, jo...@toxicpanda.com wrote: > From: Josef Bacik > > Some of the networking tests are very noisy and make it impossible to > see if we actually passed the tests as they run. Default to suppressing > the output from any tests run in order to make it easier to track what > f

Re: selftests/bpf doesn't compile

2017-09-15 Thread Shuah Khan
t;>>>> On Thu, Sep 14, 2017 at 09:33:48AM -0600, Shuah Khan wrote: >>>>>> Is bpf test intended to be run in kselftest run? The clang dependency >>>>>> might >>>>>> not be met on majority of the systems. Is this a hard dependency??

Re: selftests/bpf doesn't compile

2017-09-15 Thread Shuah Khan
On 09/15/2017 12:14 PM, Alexei Starovoitov wrote: > On Fri, Sep 15, 2017 at 11:00:31AM -0600, Shuah Khan wrote: >>>> I could add a special target for bpf TARGET_BPF perhaps and exclude it from >>>> the run_test> >>> I'm not sure what was the motivation

Re: selftests/bpf doesn't compile

2017-09-15 Thread Shuah Khan
On 09/15/2017 11:00 AM, Shuah Khan wrote: > On 09/15/2017 10:02 AM, Alexei Starovoitov wrote: >> On Thu, Sep 14, 2017 at 09:33:48AM -0600, Shuah Khan wrote: >>> Hi Alexei and Daniel, >>> >>> bpf test depend

Re: selftests/bpf doesn't compile

2017-09-15 Thread Shuah Khan
On 09/15/2017 10:02 AM, Alexei Starovoitov wrote: > On Thu, Sep 14, 2017 at 09:33:48AM -0600, Shuah Khan wrote: >> Hi Alexei and Daniel, >> >> bpf test depends on clang and fails to compile when >> >> -- >&

selftests/bpf doesn't compile

2017-09-14 Thread Shuah Khan
Hi Alexei and Daniel, bpf test depends on clang and fails to compile when -- make -C tools/testing/selftests/bpf run_tests make: clang: Command not found Makefile:39: recipe for target '.linux-kselftest/tools/testing/selftests/bpf/test_pkt_ac

Re: [PATCH][net-next][V3] bpf: test_maps: fix typos, "conenct" and "listeen"

2017-08-30 Thread Shuah Khan
listen" >> >> thanks to Daniel Borkmann for spotting one of these mistakes >> >> Signed-off-by: Colin Ian King > > Acked-by: Daniel Borkmann > > I can get this into 4.14-rc1 unless it should go through net-next for dependencies. In which case, Acked-by: Shuah Khan thanks, -- Shuah

Re: [PATCH net-next v7 01/10] selftest: Enhance kselftest_harness.h with a step mechanism

2017-08-28 Thread Shuah Khan
step mechanism may be useful to return an information about the >>>> error without being able to write to TH_LOG_STREAM. >>>> >>>> Set _metadata->no_print to true to print this counter. >>>> >>>> Signed-off-by: Mickaël Salaün >>&g

Re: [PATCH v2 net] selftests/bpf: fix broken build, take 2

2017-03-20 Thread Shuah Khan
both: >>> selftests/bpf$ make >>> and >>> selftests$ make TARGETS=bpf >>> on Ubuntu 16.04.2. >>> >>> Signed-off-by: Zi Shen Lim >> >> Looks reasonable to me as follow up to 1da8ac7c49fb ("selftests/bpf: >> fix broken build"), thanks for fixing Zi! >> >> Acked-by: Daniel Borkmann >> Tested-by: Daniel Borkmann > > worked for me as well: > Acked-by: Alexei Starovoitov > Tested-by: Alexei Starovoitov > > > David, Could you please apply it to your tree. I think you already applied the first fix. Acked-by: Shuah Khan thanks, -- Shuah

Re: linux-next: manual merge of the kselftest tree with the net-next tree

2017-02-22 Thread Shuah Khan
On 02/15/2017 08:24 PM, Stephen Rothwell wrote: > Hi Shuah, > > Today's linux-next merge of the kselftest tree got a conflict in: > > tools/testing/selftests/bpf/Makefile > > between commit: > > d498f8719a09 ("bpf: Rebuild bpf.o for any dependency update") > > from the net-next tree and co

Re: linux-next: manual merge of the kselftest tree with the net-next tree

2017-01-24 Thread Shuah Khan
On 01/23/2017 09:45 PM, Stephen Rothwell wrote: > Hi Shuah, > > Today's linux-next merge of the kselftest tree got a conflict in: > > tools/testing/selftests/bpf/Makefile > > between commit: > > 4d3381f5a322 ("bpf: Add tests for the lpm trie map") > > from the net-next tree and commit: >

Re: [PATCH v3 net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter

2017-01-05 Thread Shuah Khan
On 01/05/2017 08:54 AM, Sowmini Varadhan wrote: > On (01/04/17 16:26), Shuah Khan wrote: >> >> Could you please split this patch into two. Hardening part in one and >> the cleanup in a separate patch. This way I can get the hardening fix >> into 4.10 in my next Kselftes

Re: [PATCH v3 net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter

2017-01-04 Thread Shuah Khan
On 01/04/2017 03:55 PM, Sowmini Varadhan wrote: > On (01/04/17 15:37), Shuah Khan wrote: >>> + /* the filter below checks for all of the following conditions that >>> +* are based on the contents of create_payload() >>> +* ether type 0x800 and &g

Re: [PATCH v3 net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter

2017-01-04 Thread Shuah Khan
explicitly use the BPF macros to make it more readable. > > Signed-off-by: Sowmini Varadhan > Acked-by: Willem de Bruijn > --- > v2: commit comment edited based on Willem de Bruijn review > v3: Shuah Khan nit. > > tools/testing/selftests/net/psock_lib.h | 29 +

Re: [PATCH v2 net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter

2017-01-04 Thread Shuah Khan
Hi Sowmini, Thanks for the patch. On 01/04/2017 10:33 AM, Sowmini Varadhan wrote: > The bpf_prog used in sock_setfilter() only attempts to check for > ip pktlen, and verifies that the contents of the 80'th packet in > the ethernet frame is 'a' or 'b'. Thus many non-udp packets > could incorrectl

Re: [PATCH 2/3] selftests: do not require bash to run bpf tests

2016-12-14 Thread Shuah Khan
On 12/14/2016 04:03 AM, Daniel Borkmann wrote: > On 12/14/2016 11:58 AM, Rolf Eike Beer wrote: >> From b9d6c1b7427d708ef2d4d57aac17b700b3694d71 Mon Sep 17 00:00:00 2001 >> From: Rolf Eike Beer >> Date: Wed, 14 Dec 2016 09:58:12 +0100 >> Subject: [PATCH 2/3] selftests: do not require bash to run b

[PATCH] net/netfilter: Fix use uninitialized warn in nft_range_eval()

2016-11-07 Thread Shuah Khan
: Shuah Khan --- net/netfilter/nft_range.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nft_range.c b/net/netfilter/nft_range.c index c6d5358..fe5f69b 100644 --- a/net/netfilter/nft_range.c +++ b/net/netfilter/nft_range.c @@ -28,7 +28,7 @@ static void

Re: [PATCH v2 6/6] selftests: move watchdog tests from Documentation/watchdog

2016-09-13 Thread Shuah Khan
On 09/13/2016 02:33 PM, Timur Tabi wrote: > Shuah Khan wrote: >> Remove watchdog-test from Makefile to move the test to selftests. >> >> Add Makefile and .gitignore to for watchdog-test. watchdog-test will > > to for? Thanks - will fix that. > >> not be run

[PATCH v2 4/6] selftests: move vDSO tests from Documentation/vDSO

2016-09-13 Thread Shuah Khan
Remove vDSO from Makefile to move the to selftests. Update vDSO Makefile to work under selftests. vDSO will not be run as part of selftests suite and will not be included in install targets. They can be built separately for now. Signed-off-by: Shuah Khan --- Documentation/Makefile

[PATCH v2 1/6] selftests: move dnotify_test from Documentation/filesystems

2016-09-13 Thread Shuah Khan
not be included in install targets. It can be built separately for now. Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/filesystems/.gitignore | 1 - Documentation/filesystems/Makefile | 5 Documentation

[PATCH v2 5/6] selftests: move ia64 tests from Documentation/ia64

2016-09-13 Thread Shuah Khan
this update doesn't change that. Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/ia64/.gitignore| 1 - Documentation/ia64/Makefile | 5 - Documentation/ia64/aliasing-test.c

[PATCH v2 6/6] selftests: move watchdog tests from Documentation/watchdog

2016-09-13 Thread Shuah Khan
Remove watchdog-test from Makefile to move the test to selftests. Add Makefile and .gitignore to for watchdog-test. watchdog-test will not be run as part of selftests suite and will not be included in install targets. It can be built separately for now. Signed-off-by: Shuah Khan

[PATCH v2 0/6] Move runnable code (tests) from Documentation to selftests

2016-09-13 Thread Shuah Khan
wider audience and people that responded with comments and ideas. - Included ia64 and watchdog which I missed in the v1 series. Shuah Khan (6): selftests: move dnotify_test from Documentation/filesystems selftests: move prctl tests from Documentation/prctl selftests: move ptp tests from Do

[PATCH v2 2/6] selftests: move prctl tests from Documentation/prctl

2016-09-13 Thread Shuah Khan
-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/prctl/.gitignore | 3 - Documentation/prctl/Makefile | 10 --- .../prctl/disable-tsc-ctxt-sw-stress-test.c| 97 -- .../prctl/disable

  1   2   >