Discussion:
[Bug 264848] mpr0: mpr_user_pass_thru: user reply buffer (64) smaller than returned buffer (68)
(too old to reply)
b***@freebsd.org
2022-07-04 14:08:24 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264848

Mark Johnston <***@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Assignee|***@FreeBSD.org |***@FreeBSD.org
Status|New |Open
CC| |***@FreeBSD.org

--- Comment #2 from Mark Johnston <***@FreeBSD.org> ---
It means that some userspace program is sending a command to the controller
firmware, but provided too small a buffer for the response. The first step is
to figure out which program (mprutil?) is triggering the problem.
--
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2022-07-05 14:07:56 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264848

--- Comment #3 from Julien Cigar <***@perdition.city> ---
Hi Mark,

Thanks for replying, and you're right: mprutil is the culprit..!
--
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2022-07-05 14:15:48 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264848

--- Comment #4 from Mark Johnston <***@FreeBSD.org> ---
(In reply to Julien Cigar from comment #3)
Which subcommand is it that's triggering the warning?
--
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2022-07-05 14:26:19 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264848

--- Comment #5 from Julien Cigar <***@perdition.city> ---
show all, show adapters, ...

(It's a new machine and I haven't used other subcommands yet)
--
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Scott Long
2022-07-05 14:42:20 UTC
Permalink
I’ve lost my bugzilla password, and it seems that the “Forgot Password” functionality doesn’t work.

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.

Scott
Post by b***@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264848
show all, show adapters, ...
(It's a new machine and I haven't used other subcommands yet)
--
You are the assignee for the bug.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2022-07-05 16:37:52 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264848

--- Comment #6 from Mark Johnston <***@FreeBSD.org> ---
Created attachment 235088
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=235088&action=edit
proposed patch

Patch for an issue pointed out by Scott:

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.
--
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Scott Long
2022-07-05 19:31:14 UTC
Permalink
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
Post by Scott Long
I’ve lost my bugzilla password, and it seems that the “Forgot Password” functionality doesn’t work.
https://docs.freebsd.org/en/articles/committers-guide/#kerberos-ldap
Post by Scott Long
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.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...