Skip to content

Commit

Permalink
auth: fix a crash issue due to CryptoHandler::create() failed
Browse files Browse the repository at this point in the history
In this case(e.g. user passes wrong key), attempts to call the CryptoKey.ckh will lead to a segfault.

This patch fixes crash issue like following:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffed10e700 (LWP 25051)]
0x00007ffff59896c6 in CryptoKey::encrypt (this=0x7fffed10d4f0, cct=0x555555829c30, in=..., out=..., error=0x7fffed10d440) at auth/cephx/../Crypto.h:110
110	    return ckh->encrypt(in, out, error);
(gdb) bt
    at auth/cephx/../Crypto.h:110
    at auth/cephx/CephxProtocol.h:464

Signed-off-by: Dunrong Huang <[email protected]>
  • Loading branch information
mathslinux committed Nov 28, 2015
1 parent e9e0533 commit a7f520c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/auth/Crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ int CryptoKey::_set_secret(int t, const bufferptr& s)
if (error.length()) {
return -EIO;
}
} else {
return -EOPNOTSUPP;
}
type = t;
secret = s;
Expand Down

1 comment on commit a7f520c

@mtanski
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has affected me in Infernalis

Please sign in to comment.