[Bug 281938] [PATCH] Make sure max_len is not 0 before using it as modulo

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 08 Oct 2024 10:14:36 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281938

            Bug ID: 281938
           Summary: [PATCH] Make sure max_len is not 0 before using it as
                    modulo
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: nakayamakenjiro@gmail.com

Created attachment 254089
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=254089&action=edit
proposal patch

In tcp_default_output(), max_len is calculated and used as modulo:

```
        max_len = tp->t_maxseg - optlen - ipsec_optlen;
              ...
              moff = len % max_len;
```

optlen and ipsec_optlen are variables and depend on the options, so it
should be checked if max_len is not zero.

-- 
You are receiving this mail because:
You are the assignee for the bug.