The branch main has been updated by vmaffione:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=3e3314a8b7e3dd8d19a209ee2988f724e138a0ae

commit 3e3314a8b7e3dd8d19a209ee2988f724e138a0ae
Author:     Vincenzo Maffione <vmaffi...@freebsd.org>
AuthorDate: 2021-09-26 13:56:33 +0000
Commit:     Vincenzo Maffione <vmaffi...@freebsd.org>
CommitDate: 2021-09-26 13:56:33 +0000

    netmap: fix uint32_t overflow in pool size calculation
    
    MFC after:      1 week
---
 sys/dev/netmap/netmap_mem2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/netmap/netmap_mem2.c b/sys/dev/netmap/netmap_mem2.c
index a6be490e5b09..2b41af761c04 100644
--- a/sys/dev/netmap/netmap_mem2.c
+++ b/sys/dev/netmap/netmap_mem2.c
@@ -1702,7 +1702,7 @@ _netmap_mem_private_new(size_t size, struct 
netmap_obj_params *p, int grp_id,
                                nm_blueprint.pools[i].name,
                                d->name);
                if (checksz) {
-                       uint64_t poolsz = p[i].num * p[i].size;
+                       uint64_t poolsz = (uint64_t)p[i].num * p[i].size;
                        if (memtotal < poolsz) {
                                nm_prerr("%s: request too large", 
d->pools[i].name);
                                err = ENOMEM;
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to