[RFC PATCH net] splice: Do not set SPLICE_F_MORE flag if end of file is reached

2020-06-05 Thread Pooja Trivedi
} --- Here is the kTLS selftest that was submitted, and that helps reproduce the issue: https://lists.openwall.net/netdev/2020/06/05/109 --- Signed-off-by: Pooja Trivedi Signed-off-by: Mallesham Jatharkonda Signed-off-by: Josh Tway --- fs/splice.c | 8 +--- 1 file changed, 5

[PATCH net] net/tls(TLS_SW): Add selftest for 'chunked' sendfile test

2020-06-05 Thread Pooja Trivedi
would get flushed and the issue would not happen. So a shutdown control message following sendfile can mask the issue. Signed-off-by: Pooja Trivedi Signed-off-by: Mallesham Jatharkonda Signed-off-by: Josh Tway --- tools/testing/selftests/net/tls.c | 58 +++ 1 fi

Re: [RFC PATCH net 1/1] net/tls(TLS_SW): Add selftest for 'chunked' sendfile test

2020-06-03 Thread Pooja Trivedi
On Tue, Jun 2, 2020 at 3:19 PM Jakub Kicinski wrote: > > On Tue, 2 Jun 2020 14:56:25 + Pooja Trivedi wrote: > > This selftest tests for cases where sendfile's 'count' > > parameter is provided with a size greater than the intended > > file size. > &

[RFC PATCH net 1/1] net/tls(TLS_SW): Add selftest for 'chunked' sendfile test

2020-06-02 Thread Pooja Trivedi
would get flushed and the issue would not happen. So a shutdown control message following sendfile can mask the issue. Signed-off-by: Pooja Trivedi --- tools/testing/selftests/net/tls.c | 58 +++ 1 file changed, 58 insertions(+) diff --git a/tools/testing/sel

[RFC 0/1] net/tls(TLS_SW): Data integrity issue with sw kTLS using sendfile

2020-06-02 Thread Pooja Trivedi
When sendfile is used for kTLS file delivery and the size provided to sendfile via its 'count' parameter is greater than the file size, kTLS fails to send the file correctly. The last chunk of the file is not sent, and the data integrity of the file is compromised on the receiver side. Based on

Re: [net v3 0/2] net/tls: fix encryption error path

2020-05-21 Thread Pooja Trivedi
On Wed, May 20, 2020 at 4:46 PM Jakub Kicinski wrote: > > On Wed, 20 May 2020 11:41:42 +0300 Vadim Fedorenko wrote: > > The problem with data stream corruption was found in KTLS > > transmit path with small socket send buffers and large > > amount of data. bpf_exec_tx_verdict() frees open record >

Re: [PATCH net] net/tls(TLS_SW): Fix integrity issue with non-blocking sw KTLS request

2020-05-20 Thread Pooja Trivedi
On Tue, May 19, 2020 at 5:43 PM Jakub Kicinski wrote: > > On Tue, 19 May 2020 13:21:56 -0400 Pooja Trivedi wrote: > > On Mon, May 18, 2020 at 6:50 PM Jakub Kicinski wrote: > > > On Sun, 17 May 2020 16:26:36 + Pooja Trivedi wrote: > > > > In pure sw ktl

Re: [PATCH net] net/tls(TLS_SW): Fix integrity issue with non-blocking sw KTLS request

2020-05-19 Thread Pooja Trivedi
On Mon, May 18, 2020 at 6:50 PM Jakub Kicinski wrote: > > On Sun, 17 May 2020 16:26:36 + Pooja Trivedi wrote: > > In pure sw ktls(AES-NI), -EAGAIN from tcp layer (do_tcp_sendpages for > > encrypted record) gets treated as error, subtracts the offset, and > > returns to

[PATCH net] net/tls(TLS_SW): Fix integrity issue with non-blocking sw KTLS request

2020-05-17 Thread Pooja Trivedi
ned-off-by: Pooja Trivedi Reviewed-by: Mallesham Jatharkonda Reviewed-by: Josh Tway --- net/tls/tls_sw.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index e23f94a..d8ebdfc 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -415,

