[libcamera-devel,v2,0/2] improve secure_getenv()
mbox series

Message ID 20190426084220.71500-1-giulio.benetti@micronovasrl.com
Headers show
Series
  • improve secure_getenv()
Related show

Message

Giulio Benetti April 26, 2019, 8:42 a.m. UTC
Local secure_getenv() at the moment uses getauxval(AT_SECURE), but it's
not always present in libc and secure_getenv() instead could be.

Check if secure_getenv() is available from libc and use it, otherwise
workaround it using issetugid().

Changes:
V1->V2: 
* improve meson.build
* fix recursive secure_getenv()

Giulio Benetti (2):
  meson: check if secure_getenv() is present
  libcamera: utils: call secure_getenv() if it exists or workaround with
    issetugid()

 meson.build             | 11 +++++++++++
 src/libcamera/utils.cpp |  8 ++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

Comments

Kieran Bingham April 26, 2019, 10:11 a.m. UTC | #1
Hi Guilio,

Thank you for the respin.
These look good to me, and the tests are now passing again.

For both of the patches,

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

There is a small comment from Laurent which I will apply locally before
pusing to master. Once this is done would you like to handle bumping the
buildroot package version?

Then hopefully the automated builds on buildroot will be fixed.
--
Regards

Kieran


On 26/04/2019 10:42, Giulio Benetti wrote:
> Local secure_getenv() at the moment uses getauxval(AT_SECURE), but it's
> not always present in libc and secure_getenv() instead could be.
> 
> Check if secure_getenv() is available from libc and use it, otherwise
> workaround it using issetugid().
> 
> Changes:
> V1->V2: 
> * improve meson.build
> * fix recursive secure_getenv()
> 
> Giulio Benetti (2):
>   meson: check if secure_getenv() is present
>   libcamera: utils: call secure_getenv() if it exists or workaround with
>     issetugid()
> 
>  meson.build             | 11 +++++++++++
>  src/libcamera/utils.cpp |  8 ++++++--
>  2 files changed, 17 insertions(+), 2 deletions(-)
>
Giulio Benetti April 26, 2019, 10:28 a.m. UTC | #2
Hi Kieran

Il 26/04/2019 12:11, Kieran Bingham ha scritto:
> Hi Guilio,
> 
> Thank you for the respin.
> These look good to me, and the tests are now passing again.
> 
> For both of the patches,
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> There is a small comment from Laurent which I will apply locally before
> pusing to master. 

Yes, I've seen.

> Once this is done would you like to handle bumping the
> buildroot package version?

Sure I will.
Btw, I've already tried building with test-pkg on Buildroot and in 2 
cases using sparc-uclibc it gives linking problems due to linking issues 
with -latomic.
I will deal with it asap.

Best regards
Giulio

> Then hopefully the automated builds on buildroot will be fixed.
> --
> Regards
> 
> Kieran
> 
> 
> On 26/04/2019 10:42, Giulio Benetti wrote:
>> Local secure_getenv() at the moment uses getauxval(AT_SECURE), but it's
>> not always present in libc and secure_getenv() instead could be.
>>
>> Check if secure_getenv() is available from libc and use it, otherwise
>> workaround it using issetugid().
>>
>> Changes:
>> V1->V2:
>> * improve meson.build
>> * fix recursive secure_getenv()
>>
>> Giulio Benetti (2):
>>    meson: check if secure_getenv() is present
>>    libcamera: utils: call secure_getenv() if it exists or workaround with
>>      issetugid()
>>
>>   meson.build             | 11 +++++++++++
>>   src/libcamera/utils.cpp |  8 ++++++--
>>   2 files changed, 17 insertions(+), 2 deletions(-)
>>
>
Kieran Bingham April 26, 2019, 12:45 p.m. UTC | #3
Hi Guilio,

On 26/04/2019 12:28, Giulio Benetti wrote:
> Hi Kieran
> 
> Il 26/04/2019 12:11, Kieran Bingham ha scritto:
>> Hi Guilio,
>>
>> Thank you for the respin.
>> These look good to me, and the tests are now passing again.
>>
>> For both of the patches,
>>
>> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>>
>> There is a small comment from Laurent which I will apply locally before
>> pusing to master. 
> 
> Yes, I've seen.
> 
>> Once this is done would you like to handle bumping the
>> buildroot package version?
> 
> Sure I will.


This series is now pushed to master with the tweaks as suggested by Laurent.

Thank you for your help on this topic!


> Btw, I've already tried building with test-pkg on Buildroot and in 2
> cases using sparc-uclibc it gives linking problems due to linking issues
> with -latomic.
> I will deal with it asap.

And thank you for this!

>
> Best regards
> Giulio
> 
>> Then hopefully the automated builds on buildroot will be fixed.
>> -- 
>> Regards
>>
>> Kieran
>>
>>
>> On 26/04/2019 10:42, Giulio Benetti wrote:
>>> Local secure_getenv() at the moment uses getauxval(AT_SECURE), but it's
>>> not always present in libc and secure_getenv() instead could be.
>>>
>>> Check if secure_getenv() is available from libc and use it, otherwise
>>> workaround it using issetugid().
>>>
>>> Changes:
>>> V1->V2:
>>> * improve meson.build
>>> * fix recursive secure_getenv()
>>>
>>> Giulio Benetti (2):
>>>    meson: check if secure_getenv() is present
>>>    libcamera: utils: call secure_getenv() if it exists or workaround
>>> with
>>>      issetugid()
>>>
>>>   meson.build             | 11 +++++++++++
>>>   src/libcamera/utils.cpp |  8 ++++++--
>>>   2 files changed, 17 insertions(+), 2 deletions(-)
>>>
>>
>