From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Ilya Dryomov <idryomov@gmail.com>,
Sage Weil <sage@redhat.com>
Subject: [PATCH 4.9 02/63] libceph: handle an empty authorize reply
Date: Mon, 25 Feb 2019 22:11:02 +0100 [thread overview]
Message-ID: <20190225195035.901567149@linuxfoundation.org> (raw)
In-Reply-To: <20190225195035.713274200@linuxfoundation.org>
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <idryomov@gmail.com>
commit 0fd3fd0a9bb0b02b6435bb7070e9f7b82a23f068 upstream.
The authorize reply can be empty, for example when the ticket used to
build the authorizer is too old and TAG_BADAUTHORIZER is returned from
the service. Calling ->verify_authorizer_reply() results in an attempt
to decrypt and validate (somewhat) random data in au->buf (most likely
the signature block from calc_signature()), which fails and ends up in
con_fault_finish() with !con->auth_retry. The ticket isn't invalidated
and the connection is retried again and again until a new ticket is
obtained from the monitor:
libceph: osd2 192.168.122.1:6809 bad authorize reply
libceph: osd2 192.168.122.1:6809 bad authorize reply
libceph: osd2 192.168.122.1:6809 bad authorize reply
libceph: osd2 192.168.122.1:6809 bad authorize reply
Let TAG_BADAUTHORIZER handler kick in and increment con->auth_retry.
Cc: stable@vger.kernel.org
Fixes: 5c056fdc5b47 ("libceph: verify authorize reply on connect")
Link: https://tracker.ceph.com/issues/20164
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ceph/messenger.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2042,6 +2042,8 @@ static int process_connect(struct ceph_c
dout("process_connect on %p tag %d\n", con, (int)con->in_tag);
if (con->auth) {
+ int len = le32_to_cpu(con->in_reply.authorizer_len);
+
/*
* Any connection that defines ->get_authorizer()
* should also define ->add_authorizer_challenge() and
@@ -2051,8 +2053,7 @@ static int process_connect(struct ceph_c
*/
if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) {
ret = con->ops->add_authorizer_challenge(
- con, con->auth->authorizer_reply_buf,
- le32_to_cpu(con->in_reply.authorizer_len));
+ con, con->auth->authorizer_reply_buf, len);
if (ret < 0)
return ret;
@@ -2062,10 +2063,12 @@ static int process_connect(struct ceph_c
return 0;
}
- ret = con->ops->verify_authorizer_reply(con);
- if (ret < 0) {
- con->error_msg = "bad authorize reply";
- return ret;
+ if (len) {
+ ret = con->ops->verify_authorizer_reply(con);
+ if (ret < 0) {
+ con->error_msg = "bad authorize reply";
+ return ret;
+ }
}
}
next prev parent reply other threads:[~2019-02-25 22:05 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-25 21:11 [PATCH 4.9 00/63] 4.9.161-stable review Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 01/63] mac80211: Free mpath object when rhashtable insertion fails Greg Kroah-Hartman
2019-02-25 21:11 ` Greg Kroah-Hartman [this message]
2019-02-25 21:11 ` [PATCH 4.9 03/63] ceph: avoid repeatedly adding inode to mdsc->snap_flush_list Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 04/63] numa: change get_mempolicy() to use nr_node_ids instead of MAX_NUMNODES Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 05/63] proc, oom: do not report alien mms when setting oom_score_adj Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 06/63] KEYS: allow reaching the keys quotas exactly Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 07/63] mfd: ti_am335x_tscadc: Use PLATFORM_DEVID_AUTO while registering mfd cells Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 08/63] mfd: twl-core: Fix section annotations on {,un}protect_pm_master Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 09/63] mfd: db8500-prcmu: Fix some section annotations Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 10/63] mfd: mt6397: Do not call irq_domain_remove if PMIC unsupported Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 11/63] mfd: ab8500-core: Return zero in get_register_interruptible() Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 12/63] mfd: qcom_rpm: write fw_version to CTRL_REG Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 13/63] mfd: wm5110: Add missing ASRC rate register Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 14/63] mfd: mc13xxx: Fix a missing check of a register-read failure Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 15/63] qed: Fix qed_ll2_post_rx_buffer_notify_fw() by adding a write memory barrier Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 16/63] net: hns: Fix use after free identified by SLUB debug Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 17/63] MIPS: ath79: Enable OF serial ports in the default config Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 18/63] scsi: qla4xxx: check return code of qla4xxx_copy_from_fwddb_param Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 19/63] scsi: isci: initialize shost fully before calling scsi_add_host() Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 20/63] MIPS: jazz: fix 64bit build Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 21/63] net: stmmac: Fix PCI module removal leak Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 22/63] isdn: i4l: isdn_tty: Fix some concurrency double-free bugs Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 23/63] atm: he: fix sign-extension overflow on large shift Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 24/63] leds: lp5523: fix a missing check of return value of lp55xx_read Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 25/63] mlxsw: spectrum_switchdev: Do not treat static FDB entries as sticky Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 26/63] net/mlx5e: Fix wrong (zero) TX drop counter indication for representor Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 27/63] isdn: avm: Fix string plus integer warning from Clang Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 28/63] net: ethernet: stmmac: change dma descriptors to __le32 Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 29/63] RDMA/srp: Rework SCSI device reset handling Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 30/63] KEYS: user: Align the payload buffer Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 31/63] KEYS: always initialize keyring_index_key::desc_len Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 32/63] batman-adv: fix uninit-value in batadv_interface_tx() Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 33/63] net/packet: fix 4gb buffer limit due to overflow check Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 34/63] team: avoid complex list operations in team_nl_cmd_options_set() Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 35/63] sit: check if IPv6 enabled before calling ip6_err_gen_icmpv6_unreach() Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 36/63] sctp: call gso_reset_checksum when computing checksum in sctp_gso_segment Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 37/63] net/mlx4_en: Force CHECKSUM_NONE for short ethernet frames Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 38/63] parisc: Fix ptrace syscall number modification Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 39/63] ARCv2: Enable unaligned access in early ASM code Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 40/63] ARC: U-boot: check arguments paranoidly Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 41/63] ARC: define ARCH_SLAB_MINALIGN = 8 Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 42/63] hpet: Make cmd parameter of hpet_ioctl_common() unsigned Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 43/63] clocksource: Use GENMASK_ULL in definition of CLOCKSOURCE_MASK Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 44/63] netpoll: Fix device name check in netpoll_setup() Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 45/63] tracing: Use cpumask_available() to check if cpumask variable may be used Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 46/63] x86/boot: Disable the address-of-packed-member compiler warning Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 47/63] drm/i915: Consistently use enum pipe for PCH transcoders Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 48/63] drm/i915: Fix enum pipe vs. enum transcoder for the PCH transcoder Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 49/63] kbuild: move cc-option and cc-disable-warning after incl. arch Makefile Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 50/63] kbuild: clang: fix build failures with sparse check Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 51/63] kbuild: clang: remove crufty HOSTCFLAGS Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 52/63] kbuild: clang: disable unused variable warnings only when constant Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 53/63] kbuild: set no-integrated-as before incl. arch Makefile Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 54/63] kbuild: add -no-integrated-as Clang option unconditionally Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 55/63] irqchip/gic-v3: Convert arm64 GIC accessors to {read,write}_sysreg_s Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 56/63] mm/zsmalloc.c: change stat type parameter to int Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 57/63] mm/zsmalloc.c: fix -Wunneeded-internal-declaration warning Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 58/63] Revert "bridge: do not add port to router list when receives query with source 0.0.0.0" Greg Kroah-Hartman
2019-02-25 21:11 ` [PATCH 4.9 59/63] netfilter: nf_tables: fix flush after rule deletion in the same batch Greg Kroah-Hartman
2019-02-25 21:12 ` [PATCH 4.9 60/63] pinctrl: max77620: Use define directive for max77620_pinconf_param values Greg Kroah-Hartman
2019-02-25 21:12 ` [PATCH 4.9 61/63] phy: tegra: remove redundant self assignment of map Greg Kroah-Hartman
2019-02-25 21:12 ` [PATCH 4.9 62/63] sched/sysctl: Fix attributes of some extern declarations Greg Kroah-Hartman
2019-02-25 21:12 ` [PATCH 4.9 63/63] kbuild: consolidate Clang compiler flags Greg Kroah-Hartman
2019-02-26 8:33 ` [PATCH 4.9 00/63] 4.9.161-stable review Naresh Kamboju
2019-02-26 12:23 ` Jon Hunter
2019-02-26 15:06 ` shuah
2019-02-26 17:41 ` Guenter Roeck
2019-02-26 18:18 ` Guenter Roeck
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=20190225195035.901567149@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=idryomov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sage@redhat.com \
--cc=stable@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).