linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Lameter <cl@linux.com>
To: Shaobo He <shaobo@cs.utah.edu>
Cc: Bart Van Assche <bvanassche@acm.org>,
	linux-rdma@vger.kernel.org, Steve Wise <swise@chelsio.com>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] cxgb4: fix undefined behavior in mem.c
Date: Fri, 1 Mar 2019 18:15:53 +0000	[thread overview]
Message-ID: <010001693a7840a4-9fc27417-7088-431a-9ecd-6836c3293c9d-000000@email.amazonses.com> (raw)
In-Reply-To: <abf425b1-19ba-9cf5-8288-87ac0dbf6ac7@cs.utah.edu>

On Thu, 28 Feb 2019, Shaobo He wrote:

> I think maybe the more problematic issue is that the value of a freed pointer
> is intermediate.

The pointer is not affected by freeing the data it points to. Thus it
definitely has the same value as before and is not indeterminate.

The pointer points now to an area of memory that could now be in use for
different purposes so maybe it could be taken as a dangerous situation.

But situations like that are common in code.


  parent reply	other threads:[~2019-03-01 18:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28 22:38 [PATCH] cxgb4: fix undefined behavior in mem.c Shaobo He
2019-02-28 22:56 ` Bart Van Assche
2019-02-28 23:18   ` Shaobo He
2019-02-28 23:33     ` Bart Van Assche
2019-02-28 23:57       ` Shaobo He
2019-03-01 14:26         ` Doug Ledford
2019-03-01 21:21           ` Shaobo He
2019-03-01 18:15     ` Christopher Lameter [this message]
2019-03-04 19:54 ` Jason Gunthorpe

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=010001693a7840a4-9fc27417-7088-431a-9ecd-6836c3293c9d-000000@email.amazonses.com \
    --to=cl@linux.com \
    --cc=bvanassche@acm.org \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=shaobo@cs.utah.edu \
    --cc=swise@chelsio.com \
    /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).