Adding new cameras, applying patches into trunk (with source code prepared) - page 166 - General Discussion and Assistance - CHDK Forum

Adding new cameras, applying patches into trunk (with source code prepared)

  • 1685 Replies
  • 845188 Views
*

Offline Ant

  • *****
  • 509
Advertisements
I noticed the included strub_entry_2.s did not exactly match the output I got rebuilding stubs in the current trunk.

Do you mean difference with other firmware versions?

*

Offline reyalp

  • ******
  • 14125
Do you mean difference with other firmware versions?
I meant between the stubs_entry.S included in your patch, and what I generated rebuilding stubs for the 121a firmware using the current trunk source.

edit: diff
« Last Edit: 29 / April / 2021, 17:25:42 by reyalp »
Don't forget what the H stands for.

*

Offline Ant

  • *****
  • 509
stubs_entry.S was generated a week ago using finsig_thumb2 which was built a week ago...

*

Offline reyalp

  • ******
  • 14125
stubs_entry.S was generated a week ago using finsig_thumb2 which was built a week ago...
The differences aren't in the found sigs (funcs_by*.csv are identical) but in the modemap and sigs that are set in stubs_entry_2.s.
Don't forget what the H stands for.

*

Offline Ant

  • *****
  • 509
Maybe this is because stubs_entry.S was generated not in "\platform\m3\sub\121a\" directory?

*

Offline SX720

  • *
  • 43
I'd suggest that this patch: https://sources.debian.org/patches/lua5.1/5.1.5-8.1/0004-Fix-stack-overflow-in-vararg-functions.patch/

get applied.

It fixes a security problem with Lua. A more detailed explanation is here: http://www.lua.org/bugs.html#5.2.2-1

You can apply it like so:

Code: [Select]
cd trunk/lib/lua
wget 'https://sources.debian.org/data/main/l/lua5.1/5.1.5-8.1/debian/patches/0004-Fix-stack-overflow-in-vararg-functions.patch'
patch -p2 < 0004-Fix-stack-overflow-in-vararg-functions.patch

*

Offline reyalp

  • ******
  • 14125
It fixes a security problem with Lua. A more detailed explanation is here: http://www.lua.org/bugs.html#5.2.2-1
As far as security goes, using a stack overflow when poke() is right there would seem to be making things hard on oneself ;)

That said, it sounds like it could crash in other legitimate code, so probably worth applying. Thanks for pointing it out.

edit:
I've checked this in on the trunk (r5979), as well as https://www.lua.org/bugs.html#5.1.5-2 (r5980). The latter makes CHDK Lua effectively 5.1.5
I'll merge them back to the stable branch a bit later after I've had time to test a few more scripts.

For both, I verified the existing CHDK code showed the error in the test case, and the patch resolved it.
« Last Edit: 03 / July / 2021, 20:07:07 by reyalp »
Don't forget what the H stands for.

*

Offline SX720

  • *
  • 43
Thank you for getting this merged. I see what you mean about the poke function. I still think it's a good chance because as you've mentioned legitimate scripts could crash the camera. This helps because I was wondering what version of Lua I should target when writing scripts. Now I know.

*

Offline blackhole

  • *****
  • 946
  • A590IS 101b
    • Planetary astrophotography
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #1658 on: 15 / August / 2021, 12:37:48 »
sx430is - correct power on behavior
Tested by ntstatic in https://chdk.setepontos.com/index.php?topic=13569.msg146875#msg146875

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #1659 on: 15 / August / 2021, 18:02:45 »
sx430is - correct power on behavior


Thanks, added to SVN in commit 6010 (trunk) and 6011 (release 1.5).

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal