From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15465 invoked by alias); 2 Feb 2012 04:29:10 -0000 Received: (qmail 15447 invoked by uid 22791); 2 Feb 2012 04:29:09 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,SUBJ_OBFU_PUNCT_FEW X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Feb 2012 04:28:57 +0000 From: "vijunag at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug corefiles/13652] New: non elf core file whose whose size is greater than zero && u.u_dsize == 0 && u.u_ssize == 0 are being recognized as tad-core Date: Thu, 02 Feb 2012 04:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: corefiles X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vijunag at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2012-q1/txt/msg00155.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13652 Bug #: 13652 Summary: non elf core file whose whose size is greater than zero && u.u_dsize == 0 && u.u_ssize == 0 are being recognized as tad-core Product: gdb Version: 6.8 Status: NEW Severity: normal Priority: P2 Component: corefiles AssignedTo: unassigned@sourceware.org ReportedBy: vijunag@gmail.com Classification: Unclassified In tradcore target format checking i.e. in trad_unix_core_file_p() magic is not being used to validate if core matches tradcore target. If for eg sizeof(u) == u and if u.u_dsize ==0 && u.u_ssize == 0 then core file is being recognized as tradcore target instead of checking for the magic numbers u.magic. if (bfd_seek (abfd, (file_ptr) TRAD_CORE_USER_OFFSET, SEEK_SET) != 0) return 0; #endif val = bfd_bread ((void *) &u, (bfd_size_type) sizeof u, abfd); if (val != sizeof u) { /* Too small to be a core file */ bfd_set_error (bfd_error_wrong_format); return 0; } /* Sanity check perhaps??? */ if (u.u_dsize > 0x1000000) /* Remember, it's in pages... */ { bfd_set_error (bfd_error_wrong_format); return 0; } if (u.u_ssize > 0x1000000) { bfd_set_error (bfd_error_wrong_format); return 0; } -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.