Skip to contentSkip to conversation

bug report: potential null deref send_mds_reconnect()

DISCUSSION Dan Carpenter 2 participants 2 messages May 13, 2010 – May 14, 2010

lore
Share & tools
lore
#0 lore raw

This is a Smatch thing.

fs/ceph/mds_client.c +2217 send_mds_reconnect(82) error: we previously assumed 'session' could be null.
2176 down_read(&mdsc->snap_rwsem);
2177
2178 if (!session)
2179 goto send;

If we hit this goto then we will dereference session and oops.

2180 dout("session %p state %s\n", session,
2181 session_state_name(session->s_state));

regards,
dan carpenter

#1 lore raw
Quoted 8 lines · Dan Carpenter

This is a Smatch thing.

fs/ceph/mds_client.c +2217 send_mds_reconnect(82) error: we previously assumed 'session' could be null.
2176 down_read(&mdsc->snap_rwsem);
2177
2178 if (!session)
2179 goto send;

Quoted 4 lines

If we hit this goto then we will dereference session and oops.

2180 dout("session %p state %s\n", session,
2181 session_state_name(session->s_state));

Yeah, this is a bit of a mess. There is already a fix (and big cleanup of this function) in the unstable branch, queued up for the next merge window. I forgot it's theoretically possible to hit this with the current code (although only with the clustered mds). If I send a final set fixes for .34 I'll include something for this too...

Thanks!
sage