-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AP_Stats: Ignore fraudulent posts #18792
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense, maybe we should also mark all the parameters as AP_PARAM_FLAG_INTERNAL_USE_ONLY ?
@khancyr san. |
In the old days we used boot_count=0 to trigger a factory reset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@muramura this should also be marked as @ReadOnly
in the parameter metadata
As far as I can see this PR simply doesn't work; I can reset the parameters just fine. The crucial thing with flttime and runtime is that these stats are updated within the stats library so are periodically rewritten. Technically there's a race condition between someone setting the parameters by hand and us writing fresh statistics out. This wasn't ever supposed to be protection against malicious actors....
We should probably add the internal-use-only flag as @khancyr suggests. Note that still won't stop users changing the parameter if they really want to - it makes it less likely to be overwritten, 'though.
AFAIK ArduPilot's never done that :-) |
@amilcarlucas I think you're one of the few people who've provided feedback on stats. Do you see any problems in disallowing the set of |
Hello Peter. No, I see no drawbacks. I think it should have been a read-only parameter since day one. I actually have a PR that only changes the stats only on very specific circunstances:
but that never got merged. |
This approach is flawed. There's a race condition between the user writing the parameter and this code triggering, setting the thing back to the expected value. As @amilcarlucas points out, this could probably be set to @readonly. I'm going to close this one, but a PR along the other lines might be good. |
I was able to set the BOOT COUNT in APM PLANNER2.
I was not able to set FLIGHT TIME and RUN TIME.
I think that BOOT COUNT is the same as FLIGHT TIME and RUN TIME.