Re: [PATCH V2 net 1/1] net/tls(TLS_SW): Fix list_del double free caused by a race condition in tls_tx_records

2019-10-09 Thread Pooja Trivedi
On Fri, Sep 27, 2019 at 05:37:53PM -0700, Jakub Kicinski wrote: > On Tue, 24 Sep 2019 12:48:26 -0400, Pooja Trivedi wrote: > > On Mon, Sep 23, 2019 at 8:28 PM Jakub Kicinski wrote: > > > On Sat, 21 Sep 2019 23:19:20 -0400, Pooja Trivedi wrote: > > > > On Wed,

Re: [PATCH V2 net 1/1] net/tls(TLS_SW): Fix list_del double free caused by a race condition in tls_tx_records

2019-09-24 Thread Pooja Trivedi
On Mon, Sep 23, 2019 at 8:28 PM Jakub Kicinski wrote: > > On Sat, 21 Sep 2019 23:19:20 -0400, Pooja Trivedi wrote: > > On Wed, Sep 18, 2019 at 5:45 PM Jakub Kicinski wrote: > > > On Wed, 18 Sep 2019 17:37:44 -0400, Pooja Trivedi wrote: > > > > Hi Jakub, >

Re: [PATCH V2 net 1/1] net/tls(TLS_SW): Fix list_del double free caused by a race condition in tls_tx_records

2019-09-21 Thread Pooja Trivedi
On Wed, Sep 18, 2019 at 5:45 PM Jakub Kicinski wrote: > > On Wed, 18 Sep 2019 17:37:44 -0400, Pooja Trivedi wrote: > > Hi Jakub, > > > > I have explained one potential way for the race to happen in my > > original message to the netdev mailing list here: > >

Re: [PATCH V2 net 1/1] net/tls(TLS_SW): Fix list_del double free caused by a race condition in tls_tx_records

2019-09-18 Thread Pooja Trivedi
Let me know if you need more information. Thanks! On Wed, Sep 18, 2019 at 5:25 PM Jakub Kicinski wrote: > > On Tue, 17 Sep 2019 21:13:56 +, Pooja Trivedi wrote: > > From: Pooja Trivedi > > Ugh the same problem was diagnosed recently by Mallesham but I just >

Re: [PATCH V2 net 1/1] net/tls(TLS_SW): Fix list_del double free caused by a race condition in tls_tx_records

2019-09-17 Thread Pooja Trivedi
Thanks, Pooja. On Tue, Sep 17, 2019 at 5:14 PM Pooja Trivedi wrote: > > From: Pooja Trivedi > > Enclosing tls_tx_records within lock_sock/release_sock pair to ensure > write-synchronization is not sufficient because socket lock gets released > under memory pressure situation by

[PATCH V2 net 1/1] net/tls(TLS_SW): Fix list_del double free caused by a race condition in tls_tx_records

2019-09-17 Thread Pooja Trivedi
From: Pooja Trivedi Enclosing tls_tx_records within lock_sock/release_sock pair to ensure write-synchronization is not sufficient because socket lock gets released under memory pressure situation by sk_wait_event while it sleeps waiting for memory, allowing another writer into tls_tx_records

[PATCH net 1/1] net/tls(TLS_SW): Fix list_del double free caused by a race condition in tls_tx_records

2019-09-09 Thread Pooja Trivedi
0x5c/0xc0 Signed-off-by: Pooja Trivedi -- diff --git a/include/net/tls.h b/include/net/tls.h index 41b2d41..f346a54 100644 --- a/include/net/tls.h +++ b/include/net/tls.h @@ -161,6 +161,7 @@ struct tls_sw_context_tx { #define BIT_TX_SCHEDULED 0 #define BIT_TX_CLOSING 1

[PATCH net 0/1] net/tls(TLS_SW): double free in tls_tx_records

2019-09-09 Thread Pooja Trivedi
TLS module crash while running SSL record encryption using klts_send_[file] using crypto accelerator (Nitrox). Following are the preconditions and steps to reproduce the issue: Preconditions: 1) Installed 5.3-rc4 2) Nitrox5 card plugin (crypto accelerator) Steps to reproduce the issue: 1) Instal