nfsdcld: don't send null client ids to the kernel
Subsystems (2)
PATCH 1/1 nfsdcld: don't send null client ids to the kernel
It's apparently possible for the sqlite database to get corrupted and cause one or more rows to have null in the id column.
The knfsd fix was posted here:
https://lore.kernel.org/linux-nfs/[email protected]/
nfsdcld should have a similar fix. If we encounter a client record with a null id, just skip it instead of sending it to the kernel.
--- utils/nfsdcld/sqlite.c | 5 +++++ 1 file changed, 5 insertions(+)
utils/nfsdcld/sqlite.c +5 -0
@@ -1337,6 +1337,11 @@ sqlite_iterate_recovery(int (*cb)(struct cld_client *clnt), struct cld_client *c id_len =sqlite3_column_bytes (stmt,0 );if (id_len >NFS4_OPAQUE_LIMIT ) id_len =NFS4_OPAQUE_LIMIT ; +if (id_len ==0 ) { +xlog (L_ERROR ,"%s: Skipping client record with null id" , + __func__); +continue ; + }memset (&cmsg->cm_u,0 ,sizeof (cmsg->cm_u));#if UPCALL_VERSION >=2
Signature · 1 line
2.46.0
Quoted 10 lines · Scott Mayhew
It's apparently possible for the sqlite database to get corrupted and cause one or more rows to have null in the id column.
The knfsd fix was posted here:
https://lore.kernel.org/linux-nfs/[email protected]/nfsdcld should have a similar fix. If we encounter a client record with a null id, just skip it instead of sending it to the kernel.
Signed-off-by Scott Mayhew <[email protected]>
Committed... (tag: nfs-utils-2-7-2-rc1
steved
Quoted 20 lines
--- utils/nfsdcld/sqlite.c | 5 +++++ 1 file changed, 5 insertions(+)utils/nfsdcld/sqlite.c +5
-0@@ -1337,6 +1337,11 @@ sqlite_iterate_recovery(int (*cb)(struct cld_client *clnt), struct cld_client *c id_len =sqlite3_column_bytes (stmt,0 );if (id_len >NFS4_OPAQUE_LIMIT ) id_len =NFS4_OPAQUE_LIMIT ; +if (id_len ==0 ) { +xlog (L_ERROR ,"%s: Skipping client record with null id" , + __func__); +continue ; + }memset (&cmsg->cm_u,0 ,sizeof (cmsg->cm_u));#if UPCALL_VERSION >=2