Jump to content

[Armbian build PR] - Fix uwe5622 compilation with fortify


Recommended Posts

Posted

Description

Fix compilation of the uwe5622 driver with fortify enabled. Currently I get the following error:

[πŸ”¨]   In function 'strncpy',
[πŸ”¨]       inlined from 'sprdwl_cfg80211_scan' at drivers/net/wireless/uwe5622/unisocwifi/cfg80211.c:1541:4:
[πŸ”¨]   ./include/linux/fortify-string.h:144:17: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object (1st parameter)
[πŸ”¨]     144 |                 __write_overflow();
[πŸ”¨]         |                 ^~~~~~~~~~~~~~~~~~
[πŸ”¨]   make[8]: *** [scripts/Makefile.build:243: drivers/net/wireless/uwe5622/unisocwifi/cfg80211.o] Error 1

It seems that fortify considers the 0 sized array at the end of the struct as actually being 0 sized rather than it's pre-C99 meaning of undefined size array.

This patch changes to the standard C99 representation of undefined size array at end of struct.

How Has This Been Tested?

Compilation of the rockchip64-edge kernel (6.7).

Checklist:

  • [X] My code follows the style guidelines of this project
  • [X] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [X] My changes generate no new warnings
  • [ ] Any dependent changes have been merged and published in downstream modules

View the full article

Γ—
Γ—
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines