From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 4D0D7386F038; Fri, 8 Jan 2021 12:09:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4D0D7386F038 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 108C2pBa106591; Fri, 8 Jan 2021 07:09:41 -0500 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 35xps68qsb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Jan 2021 07:09:41 -0500 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 108C1q9C021395; Fri, 8 Jan 2021 12:09:39 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma03fra.de.ibm.com with ESMTP id 35tgf8k56e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Jan 2021 12:09:38 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 108C9a7x39518638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 8 Jan 2021 12:09:36 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67353A405F; Fri, 8 Jan 2021 12:09:36 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 382B9A405C; Fri, 8 Jan 2021 12:09:36 +0000 (GMT) Received: from oc4452167425.ibm.com (unknown [9.171.41.234]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 8 Jan 2021 12:09:36 +0000 (GMT) Subject: Re: [PATCH v3] addmntent: Remove unbounded alloca usage from getmntent [BZ#27083] To: libc-alpha@sourceware.org References: <20201222115140.2055339-1-siddhesh@sourceware.org> <87ft3xubvx.fsf@oldenburg2.str.redhat.com> Cc: Siddhesh Poyarekar From: Stefan Liebler Message-ID: <3a491561-462e-9588-c86e-7460507f9dab@linux.ibm.com> Date: Fri, 8 Jan 2021 13:09:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <87ft3xubvx.fsf@oldenburg2.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2021-01-08_07:2021-01-07, 2021-01-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 clxscore=1011 mlxscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101080069 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2021 12:09:43 -0000 On 12/22/20 3:57 PM, Florian Weimer via Libc-alpha wrote: > * Siddhesh Poyarekar via Libc-alpha: > >> The addmntent function replicates elements of struct mnt on stack >> using alloca, which is unsafe. Put characters directly into the >> stream, escaping them as they're being written out. >> >> Also add a test to check all escaped characters with addmntent and >> getmntent. > > This version looks okay to me. > > Thanks, > Florian > Hi Siddhesh, starting with this patch, I've observed lots of linknamespace errors if build with -Os: FAIL: conform/POSIX/semaphore.h/linknamespace FAIL: conform/POSIX/sys/mman.h/linknamespace FAIL: conform/POSIX/unistd.h/linknamespace FAIL: conform/POSIX2008/semaphore.h/linknamespace FAIL: conform/POSIX2008/sys/mman.h/linknamespace FAIL: conform/POSIX2008/unistd.h/linknamespace FAIL: conform/UNIX98/semaphore.h/linknamespace FAIL: conform/UNIX98/sys/mman.h/linknamespace FAIL: conform/UNIX98/unistd.h/linknamespace FAIL: conform/XOPEN2K/semaphore.h/linknamespace FAIL: conform/XOPEN2K/sys/mman.h/linknamespace FAIL: conform/XOPEN2K/unistd.h/linknamespace FAIL: conform/XOPEN2K8/semaphore.h/linknamespace FAIL: conform/XOPEN2K8/sys/mman.h/linknamespace FAIL: conform/XOPEN2K8/unistd.h/linknamespace FAIL: conform/XPG4/unistd.h/linknamespace FAIL: conform/XPG42/unistd.h/linknamespace E.g.: conform/POSIX/semaphore.h/linknamespace.out [initial] sem_open -> [libpthread.a(sem_open.o)] __shm_directory -> [libpthread.a(shm-directory.o)] __endmntent -> [libc.a(mntent_r.o)] fputc_unlocked Can you please have a look? Bye, Stefan