Skip to content

Commit 32a4629

Browse files
author
CKI KWF Bot
committed
Merge: CVE-2023-52922 can: bcm: Fix UAF in bcm_proc_show() [rhel-9.6]
MR: https://gitlab.com/redhat/rhel/src/kernel/rhel-9/-/merge_requests/3455 JIRA: https://issues.redhat.com/browse/RHEL-80748 CVE: CVE-2023-52922 Signed-off-by: Michal Schmidt <[email protected]> Approved-by: Radu Rendec <[email protected]> Approved-by: Marc Milgram <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: CKI KWF Bot <[email protected]>
2 parents 8381130 + 01877f2 commit 32a4629

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

net/can/bcm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,12 @@ static int bcm_release(struct socket *sock)
15111511

15121512
lock_sock(sk);
15131513

1514+
#if IS_ENABLED(CONFIG_PROC_FS)
1515+
/* remove procfs entry */
1516+
if (net->can.bcmproc_dir && bo->bcm_proc_read)
1517+
remove_proc_entry(bo->procname, net->can.bcmproc_dir);
1518+
#endif /* CONFIG_PROC_FS */
1519+
15141520
list_for_each_entry_safe(op, next, &bo->tx_ops, list)
15151521
bcm_remove_op(op);
15161522

@@ -1546,12 +1552,6 @@ static int bcm_release(struct socket *sock)
15461552
list_for_each_entry_safe(op, next, &bo->rx_ops, list)
15471553
bcm_remove_op(op);
15481554

1549-
#if IS_ENABLED(CONFIG_PROC_FS)
1550-
/* remove procfs entry */
1551-
if (net->can.bcmproc_dir && bo->bcm_proc_read)
1552-
remove_proc_entry(bo->procname, net->can.bcmproc_dir);
1553-
#endif /* CONFIG_PROC_FS */
1554-
15551555
/* remove device reference */
15561556
if (bo->bound) {
15571557
bo->bound = 0;

0 commit comments

Comments
 (0)