linux-mips
[Top] [All Lists]

Re: [PATCH 1/2] MIPS: Preliminary vdso.

To: David Daney <ddaney@caviumnetworks.com>
Subject: Re: [PATCH 1/2] MIPS: Preliminary vdso.
From: David VomLehn <dvomlehn@cisco.com>
Date: Wed, 22 Apr 2009 11:28:30 -0700
Authentication-results: sj-dkim-2; header.From=dvomlehn@cisco.com; dkim=pass ( sig from cisco.com/sjdkim2002 verified; );
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; l=1246; t=1240424910; x=1241288910; c=relaxed/simple; s=sjdkim2002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=dvomlehn@cisco.com; z=From:=20David=20VomLehn=20<dvomlehn@cisco.com> |Subject:=20Re=3A=20[PATCH=201/2]=20MIPS=3A=20Preliminary=2 0vdso. |Sender:=20; bh=cKFsFv3okm0sC/S6GRuCGgkyfmaisLA4gJfgGBO8bVQ=; b=lO64XAJkzjYMNiPwswKXjtsvKHLxlwt7YkxNf6WmHlCJ/BTqHlUoRXpScF SyYgg9GrmsPrUcNvI8h8TMQwPiowshUVshWrlOCGGoKuKZL5QBsUpT+tCyNF hZuEUfLQTW;
In-reply-to: <49EF5C62.9080803@caviumnetworks.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <49EE3B0F.3040506@caviumnetworks.com> <1240349605-1921-1-git-send-email-ddaney@caviumnetworks.com> <20090422175044.GA28623@cuplxvomd02.corp.sa.net> <49EF5C62.9080803@caviumnetworks.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.18 (2008-05-17)
>>> +int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
>>> +{
>>> +   int ret;
>>> +   unsigned long addr;
>>> +   struct mm_struct *mm = current->mm;
>>> +
>>> +   down_write(&mm->mmap_sem);
>>> +
>>> +   addr = vdso_addr(mm->start_stack);
>>> +
>>> +   addr = get_unmapped_area(NULL, addr, PAGE_SIZE, 0, 0);
>>> +   if (IS_ERR_VALUE(addr)) {
>>> +           ret = addr;
>>> +           goto up_fail;
>>> +   }
>>> +
>>> +   ret = install_special_mapping(mm, addr, PAGE_SIZE,
>>> +                                 VM_READ|VM_EXEC|
>>> +                                 VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
>>> +                                 VM_ALWAYSDUMP,
>>> +                                 &vdso_page);
>>> +
>>> +   if (ret)
>>> +           goto up_fail;
>>> +
>>> +   mm->context.vdso = (void *)addr;
>>> +
>>> +up_fail:
>>
>> It seems that this is an unexpected condition that probably indicates
>> a failure of the expected state of the process at this point. Perhaps
>> a pr_err() or pr_warning() would be appropriate?
>>
>>> +   up_write(&mm->mmap_sem);
>>> +   return ret;
>>> +}
>
> Really it should always succeed.  Something is seriously wrong if you  
> cannot map that page and we should probably panic().

It seems like it may be recoverable, so perhaps BUG() is better.

> David Daney

David VomLehn

<Prev in Thread] Current Thread [Next in Thread>