Skip to content

Commit 666c135

Browse files
committed
Merge branch 'tun-tap-uid'
Laszlo Ersek says: ==================== tun/tap: set sk_uid from current_fsuid() The original patches fixing CVE-2023-1076 are incorrect in my opinion. This small series fixes them up; see the individual commit messages for explanation. I have a very elaborate test procedure demonstrating the problem for both tun and tap; it involves libvirt, qemu, and "crash". I can share that procedure if necessary, but it's indeed quite long (I wrote it originally for our QE team). The patches in this series are supposed to "re-fix" CVE-2023-1076; given that said CVE is classified as Low Impact (CVSSv3=5.5), I'm posting this publicly, and not suggesting any embargo. Red Hat Product Security may assign a new CVE number later. I've tested the patches on top of v6.5-rc4, with "crash" built at commit c74f375e0ef7. Cc: Eric Dumazet <edumazet@google.com> Cc: Lorenzo Colitti <lorenzo@google.com> Cc: Paolo Abeni <pabeni@redhat.com> Cc: Pietro Borrello <borrello@diag.uniroma1.it> Cc: netdev@vger.kernel.org Cc: stable@vger.kernel.org ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 31d49ba + 5c9241f commit 666c135

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/net/tap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static int tap_open(struct inode *inode, struct file *file)
534534
q->sock.state = SS_CONNECTED;
535535
q->sock.file = file;
536536
q->sock.ops = &tap_socket_ops;
537-
sock_init_data_uid(&q->sock, &q->sk, inode->i_uid);
537+
sock_init_data_uid(&q->sock, &q->sk, current_fsuid());
538538
q->sk.sk_write_space = tap_sock_write_space;
539539
q->sk.sk_destruct = tap_sock_destruct;
540540
q->flags = IFF_VNET_HDR | IFF_NO_PI | IFF_TAP;

drivers/net/tun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3469,7 +3469,7 @@ static int tun_chr_open(struct inode *inode, struct file * file)
34693469
tfile->socket.file = file;
34703470
tfile->socket.ops = &tun_socket_ops;
34713471

3472-
sock_init_data_uid(&tfile->socket, &tfile->sk, inode->i_uid);
3472+
sock_init_data_uid(&tfile->socket, &tfile->sk, current_fsuid());
34733473

34743474
tfile->sk.sk_write_space = tun_sock_write_space;
34753475
tfile->sk.sk_sndbuf = INT_MAX;

0 commit comments

Comments
 (0)