[PATCH v3 0/4] close various race windows for swap

2021-04-20 Thread Miaohe Lin
reduce the performance overhead on the hot-path as much as possible, it appears we can use the percpu_ref to close this race window(as suggested by Huang, Ying). The patch 1 adds percpu_ref support for swap and most of the remaining patches try to use this to close various race windows. More details can

[PATCH 5.10 083/103] ch_ktls: tcb close causes tls connection failure

2021-04-19 Thread Greg Kroah-Hartman
o/inline_crypto/ch_ktls/chcr_ktls.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c @@ -355,18 +355,6 @@ static int chcr_set_tcb_field(struct chc } /* - * chcr_ktls_mark_tcb_close: mark tcb state to CLOSE - * @tx_info - driver specific tls info. - * return: NET_TX_OK/NET_XMIT_DRO

[PATCH 5.10 082/103] ch_ktls: fix device connection close

2021-04-19 Thread Greg Kroah-Hartman
From: Vinay Kumar Yadav commit bc16efd2430652f894ae34b1de5eccc3bf0d2810 upstream. When sge queue is full and chcr_ktls_xmit_wr_complete() returns failure, skb is not freed if it is not the last tls record in this skb, causes refcount never gets freed and tls_dev_del() never gets called on this c

[PATCH 5.11 100/122] ch_ktls: tcb close causes tls connection failure

2021-04-19 Thread Greg Kroah-Hartman
o/inline_crypto/ch_ktls/chcr_ktls.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c @@ -355,18 +355,6 @@ static int chcr_set_tcb_field(struct chc } /* - * chcr_ktls_mark_tcb_close: mark tcb state to CLOSE - * @tx_info - driver specific tls info. - * return: NET_TX_OK/NET_XMIT_DRO

[PATCH 5.11 099/122] ch_ktls: fix device connection close

2021-04-19 Thread Greg Kroah-Hartman
From: Vinay Kumar Yadav commit bc16efd2430652f894ae34b1de5eccc3bf0d2810 upstream. When sge queue is full and chcr_ktls_xmit_wr_complete() returns failure, skb is not freed if it is not the last tls record in this skb, causes refcount never gets freed and tls_dev_del() never gets called on this c

[PATCH v2 0/5] close various race windows for swap

2021-04-17 Thread Miaohe Lin
reduce the performance overhead on the hot-path as much as possible, it appears we can use the percpu_ref to close this race window(as suggested by Huang, Ying). The patch 1 adds percpu_ref support for swap and most of the remaining patches try to use this to close various race windows. More details can

[PATCH v2 3/5] staging: rtl8192e: remove unnecessary blank line after close brace

2021-04-13 Thread Mitali Borkar
Removed an extra blank line after close brace '{' as it was not necessary. Reported by checkpatch Signed-off-by: Mitali Borkar --- Changes from v1:- No changes. drivers/staging/rtl8192e/rtl819x_HTProc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/stagin

[PATCH 5.11 153/210] RDMA/rtrs-clt: Close rtrs client conn before destroying rtrs clt session files

2021-04-12 Thread Greg Kroah-Hartman
ll the present rtrs_clt_sess and triggers close on them. However, the call to rtrs_clt_destroy_sess_files is done before the rtrs_clt_close_conns. This is incorrect since during the initialization phase we allocate rtrs_clt_sess first, and then we go ahead and create rtrs_clt_con for it. If we fr

[PATCH 5.10 138/188] RDMA/rtrs-clt: Close rtrs client conn before destroying rtrs clt session files

2021-04-12 Thread Greg Kroah-Hartman
ll the present rtrs_clt_sess and triggers close on them. However, the call to rtrs_clt_destroy_sess_files is done before the rtrs_clt_close_conns. This is incorrect since during the initialization phase we allocate rtrs_clt_sess first, and then we go ahead and create rtrs_clt_con for it. If we fr

[PATCH v1 4/8] scsi: megaraid: clean up for open/close brace

2021-04-09 Thread Luo Jiaxing
There are few kinds of error about open/close brace is reported by checkpatch.pl: ERROR: open brace '{' following function definitions go on the next line int megasas_sync_pd_seq_num(struct megasas_instance *instance, bool pend) { ERROR: else should follow close brace '}' +

Re: [PATCH 0/5] close various race windows for swap

2021-04-09 Thread Miaohe Lin
inst concurrent swapoff for >> swap_readpage() looks terrible because swap_readpage() may take really >> long time. And to reduce the performance overhead on the hot-path as >> much as possible, it appears we can use the percpu_ref to close this >> race window(as suggested by Huang

Re: [PATCH 0/5] close various race windows for swap

2021-04-08 Thread riteshh
errible because swap_readpage() may take really > long time. And to reduce the performance overhead on the hot-path as > much as possible, it appears we can use the percpu_ref to close this > race window(as suggested by Huang, Ying). The patch 1 adds percpu_ref > support for swap and the rest

[PATCH 0/5] close various race windows for swap

2021-04-08 Thread Miaohe Lin
reduce the performance overhead on the hot-path as much as possible, it appears we can use the percpu_ref to close this race window(as suggested by Huang, Ying). The patch 1 adds percpu_ref support for swap and the rest of the patches use this to close various race windows. More details can be found in

[PATCH 4/8] drm/msm: Split iova purge and close

2021-04-05 Thread Rob Clark
/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -357,9 +357,14 @@ static void del_vma(struct msm_gem_vma *vma) kfree(vma); } -/* Called with msm_obj locked */ +/** + * If close is true, this also closes the VMA (releasing the allocated + * iova range) in addition to removing the iommu

[PATCH printk v2 5/5] printk: syslog: close window between wait and read

2021-03-30 Thread John Ogness
Syslog's SYSLOG_ACTION_READ is supposed to block until the next syslog record can be read, and then it should read that record. However, because @syslog_lock is not held between waking up and reading the record, another reader could read the record first, thus causing SYSLOG_ACTION_READ to return w

Re: [PATCH net-next] net: lapbether: Close the LAPB device before its underlying Ethernet device closes

2021-03-18 Thread patchwork-bot+netdevbpf
e Ethernet device > closes. It would be better to close it before the Ethernet device closes. > This would allow the LAPB device to transmit a last frame to notify the > other side that it is disconnecting. > > [...] Here is the summary with links: - [net-next] net: lapbether:

[PATCH net-next] net: lapbether: Close the LAPB device before its underlying Ethernet device closes

2021-03-18 Thread Xie He
When a virtual LAPB device's underlying Ethernet device closes, the LAPB device is also closed. However, currently the LAPB device is closed after the Ethernet device closes. It would be better to close it before the Ethernet device closes. This would allow the LAPB device to transmit a

[PATCH 5.10 196/290] cifs: do not send close in compound create+close requests

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Paulo Alcantara commit 04ad69c342fc4de5bd23be9ef15ea7574fb1a87e upstream. In case of interrupted syscalls, prevent sending CLOSE commands for compound CREATE+CLOSE requests by introducing an CIFS_CP_CREATE_CLOSE_OP flag to indicate lower layers that it should

[PATCH 5.11 192/306] cifs: do not send close in compound create+close requests

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Paulo Alcantara commit 04ad69c342fc4de5bd23be9ef15ea7574fb1a87e upstream. In case of interrupted syscalls, prevent sending CLOSE commands for compound CREATE+CLOSE requests by introducing an CIFS_CP_CREATE_CLOSE_OP flag to indicate lower layers that it should

[PATCH 5.11 123/306] mptcp: reset last_snd on subflow close

2021-03-15 Thread gregkh
From: Greg Kroah-Hartman From: Florian Westphal [ Upstream commit e0be4931f3fee2e04dec4013ea4f27ec2db8556f ] Send logic caches last active subflow in the msk, so it needs to be cleared when the cached subflow is closed. Fixes: d5f49190def61c ("mptcp: allow picking different xmit subflows") Cl

[PATCH 4.19 10/39] Revert "zram: close udev startup race condition as default groups"

2021-03-10 Thread gregkh
From: Greg Kroah-Hartman From: Jeffle Xu This reverts commit 9e07f4e243791e00a4086ad86e573705cf7b2c65. The original commit is actually a "merged" fix of [1] and [2], as described in [3]. Since now we have more fixes that rely on [1], revert this commit first, and then get the original [1] and

[PATCH 5/5] habanalabs: print if device is used on FD close

2021-02-22 Thread Oded Gabbay
Notify to the user that although he closed the FD, the device is still in use because there are live CS and/or memory mappings (mmaps). Signed-off-by: Oded Gabbay --- drivers/misc/habanalabs/common/device.c | 8 +--- drivers/misc/habanalabs/common/habanalabs.h | 2 +- 2 files changed, 6

[PATCH 5.10 081/120] drm/i915/gt: Close race between enable_breadcrumbs and cancel_breadcrumbs

2021-02-08 Thread Greg Kroah-Hartman
From: Chris Wilson commit e4747cb3ec3c232d65c84cbe77633abd5871fda3 upstream. If we enable_breadcrumbs for a request while that request is being removed from HW; we may see that the request is active as we take the ce->signal_lock and proceed to attach the request to ce->signals. However, during

[RFC: timer passthrough 8/9] KVM: vmx: Dynamically open or close the timer-passthrough for pre-vm

2021-02-05 Thread Zhimin Feng
Timer passthrough is default disabled Signed-off-by: Zhimin Feng --- arch/x86/include/asm/kvm_host.h | 3 +-- arch/x86/kvm/lapic.c| 10 +--- arch/x86/kvm/vmx/vmx.c | 52 + arch/x86/kvm/x86.c | 6 + include/linux/

[PATCH 4.14 23/50] pNFS: Mark layout for return if return-on-close was not sent

2021-01-22 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 67bbceedc9bb8ad48993a8bd6486054756d711f4 upstream. If the layout return-on-close failed because the layoutreturn was never sent, then we should mark the layout for return again. Fixes: 9c47b18cf722 ("pNFS: Ensure we do clear the return-on-close layout state

Re: [PATCH] USB: serial: cp210x: suppress modem-control error on open and close

2021-01-21 Thread Johan Hovold
-32 > > Add a crtscts flag to keep track of the hardware flow-control setting > and use it to suppress the request in dtr_rts(). > > Note that both lines are still deasserted when disabling the UART as > part of close(). > > Also note that TIOCMSET is left unchanged an

[PATCH] USB: serial: cp210x: suppress modem-control error on open and close

2021-01-21 Thread Johan Hovold
it to suppress the request in dtr_rts(). Note that both lines are still deasserted when disabling the UART as part of close(). Also note that TIOCMSET is left unchanged and will continue to return an error to user-space when flow control is enabled (i.e. instead of disabling and re-enabling auto

[PATCH 5.4 23/76] cifs: fix interrupted close commands

2021-01-18 Thread Greg Kroah-Hartman
From: Paulo Alcantara [ Upstream commit 2659d3bff3e1b000f49907d0839178b101a89887 ] Retry close command if it gets interrupted to not leak open handles on the server. Signed-off-by: Paulo Alcantara (SUSE) Reported-by: Duncan Findlay Suggested-by: Pavel Shilovsky Fixes: 6988a619f5b7 ("

[PATCH 4.19 30/43] pNFS: Mark layout for return if return-on-close was not sent

2021-01-18 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 67bbceedc9bb8ad48993a8bd6486054756d711f4 upstream. If the layout return-on-close failed because the layoutreturn was never sent, then we should mark the layout for return again. Fixes: 9c47b18cf722 ("pNFS: Ensure we do clear the return-on-close layout state

[PATCH 5.4 22/76] smb3: remove unused flag passed into close functions

2021-01-18 Thread Greg Kroah-Hartman
From: Steve French [ Upstream commit 9e8fae2597405ab1deac8909928eb8e99876f639 ] close was relayered to allow passing in an async flag which is no longer needed in this path. Remove the unneeded parameter "flags" passed in on close. Signed-off-by: Steve French Reviewed-by: Pavel

[PATCH 5.4 57/76] pNFS: Mark layout for return if return-on-close was not sent

2021-01-18 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 67bbceedc9bb8ad48993a8bd6486054756d711f4 upstream. If the layout return-on-close failed because the layoutreturn was never sent, then we should mark the layout for return again. Fixes: 9c47b18cf722 ("pNFS: Ensure we do clear the return-on-close layout state

[PATCH 5.4 56/76] pNFS: We want return-on-close to complete when evicting the inode

2021-01-18 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 078000d02d57f02dde61de4901f289672e98c8bc upstream. If the inode is being evicted, it should be safe to run return-on-close, so we should do it to ensure we don't inadvertently leak layout segments. Fixes: 1c5bd76d17cc ("pNFS: Enable layoutreturn ope

[PATCH 5.10 024/152] cifs: fix interrupted close commands

2021-01-18 Thread Greg Kroah-Hartman
From: Paulo Alcantara commit 2659d3bff3e1b000f49907d0839178b101a89887 upstream. Retry close command if it gets interrupted to not leak open handles on the server. Signed-off-by: Paulo Alcantara (SUSE) Reported-by: Duncan Findlay Suggested-by: Pavel Shilovsky Fixes: 6988a619f5b7 ("

[PATCH 5.10 122/152] pNFS: We want return-on-close to complete when evicting the inode

2021-01-18 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 078000d02d57f02dde61de4901f289672e98c8bc upstream. If the inode is being evicted, it should be safe to run return-on-close, so we should do it to ensure we don't inadvertently leak layout segments. Fixes: 1c5bd76d17cc ("pNFS: Enable layoutreturn ope

[PATCH 5.10 123/152] pNFS: Mark layout for return if return-on-close was not sent

2021-01-18 Thread Greg Kroah-Hartman
From: Trond Myklebust commit 67bbceedc9bb8ad48993a8bd6486054756d711f4 upstream. If the layout return-on-close failed because the layoutreturn was never sent, then we should mark the layout for return again. Fixes: 9c47b18cf722 ("pNFS: Ensure we do clear the return-on-close layout state

[PATCH 5.10 097/103] block/rnbd-clt: avoid module unload race with close confirmation

2021-01-15 Thread Greg Kroah-Hartman
From: Jack Wang commit 3a21777c6ee99749bac10727b3c17e5bcfebe5c1 upstream. We had kernel panic, it is caused by unload module and last close confirmation. call trace: [1196029.743127] free_sess+0x15/0x50 [rtrs_client] [1196029.743128] rtrs_clt_close+0x4c/0x70 [rtrs_client] [1196029.743129

[PATCH 5.10 007/103] drm/panfrost: Dont corrupt the queue mutex on open/close

2021-01-15 Thread Greg Kroah-Hartman
From: Steven Price [ Upstream commit a17d609e3e216c406f7c0cec2a94086a4401ac06 ] The mutex within the panfrost_queue_state should have the lifetime of the queue, however it was erroneously initialised/destroyed during panfrost_job_{open,close} which is called every time a client opens/closes the

[PATCH 4.19 39/77] Bluetooth: revert: hci_h5: close serdev device and free hu in h5_close

2021-01-11 Thread Greg Kroah-Hartman
From: Hans de Goede commit 5c3b5796866f85354a5ce76a28f8ffba0dcefc7e upstream. There have been multiple revisions of the patch fix the h5->rx_skb leak. Accidentally the first revision (which is buggy) and v5 have both been merged: v1 commit 70f259a3f427 ("Bluetooth: hci_h5: close serde

[PATCH 5.4 47/92] Bluetooth: revert: hci_h5: close serdev device and free hu in h5_close

2021-01-11 Thread Greg Kroah-Hartman
From: Hans de Goede commit 5c3b5796866f85354a5ce76a28f8ffba0dcefc7e upstream. There have been multiple revisions of the patch fix the h5->rx_skb leak. Accidentally the first revision (which is buggy) and v5 have both been merged: v1 commit 70f259a3f427 ("Bluetooth: hci_h5: close serde

[PATCH 5.10 069/145] Bluetooth: revert: hci_h5: close serdev device and free hu in h5_close

2021-01-11 Thread Greg Kroah-Hartman
From: Hans de Goede commit 5c3b5796866f85354a5ce76a28f8ffba0dcefc7e upstream. There have been multiple revisions of the patch fix the h5->rx_skb leak. Accidentally the first revision (which is buggy) and v5 have both been merged: v1 commit 70f259a3f427 ("Bluetooth: hci_h5: close serde

Re: [PATCH 0/2] drivers:tty:pty: Fix a race causing data loss on close

2021-01-07 Thread Greg Kroah-Hartman
t a bad idea. > > >From what I can tell, the tty_vhangup() is there in case there was a > console redirect to the pty slave. When you close the master, you need > to release the redirect. I didn't see another reason for tty_vhangup(). > So this has two parts, export the

Re: [PATCH 2/2] drivers:tty:pty: Fix a race causing data loss on close

2021-01-07 Thread Greg Kroah-Hartman
On Sat, Jan 02, 2021 at 08:41:09AM -0600, Corey Minyard wrote: > On Mon, Nov 23, 2020 at 06:49:02PM -0600, miny...@acm.org wrote: > > From: Corey Minyard > > > > Remove the tty_vhangup() from the pty code and just release the > > redirect. The tty_vhangup() results in data loss and data out of o

Re: [PATCH net-next] net: nfc: nci: Change the NCI close sequence

2021-01-05 Thread David Miller
From: Bongsu Jeon Date: Mon, 28 Dec 2020 10:46:31 +0900 > From: Bongsu Jeon > > Change the NCI close sequence because the NCI Command timer should be > deleted after flushing the NCI command work queue. > > Signed-off-by: Bongsu Jeon Applied.

[PATCH 4.19 15/29] Bluetooth: hci_h5: close serdev device and free hu in h5_close

2021-01-05 Thread Greg Kroah-Hartman
From: Anant Thazhemadam commit 70f259a3f4276b71db365b1d6ff1eab805ea6ec3 upstream. When h5_close() gets called, the memory allocated for the hu gets freed only if hu->serdev doesn't exist. This leads to a memory leak. So when h5_close() is requested, close the serdev device instance and

[PATCH 5.4 25/47] Bluetooth: hci_h5: close serdev device and free hu in h5_close

2021-01-04 Thread Greg Kroah-Hartman
From: Anant Thazhemadam commit 70f259a3f4276b71db365b1d6ff1eab805ea6ec3 upstream. When h5_close() gets called, the memory allocated for the hu gets freed only if hu->serdev doesn't exist. This leads to a memory leak. So when h5_close() is requested, close the serdev device instance and

[PATCH 5.10 27/63] Bluetooth: hci_h5: close serdev device and free hu in h5_close

2021-01-04 Thread Greg Kroah-Hartman
From: Anant Thazhemadam commit 70f259a3f4276b71db365b1d6ff1eab805ea6ec3 upstream. When h5_close() gets called, the memory allocated for the hu gets freed only if hu->serdev doesn't exist. This leads to a memory leak. So when h5_close() is requested, close the serdev device instance and

[PATCH 5.10 07/63] io_uring: close a small race gap for files cancel

2021-01-04 Thread Greg Kroah-Hartman
From: Pavel Begunkov commit dfea9fce29fda6f2f91161677e0e0d9b671bc099 upstream. The purpose of io_uring_cancel_files() is to wait for all requests matching ->files to go/be cancelled. We should first drop files of a request in io_req_drop_files() and only then make it undiscoverable for io_uring_

[PATCH 4.19 21/35] Bluetooth: hci_h5: close serdev device and free hu in h5_close

2021-01-04 Thread Greg Kroah-Hartman
From: Anant Thazhemadam commit 70f259a3f4276b71db365b1d6ff1eab805ea6ec3 upstream. When h5_close() gets called, the memory allocated for the hu gets freed only if hu->serdev doesn't exist. This leads to a memory leak. So when h5_close() is requested, close the serdev device instance and

Re: [PATCH 2/2] drivers:tty:pty: Fix a race causing data loss on close

2021-01-02 Thread Corey Minyard
is. I'm pretty sure this is the right fix, the more I've thought about it. Thankks, -corey > > If you write to a pty master an immediately close the pty master, the > receiver might get a chunk of data dropped, but then receive some later > data. That's obviou

[PATCH net-next v2] net: nfc: nci: Change the NCI close sequence

2020-12-30 Thread Bongsu Jeon
From: Bongsu Jeon If there is a NCI command in work queue after closing the NCI device at nci_unregister_device, The NCI command timer starts at flush_workqueue function and then NCI command timeout handler would be called 5 second after flushing the NCI command work queue and destroying the qu

Re: [PATCH net-next] net: nfc: nci: Change the NCI close sequence

2020-12-28 Thread Jakub Kicinski
On Mon, 28 Dec 2020 10:46:31 +0900 Bongsu Jeon wrote: > From: Bongsu Jeon > > Change the NCI close sequence because the NCI Command timer should be > deleted after flushing the NCI command work queue. The commit message should describe the reason - why new order is better than the

[PATCH 5.10 435/717] um: tty: Fix handling of close in tty lines

2020-12-28 Thread Greg Kroah-Hartman
From: Anton Ivanov [ Upstream commit 9b1c0c0e25dcccafd30e7d4c150c249cc65550eb ] Fix a logical error in tty reading. We get 0 and errno == EAGAIN on the first attempt to read from a closed file descriptor. Compared to that a true EAGAIN is EAGAIN and -1. If we check errno for EAGAIN first, befo

[PATCH 5.4 282/453] um: tty: Fix handling of close in tty lines

2020-12-28 Thread Greg Kroah-Hartman
From: Anton Ivanov [ Upstream commit 9b1c0c0e25dcccafd30e7d4c150c249cc65550eb ] Fix a logical error in tty reading. We get 0 and errno == EAGAIN on the first attempt to read from a closed file descriptor. Compared to that a true EAGAIN is EAGAIN and -1. If we check errno for EAGAIN first, befo

[PATCH 4.19 233/346] um: tty: Fix handling of close in tty lines

2020-12-28 Thread Greg Kroah-Hartman
From: Anton Ivanov [ Upstream commit 9b1c0c0e25dcccafd30e7d4c150c249cc65550eb ] Fix a logical error in tty reading. We get 0 and errno == EAGAIN on the first attempt to read from a closed file descriptor. Compared to that a true EAGAIN is EAGAIN and -1. If we check errno for EAGAIN first, befo

[PATCH net-next] net: nfc: nci: Change the NCI close sequence

2020-12-27 Thread Bongsu Jeon
From: Bongsu Jeon Change the NCI close sequence because the NCI Command timer should be deleted after flushing the NCI command work queue. Signed-off-by: Bongsu Jeon --- net/nfc/nci/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/nfc/nci/core.c b/net/nfc/nci

[PATCH AUTOSEL 5.10 071/217] RDMA/core: Postpone uobject cleanup on failure till FD close

2020-12-22 Thread Sasha Levin
From: Leon Romanovsky [ Upstream commit efa968ee20248ebf8da8542f21d5d2811e86392f ] Remove the ib_is_destroyable_retryable() concept. The idea here was to allow the drivers to forcibly clean the HW object even if they otherwise didn't want to (eg because of usecnt). This was an attempt to clean

Re: [PATCH v2] tpm: Rework open/close/shutdown to avoid races

2020-12-17 Thread James Bottomley
On Tue, 2020-12-15 at 10:51 -0800, James Bottomley wrote: > On Tue, 2020-12-15 at 16:38 +0300, Sergey Temerkhanov wrote: > > Avoid race condition at shutdown by shutting downn the TPM 2.0 > > devices synchronously. This eliminates the condition when the > > shutdown sequence sets chip->ops to NULL

Re: [PATCH v2] tpm: Rework open/close/shutdown to avoid races

2020-12-15 Thread James Bottomley
On Tue, 2020-12-15 at 16:38 +0300, Sergey Temerkhanov wrote: > Avoid race condition at shutdown by shutting downn the TPM 2.0 > devices synchronously. This eliminates the condition when the > shutdown sequence sets chip->ops to NULL leading to the following: > > [ 1586.593561][ T8669] tpm2_del_spa

Re: [PATCH v2] tpm: Rework open/close/shutdown to avoid races

2020-12-15 Thread Jason Gunthorpe
On Tue, Dec 15, 2020 at 04:38:01PM +0300, Sergey Temerkhanov wrote: > Avoid race condition at shutdown by shutting downn the TPM 2.0 > devices synchronously. This eliminates the condition when the > shutdown sequence sets chip->ops to NULL leading to the following: > > [ 1586.593561][ T8669] tpm2_

Re: [PATCH v2] tpm: Rework open/close/shutdown to avoid races

2020-12-15 Thread kernel test robot
, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Sergey-Temerkhanov/tpm-Rework-open-close-shutdown-to-avoid-races/20201215-214304 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/cha

[PATCH v2] tpm: Rework open/close/shutdown to avoid races

2020-12-15 Thread Sergey Temerkhanov
Avoid race condition at shutdown by shutting downn the TPM 2.0 devices synchronously. This eliminates the condition when the shutdown sequence sets chip->ops to NULL leading to the following: [ 1586.593561][ T8669] tpm2_del_space+0x28/0x73 [ 1586.598718][ T8669] tpmrm_release+0x27/0x33wq [ 1586.60

Re: [PATCH][RFC] tpm: Rework open/close/shutdown to avoid races

2020-12-08 Thread Jarkko Sakkinen
On Fri, Dec 04, 2020 at 01:18:05PM +0300, Sergey Temerkhanov wrote: > Avoid race condition at shutdown by shutting downn the TPM 2.0 > devices synchronously. This eliminates the condition when the > shutdown sequence sets chip->ops to NULL leading to the following: > > [ 1586.593561][ T8669] tpm2_

[PATCH 5.4 04/39] net/tls: missing received data after fast remote close

2020-12-06 Thread Greg Kroah-Hartman
From: Vadim Fedorenko [ Upstream commit 20ffc7adf53a5fd3d19751fbff7895bcca66686e ] In case when tcp socket received FIN after some data and the parser haven't started before reading data caller will receive an empty buffer. This behavior differs from plain TCP socket and leads to special treatin

[PATCH 5.9 06/46] net/tls: missing received data after fast remote close

2020-12-06 Thread Greg Kroah-Hartman
From: Vadim Fedorenko [ Upstream commit 20ffc7adf53a5fd3d19751fbff7895bcca66686e ] In case when tcp socket received FIN after some data and the parser haven't started before reading data caller will receive an empty buffer. This behavior differs from plain TCP socket and leads to special treatin

[PATCH 4.19 03/32] net/tls: missing received data after fast remote close

2020-12-06 Thread Greg Kroah-Hartman
From: Vadim Fedorenko [ Upstream commit 20ffc7adf53a5fd3d19751fbff7895bcca66686e ] In case when tcp socket received FIN after some data and the parser haven't started before reading data caller will receive an empty buffer. This behavior differs from plain TCP socket and leads to special treatin

Re: [PATCH][RFC] tpm: Rework open/close/shutdown to avoid races

2020-12-04 Thread Jason Gunthorpe
On Fri, Dec 04, 2020 at 01:18:05PM +0300, Sergey Temerkhanov wrote: > Avoid race condition at shutdown by shutting downn the TPM 2.0 > devices synchronously. This eliminates the condition when the > shutdown sequence sets chip->ops to NULL leading to the following: > > [ 1586.593561][ T8669] tpm2_

[PATCH][RFC] tpm: Rework open/close/shutdown to avoid races

2020-12-04 Thread Sergey Temerkhanov
Avoid race condition at shutdown by shutting downn the TPM 2.0 devices synchronously. This eliminates the condition when the shutdown sequence sets chip->ops to NULL leading to the following: [ 1586.593561][ T8669] tpm2_del_space+0x28/0x73 [ 1586.598718][ T8669] tpmrm_release+0x27/0x33wq [ 1586.60

[PATCH 06/29] bus: mhi: Fix channel close issue on driver remove

2020-12-02 Thread Manivannan Sadhasivam
From: Loic Poulain Some MHI device drivers need to stop the channels in their driver remove callback (e.g. module unloading), but the unprepare function is aborted because MHI core moved the channels to suspended state prior calling driver remove callback. This prevents the driver to send a prope

Re: [PATCH 5/9] pstore/blk: simplify the block device open / close path

2020-12-01 Thread Kees Cook
On Fri, Oct 16, 2020 at 03:20:43PM +0200, Christoph Hellwig wrote: > Remove the pointless psblk_get_bdev and psblk_put_bdev helper, > and don't bother holding pstore_blk_lock over the block device > open / close interactions given that they only happen first thing > during mod

[PATCH v7 07/17] mm: Close race in generic_access_phys

2020-11-27 Thread Daniel Vetter
Way back it was a reasonable assumptions that iomem mappings never change the pfn range they point at. But this has changed: - gpu drivers dynamically manage their memory nowadays, invalidating ptes with unmap_mapping_range when buffers get moved - contiguous dma allocations have moved from ded

[PATCH 2/2] drivers:tty:pty: Fix a race causing data loss on close

2020-11-23 Thread minyard
From: Corey Minyard Remove the tty_vhangup() from the pty code and just release the redirect. The tty_vhangup() results in data loss and data out of order issues. If you write to a pty master an immediately close the pty master, the receiver might get a chunk of data dropped, but then receive

[PATCH 0/2] drivers:tty:pty: Fix a race causing data loss on close

2020-11-23 Thread minyard
s a console redirect to the pty slave. When you close the master, you need to release the redirect. I didn't see another reason for tty_vhangup(). So this has two parts, export the release of the tty redirect release for the pty code to use, and call it from the pty code. With this change, ev

[PATCH 5.4 073/158] tools, bpftool: Add missing close before bpftool net attach exit

2020-11-23 Thread Greg Kroah-Hartman
if (ifindex < 1) { - close(progfd); - return -EINVAL; + err = -EINVAL; + goto cleanup; } if (argc) { @@ -321,8 +321,8 @@ static int do_attach(int argc, char **argv) overwrite = true; } else {

[PATCH 5.9 126/252] tools, bpftool: Add missing close before bpftool net attach exit

2020-11-23 Thread Greg Kroah-Hartman
if (ifindex < 1) { - close(progfd); - return -EINVAL; + err = -EINVAL; + goto cleanup; } if (argc) { @@ -322,8 +322,8 @@ static int do_attach(int argc, char **argv) overwrite = true; } else {

Re: [PATCH] NFS: Retry the CLOSE if the embedded GETATTR is rejected with ERR_STALE

2020-11-19 Thread Anchal Agarwal
ow the content is safe. > > > > > > > > > > > > On Wed, 2020-11-18 at 00:24 +, Anchal Agarwal wrote: > > > > If our CLOSE RPC call is rejected with an ERR_STALE error, then > > > > we > > > > should remove the GETATTR call fr

[PATCH v6 07/17] mm: Close race in generic_access_phys

2020-11-19 Thread Daniel Vetter
Way back it was a reasonable assumptions that iomem mappings never change the pfn range they point at. But this has changed: - gpu drivers dynamically manage their memory nowadays, invalidating ptes with unmap_mapping_range when buffers get moved - contiguous dma allocations have moved from ded

Re: [PATCH] NFS: Retry the CLOSE if the embedded GETATTR is rejected with ERR_STALE

2020-11-18 Thread Trond Myklebust
d know the content is safe. > > > > > > > > On Wed, 2020-11-18 at 00:24 +0000, Anchal Agarwal wrote: > > > If our CLOSE RPC call is rejected with an ERR_STALE error, then > > > we > > > should remove the GETATTR call from the compound RPC and

Re: [PATCH] NFS: Retry the CLOSE if the embedded GETATTR is rejected with ERR_STALE

2020-11-18 Thread Anchal Agarwal
t 00:24 +, Anchal Agarwal wrote: > > If our CLOSE RPC call is rejected with an ERR_STALE error, then we > > should remove the GETATTR call from the compound RPC and retry. > > This could happen in a scenario where two clients tries to access > > the same file. One clien

Re: [PATCH] NFS: Retry the CLOSE if the embedded GETATTR is rejected with ERR_STALE

2020-11-17 Thread Trond Myklebust
On Wed, 2020-11-18 at 00:24 +, Anchal Agarwal wrote: > If our CLOSE RPC call is rejected with an ERR_STALE error, then we > should remove the GETATTR call from the compound RPC and retry. > This could happen in a scenario where two clients tries to access > the same file. One clie

[PATCH] NFS: Retry the CLOSE if the embedded GETATTR is rejected with ERR_STALE

2020-11-17 Thread Anchal Agarwal
If our CLOSE RPC call is rejected with an ERR_STALE error, then we should remove the GETATTR call from the compound RPC and retry. This could happen in a scenario where two clients tries to access the same file. One client opens the file and the other client removes the file while it's open

Re: [PATCH v4 bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-13 Thread Daniel Borkmann
On 11/13/20 12:51 PM, Wang Hai wrote: progfd is created by prog_parse_fd(), before 'bpftool net attach' exit, it should be closed. Fixes: 04949ccc273e ("tools: bpftool: add net attach command to attach XDP on interface") Signed-off-by: Wang Hai Applied & improved commit msg a bit, thanks!

[PATCH v4 bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-13 Thread Wang Hai
s/bpf/bpftool/net.c +++ b/tools/bpf/bpftool/net.c @@ -578,8 +578,8 @@ static int do_attach(int argc, char **argv) ifindex = net_parse_dev(&argc, &argv); if (ifindex < 1) { - close(progfd); - return -EINVAL; + err = -EINVAL

Re: [PATCH v3 bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-11 Thread Andrii Nakryiko
; @@ -578,8 +578,8 @@ static int do_attach(int argc, char **argv) > > > > ifindex = net_parse_dev(&argc, &argv); > > if (ifindex < 1) { > > - close(progfd); > > - return -EINVAL; > > + err = -EINVAL; > > +

Re: [PATCH v3 bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-11 Thread Andrii Nakryiko
; > index 910e7bac6e9e..f927392271cc 100644 > > > --- a/tools/bpf/bpftool/net.c > > > +++ b/tools/bpf/bpftool/net.c > > > @@ -578,8 +578,8 @@ static int do_attach(int argc, char **argv) > > > > > > ifindex = net_parse_dev(&argc, &argv); >

Re: [PATCH v3 bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-11 Thread Daniel Borkmann
/tools/bpf/bpftool/net.c +++ b/tools/bpf/bpftool/net.c @@ -578,8 +578,8 @@ static int do_attach(int argc, char **argv) ifindex = net_parse_dev(&argc, &argv); if (ifindex < 1) { - close(progfd); - return -EINVAL; + err = -EINVAL; +

Re: [PATCH v3 bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-11 Thread Michal Rostecki
/tools/bpf/bpftool/net.c +++ b/tools/bpf/bpftool/net.c @@ -578,8 +578,8 @@ static int do_attach(int argc, char **argv) ifindex = net_parse_dev(&argc, &argv); if (ifindex < 1) { - close(progfd); - return -EINVAL; + err = -EINVAL; +

[PATCH v3 bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-11 Thread Wang Hai
s/bpf/bpftool/net.c @@ -578,8 +578,8 @@ static int do_attach(int argc, char **argv) ifindex = net_parse_dev(&argc, &argv); if (ifindex < 1) { - close(progfd); - return -EINVAL; + err = -EINVAL; + goto cleanup; }

Re: [PATCH v2 bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-11 Thread John Fastabend
t 'err > 0' doesn't exist currently , but adding 'err = 0' > would make the code clearer. Thanks for your advice. > >> +cleanup: > >> + close(progfd); > >> + return err; > >> } > >> > >> static int do_det

Re: [PATCH v2 bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-10 Thread wanghai (M)
bpftool/net.c @@ -578,8 +578,8 @@ static int do_attach(int argc, char **argv) ifindex = net_parse_dev(&argc, &argv); if (ifindex < 1) { - close(progfd); - return -EINVAL; + err = -EINVAL; + goto cleanup; }

RE: [PATCH v2 bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-09 Thread John Fastabend
et.c > +++ b/tools/bpf/bpftool/net.c > @@ -578,8 +578,8 @@ static int do_attach(int argc, char **argv) > > ifindex = net_parse_dev(&argc, &argv); > if (ifindex < 1) { > - close(progfd); > - return -EINVAL; > +

Re: [PATCH bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-09 Thread wanghai (M)
nt argc, char **argv)   if (err < 0) {   p_err("interface %s attach failed: %s",     attach_type_strings[attach_type], strerror(-err)); +    close(progfd);   return err;   }     if (json_output)       jsonw_null(json_wtr);   +    close(p

[PATCH v2 bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-09 Thread Wang Hai
h(int argc, char **argv) ifindex = net_parse_dev(&argc, &argv); if (ifindex < 1) { - close(progfd); - return -EINVAL; + err = -EINVAL; + goto cleanup; } if (argc) { @@ -587,8 +587,8 @@ static i

Re: [PATCH bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-09 Thread John Fastabend
--- a/tools/bpf/bpftool/net.c > > +++ b/tools/bpf/bpftool/net.c > > @@ -600,12 +600,14 @@ static int do_attach(int argc, char **argv) > > if (err < 0) { > > p_err("interface %s attach failed: %s", > > attach

Re: [PATCH bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-09 Thread Michal Rostecki
{ p_err("interface %s attach failed: %s", attach_type_strings[attach_type], strerror(-err)); + close(progfd); return err; } if (json_output) jsonw_null(json_wtr); + close(progfd); ret

Re: [PATCH bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-09 Thread Quentin Monnet
On 09/11/2020 07:04, Wang Hai wrote: > progfd is created by prog_parse_fd(), before 'bpftool net attach' exit, > it should be closed. > > Fixes: 04949ccc273e ("tools: bpftool: add net attach command to attach XDP on > interface") > Signed-off-by: Wang Hai Reviewed-by: Quentin Monnet Thanks! Q

[PATCH bpf] tools: bpftool: Add missing close before bpftool net attach exit

2020-11-08 Thread Wang Hai
terface %s attach failed: %s", attach_type_strings[attach_type], strerror(-err)); + close(progfd); return err; } if (json_output) jsonw_null(json_wtr); + close(progfd); return 0; } -- 2.17.1

[PATCH 5.4 164/214] NFSv4: Wait for stateid updates after CLOSE/OPEN_DOWNGRADE

2020-11-03 Thread Greg Kroah-Hartman
From: Benjamin Coddington commit b4868b44c5628995fdd8ef2e24dda73cef963a75 upstream. Since commit 0e0cb35b417f ("NFSv4: Handle NFS4ERR_OLD_STATEID in CLOSE/OPEN_DOWNGRADE") the following livelock may occur if a CLOSE races with the update of the nfs_state: Process 1

[PATCH 5.9 300/391] NFSv4: Wait for stateid updates after CLOSE/OPEN_DOWNGRADE

2020-11-03 Thread Greg Kroah-Hartman
From: Benjamin Coddington commit b4868b44c5628995fdd8ef2e24dda73cef963a75 upstream. Since commit 0e0cb35b417f ("NFSv4: Handle NFS4ERR_OLD_STATEID in CLOSE/OPEN_DOWNGRADE") the following livelock may occur if a CLOSE races with the update of the nfs_state: Process 1

[PATCH v5 07/15] mm: Close race in generic_access_phys

2020-10-30 Thread Daniel Vetter
Way back it was a reasonable assumptions that iomem mappings never change the pfn range they point at. But this has changed: - gpu drivers dynamically manage their memory nowadays, invalidating ptes with unmap_mapping_range when buffers get moved - contiguous dma allocations have moved from ded

Re: [PATCH] drm/panfrost: Don't corrupt the queue mutex on open/close

2020-10-30 Thread Boris Brezillon
On Thu, 29 Oct 2020 17:00:47 + Steven Price wrote: > The mutex within the panfrost_queue_state should have the lifetime of > the queue, however it was erroneously initialised/destroyed during > panfrost_job_{open,close} which is called every time a client > opens/closes

  1   2   3   4   5   6   7   8   9   10   >