Re: [PATCH 1/6] selinux-testsuite: add _GNU_SOURCE to tests/Makefile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 4, 2015 at 3:50 PM, Stephen Smalley <sds@xxxxxxxxxxxxx> wrote:
> On 06/04/2015 03:41 PM, Paul Moore wrote:
>> diff --git a/tests/msg/msgrcv.c b/tests/msg/msgrcv.c
>> index b23c801..285dcad 100644
>> --- a/tests/msg/msgrcv.c
>> +++ b/tests/msg/msgrcv.c
>> @@ -6,11 +6,6 @@
>>
>>  #define MSGMAX 1024
>>
>> -struct msgbuf {
>> -  long mtype;     /* message type, must be > 0 */
>> -  char mtext[1024];  /* message data */
>> -};
>> -
>
> This doesn't seem right.  I see that the _GNU_SOURCE definition triggers
> inclusion of a struct msgbuf definition from sys/msg.h, but that
> definition doesn't allocate any space for the mtext buffer.  So then
> when we try to msgsnd() or msgrcv() with MSGMAX, we'll be
> reading/writing memory past the end of the structure?
>
> Maybe you were right the first time, sorry.

My mistake, I should have looked closer then I saw the conflict; I was
rushing to get some other things sorted and did something stupid,
thanks for the sanity check.

I like your idea of defining _GNU_SOURCE at a higher level, I think
the right solution here is to just rename our local definition of the
msgbuf struct.  A new patchset due shortly ...

-- 
paul moore
www.paul-moore.com
_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux