⬢ DragonFlyBSD Kernel Audit
DF-5679 / fix.diff
← back to finding ↓ download raw
--- a/sys/libkern/icrc32.c	2026-10-09 23:17:52.442215110 +0000
+++ b/sys/libkern/icrc32.c	2026-10-09 23:18:51.085455742 +0000
@@ -13,7 +13,7 @@
 uint32_t iscsi_crc32(const void *buf, size_t size);
 uint32_t iscsi_crc32_ext(const void *buf, size_t size, uint32_t ocrc);
 uint32_t calculate_crc32c(uint32_t crc32c, const unsigned char *buffer,
-			unsigned int length);
+			size_t length);
 #endif
 
 /*
@@ -683,13 +683,13 @@
 static uint32_t
 crc32c_sb8_64_bit(uint32_t crc,
     const unsigned char *p_buf,
-    uint32_t length,
-    uint32_t init_bytes)
+    size_t length,
+    size_t init_bytes)
 {
-	uint32_t li;
+	size_t li;
 	uint32_t term1, term2;
-	uint32_t running_length;
-	uint32_t end_bytes;
+	size_t running_length;
+	size_t end_bytes;
 
 	running_length = rounddown(length - init_bytes, 8);
 	end_bytes = length - init_bytes - running_length;
@@ -740,9 +740,9 @@
 static uint32_t
 multitable_crc32c(uint32_t crc32c,
     const unsigned char *buffer,
-    unsigned int length)
+    size_t length)
 {
-	uint32_t to_even_word;
+	size_t to_even_word;
 
 	if (length == 0) {
 		return (crc32c);
@@ -760,7 +760,7 @@
 uint32_t
 calculate_crc32c(uint32_t crc32c,
     const unsigned char *buffer,
-    unsigned int length)
+    size_t length)
 {
 	if (length < 4) {
 		return (singletable_crc32c(crc32c, buffer, length));
--- a/sys/sys/systm.h	2026-10-09 23:17:52.446215058 +0000
+++ b/sys/sys/systm.h	2026-10-09 23:18:01.274100748 +0000
@@ -205,7 +205,7 @@
 uint32_t iscsi_crc32(const void *buf, size_t size);
 uint32_t iscsi_crc32_ext(const void *buf, size_t size, uint32_t ocrc);
 uint32_t calculate_crc32c(uint32_t crc32c, const unsigned char *buffer,
-			unsigned int length);
+			size_t length);
 
 void	init_param1 (void);
 void	init_param2 (int physpages);