From: David Miller <davem@davemloft.net>
To: maxime.jayat@mobile-devices.fr
Cc: acme@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: socket: fix recvmmsg not returning error from sock_error
Date: Tue, 21 Feb 2017 13:35:58 -0500 (EST) [thread overview]
Message-ID: <20170221.133558.1628815110115665532.davem@davemloft.net> (raw)
In-Reply-To: <20170221173551.3471-1-maxime.jayat@mobile-devices.fr>
From: Maxime Jayat <maxime.jayat@mobile-devices.fr>
Date: Tue, 21 Feb 2017 18:35:51 +0100
> Commit 34b88a68f26a ("net: Fix use after free in the recvmmsg exit path"),
> changed the exit path of recvmmsg to always return the datagrams
> variable and modified the error paths to set the variable to the error
> code returned by recvmsg if necessary.
>
> However in the case sock_error returned an error, the error code was
> then ignored, and recvmmsg returned 0.
>
> Change the error path of recvmmsg to correctly return the error code
> of sock_error.
>
> The bug was triggered by using recvmmsg on a CAN interface which was
> not up. Linux 4.6 and later return 0 in this case while earlier
> releases returned -ENETDOWN.
>
> Fixes: 34b88a68f26a ("net: Fix use after free in the recvmmsg exit path")
> Signed-off-by: Maxime Jayat <maxime.jayat@mobile-devices.fr>
Good catch, applied and queued up for -stable.
prev parent reply other threads:[~2017-02-21 18:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 17:35 [PATCH] net: socket: fix recvmmsg not returning error from sock_error Maxime Jayat
2017-02-21 18:35 ` David Miller [this message]
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=20170221.133558.1628815110115665532.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=acme@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.jayat@mobile-devices.fr \
--cc=netdev@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).