Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp124255imj; Thu, 14 Feb 2019 16:49:52 -0800 (PST) X-Google-Smtp-Source: AHgI3IadtmlimK/thS0uaTUCj/LKK6OSEvV0klqlipSzJnD5CCkfYPi+Do6R9nNnHooBJkyIJdmO X-Received: by 2002:a62:528e:: with SMTP id g136mr7270279pfb.111.1550191792289; Thu, 14 Feb 2019 16:49:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550191792; cv=none; d=google.com; s=arc-20160816; b=Xvy6YfDJZK54V1tru7SRrUihwn8zPe05bb/xfNJmzIARm2FQHW2yh3E5VnN1m4QDoU TWZbNdYQcFYziHSIk2FPSi1c5l4a04roPrrG78RNoD7ZoEK0MnXz23iDXmUOkA8vAN53 cYu5PkTlqO5/XStFmOFu97hY+9cKmrijEo/w46HnEzBTAdkLct26vGHsIp6fT78yQJ2U MQXts4VL0qgqNYonQnXZaooDMODVnNSBvHncLr6f7UiE8q6gIYVG/4/nxGjeuIIeTc4l ceYIwP8NOcDEzfHR+Bhkv+oNoVFidv92h/7cm1ZvH1kPGFkBW+q3Ju/DwXGEwBDnf3eR yFeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=u1kX5nLZRuvbRDghmPWQsmkHe1ki2AejtDggj/I8LTQ=; b=byXZEnTTX9TgvPUCjWDysuKFtyfpVtaZwgRFtOh6sRdZR5EfHmv9XjvZbt9OBJclqG eTqg7YxHj76wxsctpO+2c03SF/7f/V3e5Y0o+07GwPR1xB8S+EcYOgZ3ZsJoEVpTyoop /aCpEJ3E8S08Y92FH/1V+F3y3UTDZFUEMf3/w7091h1tNVwVAlfj4robz06QzXlgG1iy epv9xIGYekuteSyne/jqCFR1Qb0G37NNK+uAurT0xiaKAs+D6qfMyuIC1fwvZAVhjWNY M/EhAN4EmwaeccTNe9Xi9W8PdNgJ4tsX3dfDm+3ZZMjRJ0ZqQUZPWhe9kyI2yE1oIUfn MiVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si4019561plb.200.2019.02.14.16.49.36; Thu, 14 Feb 2019 16:49:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407706AbfBNP75 (ORCPT + 99 others); Thu, 14 Feb 2019 10:59:57 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:51518 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730784AbfBNP7z (ORCPT ); Thu, 14 Feb 2019 10:59:55 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1EFganA016733 for ; Thu, 14 Feb 2019 10:59:55 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qnaq9v3ct-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Feb 2019 10:59:54 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 14 Feb 2019 15:59:52 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 14 Feb 2019 15:59:49 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1EFxmF524445166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 14 Feb 2019 15:59:48 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 00D6F11C05C; Thu, 14 Feb 2019 15:59:48 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 41C2311C04C; Thu, 14 Feb 2019 15:59:46 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.8.84]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 14 Feb 2019 15:59:46 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Thu, 14 Feb 2019 17:59:45 +0200 From: Mike Rapoport To: Andrew Morton Cc: Christoph Hellwig , Palmer Dabbelt , Richard Kuo , linux-arch@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, Mike Rapoport Subject: [PATCH 3/4] init: free_initmem: poison freed init memory Date: Thu, 14 Feb 2019 17:59:36 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550159977-8949-1-git-send-email-rppt@linux.ibm.com> References: <1550159977-8949-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19021415-0008-0000-0000-000002C07EAB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19021415-0009-0000-0000-0000222CA1C3 Message-Id: <1550159977-8949-4-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-14_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=838 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902140109 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Various architectures including x86 poison the freed init memory. Do the same in the generic free_initmem implementation and switch sparc32 architecture that is identical to the generic code over to it now. Signed-off-by: Mike Rapoport --- arch/sparc/mm/init_32.c | 5 ----- init/main.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c index d900952..77e8341 100644 --- a/arch/sparc/mm/init_32.c +++ b/arch/sparc/mm/init_32.c @@ -294,11 +294,6 @@ void __init mem_init(void) mem_init_print_info(NULL); } -void free_initmem (void) -{ - free_initmem_default(POISON_FREE_INITMEM); -} - #ifdef CONFIG_BLK_DEV_INITRD void free_initrd_mem(unsigned long start, unsigned long end) { diff --git a/init/main.c b/init/main.c index 38d69e0..9a61e9c 100644 --- a/init/main.c +++ b/init/main.c @@ -1049,7 +1049,7 @@ static inline void mark_readonly(void) void __weak free_initmem(void) { - free_initmem_default(-1); + free_initmem_default(POISON_FREE_INITMEM); } static int __ref kernel_init(void *unused) -- 2.7.4