<i>Code cleanups to support CHERI</i> status still Pending with 3 other changes
by
.
D 2023-03-28T10:41:19.949
J icomment Not\ssure\show\sI\smissed\sthese\scomments\sfrom\slast\sAugust\sand\sonly\ssaw\stoday's\sfollow-up,\sbut\shere's\smy\sresponse:\r\n\r\nIt's\sbeen\slong\senough\sthat\sI\sdon't\srecall\swhether\spatch\s2\sis\sneeded\sfor\scorrectness.\sHowever,\swe\sdo\semit\sa\swarning\son\spointer<->integer\scasts\sthat\sdon't\sgo\sthrough\s(u)intptr_t\sbecause\sthere's\sa\shigh\schance\sthe\scode\sis\swrong\s(and\sit's\squite\shard\sto\stell\sstatically\sfor\scertain),\sso\seven\sif\snone\sof\sthe\susers\sneed\sto\sbe\sable\sto\sdo\spointer->integer->pointer\slosslessly\sit's\sgoing\sto\swarn\sas-is,\swhich\sis\sa\swarning\swe\soften\slike\sto\smake\san\serror\sso\swe\scan\scatch\sall\ssuch\spotentially-problematic\scases.\sIf\swhat\syou\ssay\sis\strue\sthen\sthe\sway\swe'd\sexpress\sit\swould\sbe\s`((void\s*)(intptr_t)(ptrdiff_t)(p))`\sand\s`((ptrdiff_t)(intptr_t)(p))`,\swhich\sare\ssemantically\sequivalent\sto\sthe\soriginal\scode,\sbut\suse\sa\sredundant\sintermediary\scast\sto\sexpress\sto\sthe\scompiler\sthat\syour\sintent\sis\sindeed\sto\sbe\susing\sjust\sa\splain\sinteger.\sWould\syou\saccept\ssuch\sa\spatch\sinstead?\sEither\sway\sI'll\sneed\sto\stest\sthat\sthere\sis\sindeed\snothing\strying\sto\suse\sthese\sfor\sactual\spointers.\r\n\r\nRe\scustom/wrapping\sallocators,\syes,\sthose\sare\sa\snuisance\sto\sdeal\swith\sand\sthese\sdays\sare\soften\sa\sbad\sidea\sfor\sperformance\sanyway\s(though\smaybe\sstill\swith\ssome\sallocators).\sYou\scan\seither\smake\syour\sallocator\suse\sthe\snecessary\sintrinsics\sto\sapply\sbounds\s(and\sbe\sable\sto\scope\swith\sthe\sreduced\sbounds\son\sfree)\sor\sturn\sit\soff;\swhich\sis\sthe\sright\soption\sdepends\son\sthe\suse\scase.\sOur\sporting\sof\smost\ssoftware\sof\slate\shas\sbeen\sfocused\son\sjust\sgetting\sit\sworking\swithout\sextensively\sauditing\sit\sfor\sthings\slike\scustom\smemory\sallocators\swhere\sadaptation\sis\sneeded\sto\savoid\sslight\sholes\sin\sthe\ssecurity\sstory.\r\n\r\nRe\s__LP64__\sI\sdon't\sthink\sI\sspotted\ssuch\susage,\sbut\sit\smay\swell\sbe\sthere\sare\scases\snot\sexercised\sby\sthe\stest\ssuite\swhere\sstupid\sthings\send\sup\shappening\sbecause\sit\sthinks\sit's\s32-bit.\sThere\sonly\sseem\sto\sbe\s16\sresults\sbetween\sthe\stcl\sand\stk\srepos\s(at\sleast\saccording\sto\sGitHub\ssearch,\swhich\scan\sbe\sa\sbit\sdodgy)\sthough\sso\sperhaps\snot,\sand\sit\swouldn't\stake\slong\sto\saudit\sthem.
J login jrtc27
J mimetype text/plain
K 37108037b980ea6e705f56a9d983e05ee218dd0c
U jrtc27
Z 0817c79cac67ccec3001eb0acc4ce547