Jun'ichi Nomura wrote:
Hi,

Dave Anderson wrote:
>> static inline struct new_utsname *utsname(void)
>> {
>>         return &current->nsproxy->uts_ns->name;
>> }
>>
>>
> Ok, thanks...
>
> Well, at a minimum we'll have to skip the
> verify_namelist() stage, or perhaps call it later,
> some time after:
>
> (1) task_init() is complete, and
> (2) the required new_utsname fields get filled in from
>     following the trail above, perhaps from the first
>     idle task?
>
> Unless there's some other way we can access it.

I think you can get it from init_uts_ns.name,
where 'name' is struct new_utsname.

   init/version.c:
   struct uts_namespace init_uts_ns = {
         .kref = {
                 .refcount       = ATOMIC_INIT(2),
         },
         .name = {
                 .sysname        = UTS_SYSNAME,
                 .nodename       = UTS_NODENAME,
                 .release        = UTS_RELEASE,
                 .version        = UTS_VERSION,
                 .machine        = UTS_MACHINE,
                 .domainname     = UTS_DOMAINNAME,
         },
   };

Thanks,
--
Jun'ichi Nomura, NEC Solutions (America), Inc.

Yep, thanks Nic, I was just looking at the kernel patch, and
it looks simple enough.

Badari, since this is read PRE_GDB, can you try something
like this:

$ diff kernel.c.orig kernel.c
120,122c120,130
<               readmem(symbol_value("system_utsname"), KVADDR, &kt->utsname,
<                       sizeof(struct new_utsname), "system_utsname",
<                       FAULT_ON_ERROR);
---
>               if (symbol_exists("system_utsname"))
>                       readmem(symbol_value("system_utsname"), KVADDR, &kt->utsname,
>                               sizeof(struct new_utsname), "system_utsname",
>                               RETURN_ON_ERROR);
>               else if (symbol_exists("init_uts_ns"))
>                       readmem(symbol_value("init_uts_ns") + sizeof(int),
>                               KVADDR,  &kt->utsname, sizeof(struct new_utsname),
>                               "init_uts_ns", RETURN_ON_ERROR);
>               else
>                       error(INFO, "cannot access utsname information\n\n");
>
$

Thanks,
  Dave