All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Richard Weinberger <richard@nod.at>
Cc: wolfgang.glas@iteg.at, christoph.lechleitner@iteg.at,
	philipp.reisner@linbit.com, stable@vger.kernel.org,
	linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
	lars.ellenberg@linbit.com, drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] [PATCH] drbd: Fix kernel_sendmsg() usage
Date: Tue, 8 Nov 2016 07:49:24 -0800	[thread overview]
Message-ID: <20161108154924.GA19063@infradead.org> (raw)
In-Reply-To: <1478601789-15060-1-git-send-email-richard@nod.at>

On Tue, Nov 08, 2016 at 11:43:09AM +0100, Richard Weinberger wrote:
> Don't pass a size larger than iov_len to kernel_sendmsg().
> Otherwise it will cause a NULL pointer deref when kernel_sendmsg()
> returns with rv < size.
> 
> Although the issue exists since day 0, only on non-ancient kernels
> that contain change 57be5bdad759 ("ip: convert tcp_sendmsg() to iov_iter
> primitives") it seems to trigger [0][1][2][3][4].

The real fix here is to convert it to the right primitive, e.g. take
Al's patch from here:

https://git.kernel.org/cgit/linux/kernel/git/viro/vfs.git/commit/?h=work.sendmsg&id=7a4992299554a9e1ed3c4540bcfa9e40aa9a6376

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@infradead.org>
To: Richard Weinberger <richard@nod.at>
Cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org,
	lars.ellenberg@linbit.com, philipp.reisner@linbit.com,
	stable@vger.kernel.org, viro@zeniv.linux.org.uk,
	christoph.lechleitner@iteg.at, wolfgang.glas@iteg.at
Subject: Re: [PATCH] drbd: Fix kernel_sendmsg() usage
Date: Tue, 8 Nov 2016 07:49:24 -0800	[thread overview]
Message-ID: <20161108154924.GA19063@infradead.org> (raw)
In-Reply-To: <1478601789-15060-1-git-send-email-richard@nod.at>

On Tue, Nov 08, 2016 at 11:43:09AM +0100, Richard Weinberger wrote:
> Don't pass a size larger than iov_len to kernel_sendmsg().
> Otherwise it will cause a NULL pointer deref when kernel_sendmsg()
> returns with rv < size.
> 
> Although the issue exists since day 0, only on non-ancient kernels
> that contain change 57be5bdad759 ("ip: convert tcp_sendmsg() to iov_iter
> primitives") it seems to trigger [0][1][2][3][4].

The real fix here is to convert it to the right primitive, e.g. take
Al's patch from here:

https://git.kernel.org/cgit/linux/kernel/git/viro/vfs.git/commit/?h=work.sendmsg&id=7a4992299554a9e1ed3c4540bcfa9e40aa9a6376

  parent reply	other threads:[~2016-11-08 15:49 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08 10:43 [PATCH] drbd: Fix kernel_sendmsg() usage Richard Weinberger
2016-11-08 13:43 ` Lars Ellenberg
2016-11-08 13:43 ` [Drbd-dev] " Lars Ellenberg
2016-11-08 13:55 ` Richard Weinberger
2016-11-08 13:55   ` Richard Weinberger
2016-11-08 16:52   ` [Drbd-dev] " Jens Axboe
2016-11-08 16:52     ` Jens Axboe
2016-11-09 15:32     ` [Drbd-dev] " Lars Ellenberg
2016-11-09 15:32       ` Lars Ellenberg
2016-11-09 15:32       ` Lars Ellenberg
2016-11-09 15:47       ` [Drbd-dev] " Richard Weinberger
2016-11-09 15:47         ` Richard Weinberger
2016-11-09 16:51         ` [Drbd-dev] " Lars Ellenberg
2016-11-09 16:51           ` Lars Ellenberg
2016-11-09 16:55       ` Jens Axboe
2016-11-09 16:55         ` Jens Axboe
2016-11-09 21:52         ` [Drbd-dev] [PATCH v2] drbd: Fix kernel_sendmsg() usage - potential NULL deref Lars Ellenberg
2016-11-09 21:52           ` Lars Ellenberg
2016-11-09 23:41           ` [Drbd-dev] " Al Viro
2016-11-09 23:41             ` Al Viro
2016-11-08 14:03 ` [Drbd-dev] [PATCH] drbd: Fix kernel_sendmsg() usage Christoph Lechleitner
2016-11-08 14:03   ` Christoph Lechleitner
2016-11-08 15:49 ` Christoph Hellwig [this message]
2016-11-08 15:49   ` Christoph Hellwig
2016-11-08 16:02   ` [Drbd-dev] " Richard Weinberger
2016-11-08 16:02     ` Richard Weinberger
2016-11-08 16:13   ` [Drbd-dev] " Al Viro
2016-11-08 16:13     ` Al Viro

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=20161108154924.GA19063@infradead.org \
    --to=hch@infradead.org \
    --cc=christoph.lechleitner@iteg.at \
    --cc=drbd-dev@lists.linbit.com \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philipp.reisner@linbit.com \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wolfgang.glas@iteg.at \
    /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.