Re: [Bug 264848] mpr0: mpr_user_pass_thru: user reply buffer (64) smaller than returned buffer (68)

From: Scott Long <scottl_at_samsco.org>
Date: Tue, 05 Jul 2022 19:31:14 UTC
Your patch is better than what was originally there.  However, i made the original test simplistic and specific because when the msgVer changes in the firmware, unknown parts of the API are also changing, and the software should be aware of those changes, rather than blindly accepting them.  In essence, this was meant to be a reminder to obtain new specs and adapt code whenever future changes happened.

Scott

> On Jul 5, 2022, at 10:41 AM, Mark Johnston <markj@freebsd.org> wrote:
> 
> On Tue, Jul 05, 2022 at 08:42:20AM -0600, Scott Long wrote:
>> I’ve lost my bugzilla password, and it seems that the “Forgot Password” functionality doesn’t work.
> 
> I think it works differently for @freebsd.org accounts, you have to
> reset your cluster password:
> https://docs.freebsd.org/en/articles/committers-guide/#kerberos-ldap
> 
>> Anyways...
>> 
>> The problems is here in mps_get_iocfacts()
>> 
>>        snprintf(sysctlname, sizeof(sysctlname), "dev.%s.%d.msg_version",
>>            is_mps ? "mps" : "mpr", mps_unit);
>> 
>>        factslen = sizeof(MPI2_IOC_FACTS_REPLY);
>>        len = sizeof(msgver);
>>        error = sysctlbyname(sysctlname, msgver, &len, NULL, 0);
>>        if (error == 0) {
>>                if (strncmp(msgver, "2.6", sizeof(msgver)) == 0)
>>                        factslen += 4;
>>        }
>> 
>> I haven’t been keeping track, but I’ll guess that msgver has numerically advanced past “2.6” for this system.
> 
> Thanks, that makes perfect sense.  I attached a patch to the PR but
> can't test it myself.
> 
> Julian, if you're able to test patches, could you please try the one in
> the PR and confirm that the warnings stop appearing?  It'd also be
> useful to see the value of the dev.mpr.0.msg_version sysctl.
>