From nobody Sat Jul 01 22:59:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QtngZ3ZKrz4lDWq; Sat, 1 Jul 2023 22:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QtngZ2lBmz3DNh; Sat, 1 Jul 2023 22:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688252362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cdrmacf2b2Y7NPToJJJQzb+tzafsIwX5OQtWWia6pTY=; b=taRGyKB0Z9XlZh4UNcB8zcj04S4Di83uYzudWinculrcVlCYuryhx7aKtkvpl0C1/pyF55 6PXJ7nXc/X8MxNJyjaiuAesWiRtI05e94U9PhsZBHcOGCZAwa5JQc4uQCgiKfOabjExfKc 1RXLv1jnC0wBz85aD8+uWBsO46gmvdzmHsj+Wcni3Tjg5OH66zTGJ8JvDjQrf/LGSvtwj5 GNMDGQMdNaFe0TmhNsqaRnxLFA/JgDmjroTcZOnDROD6sSTW4csUW9+HoV1uj1FI7umR46 /tL5epTF1mFdHOANTZGLwbOhZFHmMxnoUbnTo7drFngYX+Y/SCCiw23fZjLDQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688252362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cdrmacf2b2Y7NPToJJJQzb+tzafsIwX5OQtWWia6pTY=; b=vXkdo2tQTvSghajDRuXZhRvuPAv5OeIad6EMVPosfTVfshdYxzx6ELFxeMg9a2IZxVDEsW FKwWzLZvc0utGKAQGNxIEffNpS9VcwJcsx18/ROkcRlsRPQ1Vgd3AAx37oThbSjftKKTfn eoOjeCxKkY94QxJBFucyJG4RinP9s1VLZFm8kBQn7Yz1tH/mgkP7sPi8FVii4Ci0xrhpmg 5WRJsns4v5kSNHsy9IxOZVgqVPmclsA6uagpB56xUi1++IF6QTSiYEWFe6pqvJdPNYi2XN Xa1uxdfhtyAs89QYpL9bLCsTLabz5xeph1XtUSBSBgf2ziWo1Ju+dEcx3AlI9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688252362; a=rsa-sha256; cv=none; b=gT90ku1rcIUVCrm3eCeI7aB7ZKeluv/xQVA0jvWEAVvw/eI5xc9KkMvoX/GRCstya15NWQ TQxlf/DsXlnTKwr0p3GpfgCqAVdh3oS99Yp5fu5WuMjbo2dwOlEJaE4nhGMbFpqdtnBhcQ SP430EKh224roxXMcErWQr9trzAXm0TcVYaPRnSMYyMuaw1BoDt2SKuTGrUdzpzlqDXfkG 0oOqyTO29og95TYQUfJGMmJwJzZtKtJzzmBOb/gce2eSGaYzTw2ExrCQnumt8KxGWuCS8r rrveaXbuMzudwD6sKhgpukDRFY5fb6fYRRnH2T/uSlfO9tLsWwcG4GQaE4LjVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QtngZ1q0FzkRw; Sat, 1 Jul 2023 22:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 361MxM85017091; Sat, 1 Jul 2023 22:59:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 361MxM4i017090; Sat, 1 Jul 2023 22:59:22 GMT (envelope-from git) Date: Sat, 1 Jul 2023 22:59:22 GMT Message-Id: <202307012259.361MxM4i017090@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 005aa1743b42 - main - modules: bzero the modspecific_t List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 005aa1743b42b52fbd49b9d5ec44816902b6ee9f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=005aa1743b42b52fbd49b9d5ec44816902b6ee9f commit 005aa1743b42b52fbd49b9d5ec44816902b6ee9f Author: Ka Ho Ng AuthorDate: 2023-07-01 19:41:53 +0000 Commit: Ka Ho Ng CommitDate: 2023-07-01 22:58:46 +0000 modules: bzero the modspecific_t Per https://reviews.llvm.org/D68115, only the first field is zero-initialized, meanwhile other fields are undef. The pattern can be observed on clang as well, that when -ftrivial-auto-var-init=pattern is specified 0xaa is filled for non-active fields, otherwise they are zero-initialized. Technically both are acceptable when using clang. However it would be good to simply bzero the modspecific_t in such case to be strict to the standard. MFC with: 2cab2d43b83b MFC after: 1 day Sponsored by: Juniper Networks, Inc. Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D40830 --- sys/kern/kern_syscalls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_syscalls.c b/sys/kern/kern_syscalls.c index 234e51cfd280..0b51edf5e985 100644 --- a/sys/kern/kern_syscalls.c +++ b/sys/kern/kern_syscalls.c @@ -173,9 +173,10 @@ kern_syscall_module_handler(struct sysent *sysents, struct module *mod, int what, void *arg) { struct syscall_module_data *data = arg; - modspecific_t ms = { 0 }; + modspecific_t ms; int error; + bzero(&ms, sizeof(ms)); switch (what) { case MOD_LOAD: error = kern_syscall_register(sysents, data->offset,