Skip to content

Commit 3e0f5d4

Browse files
committed
tty: n_gsm: fix wrong DLCI release order
jira VULN-676 cve-pre CVE-2023-6546 commit-author Daniel Starke <daniel.starke@siemens.com> commit deefc58 The current DLCI release order starts with the control channel followed by the user channels. Reverse this order to keep the control channel open until all user channels have been released. Fixes: e1eaea4 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke <daniel.starke@siemens.com> Link: https://lore.kernel.org/r/20220414094225.4527-9-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit deefc58) Signed-off-by: David Gomez <dgomez@ciq.com>
1 parent b696346 commit 3e0f5d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/n_gsm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,8 +2079,8 @@ static void gsm_cleanup_mux(struct gsm_mux *gsm, bool disc)
20792079
if (i == MAX_MUX)
20802080
return;
20812081

2082-
/* Free up any link layer users */
2083-
for (i = 0; i < NUM_DLCI; i++)
2082+
/* Free up any link layer users and finally the control channel */
2083+
for (i = NUM_DLCI - 1; i >= 0; i--)
20842084
if (gsm->dlci[i])
20852085
gsm_dlci_release(gsm->dlci[i]);
20862086
mutex_unlock(&gsm->mutex);

0 commit comments

Comments
 (0)