From patchwork Thu Apr 28 12:25:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoming Ni X-Patchwork-Id: 1623638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=KLO6d0uK; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (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) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KpvxN5Xb5z9s2R for ; Thu, 28 Apr 2022 22:26:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8C3CD3857364 for ; Thu, 28 Apr 2022 12:26:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C3CD3857364 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651148789; bh=DF/vyL+41fVAsiBGCdw/zpNwHoj0bsLqk8/Z2xEHqK0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=KLO6d0uKR08J2SY4QEmdUyOYh+8ep5dpyF2BTuZN6Qf1B5kIEWJLaPvIaivPOzES3 JW0X5TfoJg0ZX2deYNYaao/lWM8iIYFgKEoP/DxjzXFNwKkzLnQ3+16aErx98lyU4p vcMF2x0OVT5BmeWMxWuM2uhMkwX8fijqbu9QfE94= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by sourceware.org (Postfix) with ESMTPS id 41B483856DC2 for ; Thu, 28 Apr 2022 12:25:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 41B483856DC2 Received: from canpemm500006.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Kpvvs6pB2zhYm7; Thu, 28 Apr 2022 20:25:13 +0800 (CST) Received: from use12-sp2.huawei.com (10.67.189.174) by canpemm500006.china.huawei.com (7.192.105.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 28 Apr 2022 20:25:33 +0800 To: , , , , , Subject: [PATCH 0/4] time: Use __nonnull to avoid null pointer Date: Thu, 28 Apr 2022 20:25:25 +0800 Message-ID: <20220428122529.108208-1-nixiaoming@huawei.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.67.189.174] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500006.china.huawei.com (7.192.105.130) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_MANYTO, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: Xiaoming Ni via Libc-alpha From: Xiaoming Ni Reply-To: Xiaoming Ni Cc: libc-alpha@sourceware.org, wangle6@huawei.com, nixiaoming@huawei.com Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" Some external interface codes do not check whether the pointer parameter is null. If the parameter is null, the program crashes (BZ#27662). Therefore, add a __nonull statement to the function declaration to avoid null pointers. Link: https://sourceware.org/bugzilla/show_bug.cgi?id=27662 Link: https://sourceware.org/bugzilla/show_bug.cgi?id=29084 The __nonull declaration is added for the following interfaces: adjtimex() adjtimex64() ntp_gettime() ntp_gettime64() ntp_gettimex() ntp_gettimex64() ntp_adjtime() clock_settime() clock_settime64() clock_gettime() clock_gettime64() clock_adjtime() clock_adjtime64() --- Xiaoming Ni (4): adjtimex/adjtimex64: Use __nonnull to avoid null pointer ntp_xxxtimex: Use __nonnull to avoid null pointer clock_adjtime: Use __nonnull to avoid null pointer clock_settime/clock_gettime: Use __nonnull to avoid null pointer include/time.h | 4 ++-- sysdeps/unix/sysv/linux/bits/time.h | 4 ++-- sysdeps/unix/sysv/linux/include/sys/timex.h | 10 +++++----- sysdeps/unix/sysv/linux/sys/timex.h | 16 ++++++++-------- time/time.h | 9 ++++++--- 5 files changed, 23 insertions(+), 20 deletions(-)