qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH 14/14] Add -fstack-protector-all to CFLAGS
       [not found]         ` <87k4w39zra.fsf@lechat.rtp-net.org>
@ 2010-01-02  2:06           ` Kirill A. Shutemov
  0 siblings, 0 replies; 2+ messages in thread
From: Kirill A. Shutemov @ 2010-01-02  2:06 UTC (permalink / raw)
  To: Arnaud Patard; +Cc: qemu-devel

On Thu, Dec 31, 2009 at 12:58 PM, Arnaud Patard
<arnaud.patard@rtp-net.org> wrote:
> "Kirill A. Shutemov" <kirill@shutemov.name> writes:
> Hi,
>
>> -fstack-protector-all emit extra code to check for buffer overflows,
>> such as stack smashing attacks.  This is done by adding a guard
>> variable to functions with vulnerable objects.
>>
>> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
>> ---
>>  configure |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 0cdcdb3..16b70d8 100755
>> --- a/configure
>> +++ b/configure
>> @@ -98,6 +98,7 @@ QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $
>>  QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
>>  QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
>>  QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
>> +QEMU_CFLAGS="-fstack-protector-all $QEMU_CFLAGS"
>
> afaik not all arches out there are supporting
> -fstack-protector-all (to be more precise, some have no stack protector
> support at all). iirc, gcc will emit a warning and still compile
> but would be nice to avoid a warning.

Thanks. Will be fixed.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH 12/14] linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE
       [not found]     ` <87oclfa03j.fsf@lechat.rtp-net.org>
@ 2010-01-02  2:09       ` Kirill A. Shutemov
  0 siblings, 0 replies; 2+ messages in thread
From: Kirill A. Shutemov @ 2010-01-02  2:09 UTC (permalink / raw)
  To: Arnaud Patard; +Cc: qemu-devel

On Thu, Dec 31, 2009 at 12:50 PM, Arnaud Patard
<arnaud.patard@rtp-net.org> wrote:
> "Kirill A. Shutemov" <kirill@shutemov.name> writes:
>
> Hi,
>
>>   CC    i386-linux-user/mmap.o
>> cc1: warnings being treated as errors
>> /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'mmap_frag':
>> /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:253: error: ignoring return value of 'pread', declared with attribute warn_unused_result
>> /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'target_mmap':
>> /usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:477: error: ignoring return value of 'pread', declared with attribute warn_unused_result
>> make[1]: *** [mmap.o] Error 1
>>
>> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
>> ---
>>  linux-user/mmap.c |    6 ++++--
>>  1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/linux-user/mmap.c b/linux-user/mmap.c
>> index 144fb7c..e496c64 100644
>> --- a/linux-user/mmap.c
>> +++ b/linux-user/mmap.c
>> @@ -250,7 +250,8 @@ static int mmap_frag(abi_ulong real_start,
>>              mprotect(host_start, qemu_host_page_size, prot1 | PROT_WRITE);
>>
>>          /* read the corresponding file data */
>> -        pread(fd, g2h(start), end - start, offset);
>> +        if (pread(fd, g2h(start), end - start, offset) == -1)
>> +            return -errno;
>
> This needs to be checked but iirc, it's wrong. One should set errno and
> return -1. Please double check and fix if needed.

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-02  2:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1262223266-19191-1-git-send-email-kirill@shutemov.name>
     [not found] ` <1262223266-19191-2-git-send-email-kirill@shutemov.name>
     [not found]   ` <1262223266-19191-3-git-send-email-kirill@shutemov.name>
     [not found]     ` <1262223266-19191-4-git-send-email-kirill@shutemov.name>
     [not found]       ` <1262223266-19191-5-git-send-email-kirill@shutemov.name>
     [not found]         ` <87k4w39zra.fsf@lechat.rtp-net.org>
2010-01-02  2:06           ` [Qemu-devel] [PATCH 14/14] Add -fstack-protector-all to CFLAGS Kirill A. Shutemov
     [not found]     ` <87oclfa03j.fsf@lechat.rtp-net.org>
2010-01-02  2:09       ` [Qemu-devel] [PATCH 12/14] linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE Kirill A. Shutemov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).