linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: linux-scsi@vger.kernel.org
Subject: [Bug 49241] New: Unsafe dereference of pointer after allocing memory
Date: Mon, 22 Oct 2012 09:35:47 +0000 (UTC)	[thread overview]
Message-ID: <bug-49241-11613@https.bugzilla.kernel.org/> (raw)

https://bugzilla.kernel.org/show_bug.cgi?id=49241

           Summary: Unsafe dereference of pointer after allocing memory
           Product: SCSI Drivers
           Version: 2.5
    Kernel Version: 3.0.47
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
        AssignedTo: scsi_drivers-other@kernel-bugs.osdl.org
        ReportedBy: yangyeping_666@hotmail.com
                CC: linux-scsi@vger.kernel.org
        Regression: No


Vulnerability kind: Null-pointer dereference
The file path containing this vulnerability: drivers/scsi/mac_scsi.c
Line number: 290
Severity: medium
Code fragment (from line 270 to line 290):


 instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
#if NDEBUG
    default_instance = instance;
#endif

    if (macintosh_config->ident == MAC_MODEL_IIFX) {
        mac_scsi_regp  = via1+0x8000;
        mac_scsi_drq   = via1+0xE000;
        mac_scsi_nodrq = via1+0xC000;
        /* The IIFX should be able to do true DMA, but pseudo-dma doesn't work
*/
        flags = FLAG_NO_PSEUDO_DMA;
    } else {
        mac_scsi_regp  = via1+0x10000;
        mac_scsi_drq   = via1+0x6000;
        mac_scsi_nodrq = via1+0x12000;
    }

    if (! setup_use_pdma)
        flags = FLAG_NO_PSEUDO_DMA;

    instance->io_port = (unsigned long) mac_scsi_regp;

Description: The variable "instance" is defined at line 270 via function
"scsi_register" but is not sanity-checked.Then it is dereferenced at line 290.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are watching the assignee of the bug.

             reply	other threads:[~2012-10-22  9:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22  9:35 bugzilla-daemon [this message]
2013-11-19 22:40 ` [Bug 49241] [PATCH]Unsafe dereference of pointer after allocing memory bugzilla-daemon
2013-11-19 22:41 ` bugzilla-daemon
2013-11-20 13:50 ` bugzilla-daemon
2013-12-27 18:14 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-49241-11613@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).