Skip to content

Commit 5da472a

Browse files
committed
Merge tag 'v6.15-p7' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "This fixes a regression in padata as well as an ancient double-free bug in af_alg" * tag 'v6.15-p7' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: algif_hash - fix double free in hash_accept padata: do not leak refcount in reorder_work
2 parents b36ddb9 + b2df03e commit 5da472a

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

crypto/algif_hash.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,6 @@ static int hash_accept(struct socket *sock, struct socket *newsock,
265265
goto out_free_state;
266266

267267
err = crypto_ahash_import(&ctx2->req, state);
268-
if (err) {
269-
sock_orphan(sk2);
270-
sock_put(sk2);
271-
}
272268

273269
out_free_state:
274270
kfree_sensitive(state);

kernel/padata.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ static void padata_reorder(struct parallel_data *pd)
358358
* To avoid UAF issue, add pd ref here, and put pd ref after reorder_work finish.
359359
*/
360360
padata_get_pd(pd);
361-
queue_work(pinst->serial_wq, &pd->reorder_work);
361+
if (!queue_work(pinst->serial_wq, &pd->reorder_work))
362+
padata_put_pd(pd);
362363
}
363364
}
364365

0 commit comments

Comments
 (0)