Skip to content

Commit 3100761

Browse files
RoundofThreebsdjhb
authored andcommitted
netgraph: Fix CHERI tag violations due to tight subobject bounds in sockaddr_* structs
1 parent 60fed0d commit 3100761

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sys/netgraph/bluetooth/include/ng_btsocket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
struct sockaddr_hci {
5252
u_char hci_len; /* total length */
5353
u_char hci_family; /* address family */
54-
char hci_node[32]; /* address (size == NG_NODESIZ ) */
54+
char hci_node[32] __subobject_variable_length_maxsize(32); /* address (size == NG_NODESIZ ) */
5555
};
5656

5757
/* Raw HCI socket options */

sys/netgraph/ng_socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ enum {
6060
struct sockaddr_ng {
6161
unsigned char sg_len; /* total length */
6262
sa_family_t sg_family; /* address family */
63-
char sg_data[32]; /* see NG_NODESIZ in ng_message.h */
63+
char sg_data[32] __subobject_variable_length_maxsize(32); /* see NG_NODESIZ in ng_message.h */
6464
};
6565

6666
#endif /* _NETGRAPH_NG_SOCKET_H_ */

0 commit comments

Comments
 (0)