NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/56355: dtrace triggers double-fault in supervisor mode
The following reply was made to PR kern/56355; it has been noted by GNATS.
From: bch <brad.harder%gmail.com@localhost>
To: Taylor R Campbell <riastradh%netbsd.org@localhost>
Cc: gnats-bugs%netbsd.org@localhost
Subject: Re: kern/56355: dtrace triggers double-fault in supervisor mode
Date: Sun, 15 Aug 2021 09:05:52 -0700
--000000000000eecb1f05c99b42f0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Sun, Aug 15, 2021 at 08:10 Taylor R Campbell <riastradh%netbsd.org@localhost>
wrote:
> > Date: Sun, 15 Aug 2021 15:08:11 +0000
> > From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
> >
> > > Date: Tue, 10 Aug 2021 13:26:08 -0700
> > > From: bch <brad.harder%gmail.com@localhost>
> > >
> > > @@ -251,8 +251,9 @@
> > > /*
> > > * Exclude some more symbols which can be called from probe
> context.
> > > */
> > > - if (strcmp(name, "x86_curcpu") =3D=3D 0 ||
> > > - strcmp(name, "x86_curlwp") =3D=3D 0) {
> > > + if (strncmp(name, "x86_curcpu", 10) =3D=3D 0 ||
> > > + strncmp(name, "trap", 4) =3D=3D 0 ||
> > > + strncmp(name, "x86_curlwp", 10) =3D=3D 0) {
> > > return 0;
> >
> > This patch changes the semantics of the code so that it excludes any
> > names that _start_ with `trap', `x86_curcpu', or `x86_curlwp', such as
> > `trapsignal'. The use of strncmp instead of strcmp should be restored
> > (and the list should maybe be sorted lexicographically).
>
> Errr, I mean: this code should use strcmp, not strncmp.
If you read through to the MI exclusion code at fbt_exclude(), it=E2=80=99s=
using
strncmp(). Should that be changed too, or otherwise, why pick strcmp() v
strncmp()?
-bch
>
--000000000000eecb1f05c99b42f0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div><br></div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=
=3D"gmail_attr">On Sun, Aug 15, 2021 at 08:10 Taylor R Campbell <<a href=
=3D"mailto:riastradh%netbsd.org@localhost">riastradh%netbsd.org@localhost</a>> wrote:<br></d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-colo=
r:rgb(204,204,204)" dir=3D"auto">> Date: Sun, 15 Aug 2021 15:08:11 +0000=
<br>
> From: Taylor R Campbell <riastradh%NetBSD.org@localhost><br>
> <br>
> > Date: Tue, 10 Aug 2021 13:26:08 -0700<br>
> > From: bch <<a href=3D"mailto:brad.harder%gmail.com@localhost" target=3D"=
_blank">brad.harder%gmail.com@localhost</a>><br>
> > <br>
> > @@ -251,8 +251,9 @@<br>
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/*<br>
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * Exclude some more symbols whi=
ch can be called from probe context.<br>
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */<br>
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0if (strcmp(name, "x86_curcpu&quo=
t;) =3D=3D 0 ||<br>
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0strcmp(name, "x86_=
curlwp") =3D=3D 0) {<br>
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0if (strncmp(name, "x86_curcpu&qu=
ot;, 10) =3D=3D 0 ||<br>
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0strncmp(name, "tra=
p", 4) =3D=3D 0 ||<br>
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0strncmp(name, "x86=
_curlwp", 10) =3D=3D 0) {<br>
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0retu=
rn 0;<br>
> <br>
> This patch changes the semantics of the code so that it excludes any<b=
r>
> names that _start_ with `trap', `x86_curcpu', or `x86_curlwp&#=
39;, such as<br>
> `trapsignal'.=C2=A0 The use of strncmp instead of strcmp should be=
restored<br>
> (and the list should maybe be sorted lexicographically).<br>
<br>
Errr, I mean: this code should use strcmp, not strncmp.=C2=A0</blockquote><=
div dir=3D"auto"><br></div><div dir=3D"auto">If you read through to the MI =
exclusion code at fbt_exclude(), it=E2=80=99s using strncmp(). Should that =
be changed too, or otherwise, why pick strcmp() v strncmp()?</div><div dir=
=3D"auto"><br></div><div dir=3D"auto"><br></div><div dir=3D"auto">-bch</div=
><div dir=3D"auto"><br></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding=
-left:1ex;border-left-color:rgb(204,204,204)" dir=3D"auto"><br>
</blockquote></div></div>
--000000000000eecb1f05c99b42f0--
Home |
Main Index |
Thread Index |
Old Index