Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#2075 closed defect (fixed)

NFS using uninitialized heap memory

Reported by: dufault Owned by: Sebastian Huber
Priority: normal Milestone: 4.11
Component: fs Version: 4.11
Severity: major Keywords:
Cc: sebastian.huber@… Blocked By:
Blocking:

Description

I've updated to the head and NFS is crashing in strdup() called from nfs_move_node():

(gdb) print dir->serporid.serporid_u.serporid.arg_u
$19 = {diroparg = {

name = 0xcfcfcfcf "\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374\374", <incomplete sequence \374>...}, sattrarg = {

"0xcfcfcfcf" is what is put in by rtems_malloc_dirty_memory. I don't know the correct fix, but changing two suspicious mallocs() to callocs() hides the problem.

Attachments (2)

nfs.diff (653 bytes) - added by dufault on 09/29/12 at 10:17:51.
Change malloc to calloc to work around NFS crash
0001-nfsclient-PR2075-Fix-node-initialization.patch (1.8 KB) - added by Sebastian Huber on 10/01/12 at 14:41:50.
Fix node initialization

Download all attachments as: .zip

Change History (6)

Changed on 09/29/12 at 10:17:51 by dufault

Attachment: nfs.diff added

Change malloc to calloc to work around NFS crash

comment:1 Changed on 10/01/12 at 10:53:15 by Sebastian Huber

Owner: changed from Chris Johns to Sebastian Huber
Status: newassigned, sebastian.huber@embedded-brains.de

Changed on 10/01/12 at 14:41:50 by Sebastian Huber

Fix node initialization

comment:2 Changed on 10/01/12 at 14:41:50 by Sebastian Huber

attachments.isobsolete: 01

comment:3 Changed on 10/02/12 at 12:30:37 by Sebastian Huber

Resolution: fixed
Status: assignedclosed

comment:4 Changed on 11/24/14 at 18:58:28 by Gedare Bloom

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

Note: See TracTickets for help on using tickets.