Unverified Commit 0c5d5a06 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!3989 [sync] PR-3668: net/rose: Fix Use-After-Free in rose_ioctl

parents d4462587 07b30bbe
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1299,9 +1299,11 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
	case TIOCINQ: {
		struct sk_buff *skb;
		long amount = 0L;
		/* These two are safe on a single CPU system as only user tasks fiddle here */

		spin_lock_irq(&sk->sk_receive_queue.lock);
		if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
			amount = skb->len;
		spin_unlock_irq(&sk->sk_receive_queue.lock);
		return put_user(amount, (unsigned int __user *) argp);
	}