All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Miles Chen <miles.chen@mediatek.com>
Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	Christoph Hellwig <hch@lst.de>,
	wsd_upstream@mediatek.com,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH] net: untag pointer in sockptr_is_kernel
Date: Tue, 11 Aug 2020 13:15:51 +0200	[thread overview]
Message-ID: <20200811111551.GA3958@lst.de> (raw)
In-Reply-To: <20200811102704.17875-1-miles.chen@mediatek.com>

On Tue, Aug 11, 2020 at 06:27:04PM +0800, Miles Chen wrote:
> From: Miles Chen <miles.chen@mediatek.com>
> 
> sockptr_is_kernel() uses (sockptr.kernel >= TASK_SIZE) to tell
> if the pointer is kernel space or user space. When user space uses
> the "top byte ignored" feature such as HWAsan, we must untag
> the pointer before checking against TASK_SIZE.
> 
> sockptr_is_kernel() will view a tagged user pointer as a kernel pointer
> and use memcpy directly and causes a kernel crash.

Dave merged a patch from me to rever the optimized sockptr
implementation for now.  If we bring it back we should fold in your
fix.

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Miles Chen <miles.chen@mediatek.com>
Cc: Christoph Hellwig <hch@lst.de>,
	"David S . Miller" <davem@davemloft.net>,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	wsd_upstream@mediatek.com
Subject: Re: [PATCH] net: untag pointer in sockptr_is_kernel
Date: Tue, 11 Aug 2020 13:15:51 +0200	[thread overview]
Message-ID: <20200811111551.GA3958@lst.de> (raw)
In-Reply-To: <20200811102704.17875-1-miles.chen@mediatek.com>

On Tue, Aug 11, 2020 at 06:27:04PM +0800, Miles Chen wrote:
> From: Miles Chen <miles.chen@mediatek.com>
> 
> sockptr_is_kernel() uses (sockptr.kernel >= TASK_SIZE) to tell
> if the pointer is kernel space or user space. When user space uses
> the "top byte ignored" feature such as HWAsan, we must untag
> the pointer before checking against TASK_SIZE.
> 
> sockptr_is_kernel() will view a tagged user pointer as a kernel pointer
> and use memcpy directly and causes a kernel crash.

Dave merged a patch from me to rever the optimized sockptr
implementation for now.  If we bring it back we should fold in your
fix.

  reply	other threads:[~2020-08-11 11:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 10:27 [PATCH] net: untag pointer in sockptr_is_kernel Miles Chen
2020-08-11 11:15 ` Christoph Hellwig [this message]
2020-08-11 11:15   ` Christoph Hellwig
2020-08-11 11:44   ` David Laight
2020-08-11 11:44     ` David Laight
2020-08-12  9:15     ` Miles Chen
2020-08-12  9:15       ` Miles Chen
2020-08-12  9:48       ` David Laight
2020-08-12  9:48         ` David Laight
2020-08-11 12:24 ` kernel test robot
2020-08-11 12:24   ` kernel test robot
2020-08-11 12:24   ` kernel test robot
2020-08-11 12:28 ` kernel test robot
2020-08-11 12:28   ` kernel test robot
2020-08-11 12:28   ` kernel test robot
2020-08-12  9:17   ` Miles Chen
2020-08-12  9:17     ` Miles Chen
2020-08-12  9:17     ` Miles Chen

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=20200811111551.GA3958@lst.de \
    --to=hch@lst.de \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=miles.chen@mediatek.com \
    --cc=wsd_upstream@mediatek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.