Rao Shoaib
a6736a0add
af_unix: Read with MSG_PEEK loops if the first unread byte is OOB
Read with MSG_PEEK flag loops if the first byte to read is an OOB byte.
commit 22dd70eb2c ("af_unix: Don't peek OOB data without MSG_OOB.")
addresses the loop issue but does not address the issue that no data
beyond OOB byte can be read.
>>> from socket import *
>>> c1, c2 = socketpair(AF_UNIX, SOCK_STREAM)
>>> c1.send(b'a', MSG_OOB)
1
>>> c1.send(b'b')
1
>>> c2.recv(1, MSG_PEEK | MSG_DONTWAIT)
b'b'
>>> from socket import *
>>> c1, c2 = socketpair(AF_UNIX, SOCK_STREAM)
>>> c2.setsockopt(SOL_SOCKET, SO_OOBINLINE, 1)
>>> c1.send(b'a', MSG_OOB)
1
>>> c1.send(b'b')
1
>>> c2.recv(1, MSG_PEEK | MSG_DONTWAIT)
b'a'
>>> c2.recv(1, MSG_PEEK | MSG_DONTWAIT)
b'a'
>>> c2.recv(1, MSG_DONTWAIT)
b'a'
>>> c2.recv(1, MSG_PEEK | MSG_DONTWAIT)
b'b'
>>>
Fixes: 314001f0bf ("af_unix: Add OOB support")
Signed-off-by: Rao Shoaib <Rao.Shoaib@oracle.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20240611084639.2248934-1-Rao.Shoaib@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-06-13 08:03:55 -07:00
..
2024-02-09 14:12:01 -08:00
2024-05-29 09:25:15 -07:00
2023-10-28 11:29:28 +01:00
2024-05-07 16:19:14 -07:00
2024-05-09 10:01:01 -07:00
2024-05-13 18:19:09 -06:00
2024-06-01 15:49:42 -07:00
2024-05-22 20:14:47 -04:00
2024-06-10 09:48:30 -04:00
2024-06-05 09:41:33 +02:00
2024-06-12 18:24:24 -07:00
2024-04-02 18:20:00 -07:00
2024-02-20 15:32:45 +01:00
2024-03-06 12:43:01 +01:00
2024-06-05 12:34:54 +01:00
2024-05-07 16:15:08 -07:00
2024-04-22 13:05:19 -07:00
2024-01-11 10:07:29 -08:00
2024-05-22 20:14:47 -04:00
2024-05-25 10:48:57 -07:00
2024-06-06 13:34:33 +02:00
2024-04-16 17:14:55 -07:00
2024-05-09 10:01:01 -07:00
2024-05-22 20:14:47 -04:00
2023-12-15 10:50:18 +00:00
2024-06-10 19:50:10 -07:00
2024-06-12 17:51:35 -07:00
2024-05-21 12:09:36 -07:00
2024-03-11 09:53:22 +00:00
2024-02-09 14:12:01 -08:00
2024-05-17 12:15:22 -07:00
2024-05-13 18:19:09 -06:00
2024-05-29 15:58:54 +02:00
2024-03-06 21:01:26 +01:00
2024-02-29 14:24:56 -08:00
2024-05-03 13:29:41 +01:00
2024-06-10 19:49:10 -07:00
2024-06-01 16:21:44 -07:00
2024-06-11 18:46:04 +02:00
2024-05-13 14:58:12 -07:00
2024-04-23 10:09:49 -07:00
2024-05-18 10:32:39 -07:00
2024-05-23 12:49:37 -07:00
2024-04-26 12:20:01 +02:00
2024-05-23 12:49:37 -07:00
2024-05-16 19:38:05 -07:00
2024-05-13 18:19:09 -06:00
2024-04-01 10:49:28 +01:00
2024-05-16 09:47:45 +01:00
2024-05-13 18:19:09 -06:00
2024-03-25 15:40:22 +01:00
2024-05-13 18:19:09 -06:00
2024-05-09 10:01:01 -07:00
2024-06-10 19:36:49 -07:00
2024-05-13 18:19:09 -06:00
2024-06-05 09:42:57 +01:00
2024-05-23 13:51:09 -07:00
2024-05-08 12:19:12 +01:00
2024-05-22 20:14:47 -04:00
2024-05-23 12:03:26 +02:00
2024-06-13 08:03:55 -07:00
2024-05-23 12:04:36 -07:00
2024-05-29 15:25:25 +02:00
2024-05-13 18:19:09 -06:00
2024-06-05 09:42:30 +02:00
2024-05-29 17:34:49 -07:00
2023-12-12 14:24:14 +01:00
2024-05-08 10:35:09 +01:00
2024-01-31 16:41:16 -08:00
2024-05-13 18:19:19 -06:00
2024-04-24 09:43:54 +02:00