nfsdcld: fix possible buffer overrun in sqlite_iterate_recovery()
Subsystems (2)
PATCH 1/1 nfsdcld: fix possible buffer overrun in sqlite_iterate_recovery()
Prior to release, cp_data was originally intended to hold the gss principal string. When it was changed to hold a hash of the principal instead, the size of the field was changed but the 'n' arg of the memcpy() in sqlite_iterate_recovery() was not.
Signed-off-by Scott Mayhew <[email protected]>
--- utils/nfsdcld/sqlite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
utils/nfsdcld/sqlite.c +1 -1
@@ -1337,7 +1337,7 @@ sqlite_iterate_recovery(int (*cb)(struct cld_client *clnt), struct cld_client *c cmsg->cm_u.cm_clntinfo.cc_name.cn_len =sqlite3_column_bytes (stmt,0 );if (sqlite3_column_bytes (stmt,1 ) >0 ) {memcpy (&cmsg->cm_u.cm_clntinfo.cc_princhash.cp_data, -sqlite3_column_blob (stmt,1 ),NFS4_OPAQUE_LIMIT ); +sqlite3_column_blob (stmt,1 ),SHA256_DIGEST_SIZE ); cmsg->cm_u.cm_clntinfo.cc_princhash.cp_len =sqlite3_column_bytes (stmt,1 ); }#else
Signature · 1 line
2.25.1
Quoted 6 lines · Scott Mayhew
Prior to release,
cp_datawas originally intended to hold the gss principal string. When it was changed to hold a hash of the principal instead, the size of the field was changed but the 'n' arg of thememcpy()insqlite_iterate_recovery()was not.Signed-off-by Scott Mayhew <[email protected]>
Committed... (tag: nfs-utils-2-4-4-rc3)
steved.
Quoted 18 lines
--- utils/nfsdcld/sqlite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)utils/nfsdcld/sqlite.c +1
-1@@ -1337,7 +1337,7 @@ sqlite_iterate_recovery(int (*cb)(struct cld_client *clnt), struct cld_client *c cmsg->cm_u.cm_clntinfo.cc_name.cn_len =sqlite3_column_bytes (stmt,0 );if (sqlite3_column_bytes (stmt,1 ) >0 ) {memcpy (&cmsg->cm_u.cm_clntinfo.cc_princhash.cp_data, -sqlite3_column_blob (stmt,1 ),NFS4_OPAQUE_LIMIT ); +sqlite3_column_blob (stmt,1 ),SHA256_DIGEST_SIZE ); cmsg->cm_u.cm_clntinfo.cc_princhash.cp_len =sqlite3_column_bytes (stmt,1 ); }#else