From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2F1B83846401; Wed, 24 Apr 2024 20:29:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F1B83846401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713990599; bh=brypN+REGVJkqAZzNvE0oxXxi6feQbjtDofRF0xbCUg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=D/+ke/4kbkZVjoGbH4f+dpowdiTRk07l66yc+Iyz4ew7BRmWaAV8CdFLaRWeMs9FZ RjL+tgHz4HbEXlbtux0piysq66zFl6dIdQthugTmZ3VFCYaoqubGr6/Ph62YpljK1N uMFk06r7FYHelHK765Od6y5AN9XuwWn4vcj0P8yw= 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:29:59 +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: 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 --- Comment #2 from Carlos O'Donell --- (In reply to Carlos O'Donell from comment #1) > [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 * siz= eof > (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 xrealloc (buffer, buflen); > netgroupcache.c: *tofreep =3D buffer =3D xrealloc (buffer, buflen); >=20 > Yes, we should not be doing this anywhere, we should check the result and > handle the OOM gracefully. I should note that this bug is only about the netgroupcache.c usage. --=20 You are receiving this mail because: You are on the CC list for the bug.=