From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2A2FE384640C; Wed, 24 Apr 2024 20:25:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A2FE384640C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713990321; bh=J0VrWfC+3cEhus4gT1duPXe4HPxAFZ5RU5BBx66mS3U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=F+WtPtUh+WoPV6DBitoOOQlESXhpwgvUQ2Yztysx4DRHzupE1iW8rpPf+XA/RwuiM LmVN45yT22GYlyb1O2zncM6imDoeQbyHupssR5bRenvTHQ7XoIDRKdHT1fUOLUEYVy 79UtNDOAF07VIYeQqqHH8Lq7jUROfT/y25+vQc2o= From: "carlos at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug nscd/31679] nscd: netgroup cache may terminate daemon on memory allocation failure Date: Wed, 24 Apr 2024 20:25:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: nscd X-Bugzilla-Version: 2.40 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: carlos at redhat dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: fweimer at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security+ X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31679 Carlos O'Donell changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |carlos at redhat dot com --- Comment #1 from Carlos O'Donell --- [carlos@athas nscd]$ grep 'xmalloc' * Makefile:# To find xmalloc.c Makefile: xmalloc xstrdup aicache initgrcache res_hconf \ connections.c: dbs[cnt].head =3D xmalloc (sizeof (struct database_pers= _head) connections.c: dbs[cnt].data =3D xmalloc (dbs[cnt].head->data_size); connections.c: struct pollfd *conns =3D (struct pollfd *) xmalloc (nconns connections.c: server_groups =3D (gid_t *) xmalloc (server_ngroups * sizeof (gid_t)); mem.c: he =3D xmalloc (memory_needed); mem.c:#define obstack_chunk_alloc xmalloc netgroupcache.c: buffer =3D xmalloc (buflen); nscd.h:#include [carlos@athas nscd]$ grep 'xrealloc' * netgroupcache.c: char *newbuf =3D xreall= oc (buffer, buflen); netgroupcache.c: *tofreep =3D buffer =3D xrealloc (b= uffer, buflen); Yes, we should not be doing this anywhere, we should check the result and handle the OOM gracefully. --=20 You are receiving this mail because: You are on the CC list for the bug.=