lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 16 Sep 2017 17:16:07 +0530
From:   "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>
To:     Oleg Nesterov <oleg@...hat.com>
Cc:     Ingo Molnar <mingo@...nel.org>,
        Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
        Anton Blanchard <anton@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] kernel/uprobes: Warn if unable to install
 breakpoint

On 2017/09/15 05:53PM, Oleg Nesterov wrote:
> On 09/14, Naveen N. Rao wrote:
> >
> > +static void uprobe_warn(struct task_struct *t, const char *msg)
> > +{
> > +	pr_warn("uprobe: %s:%d failed to %s\n",
> > +			current->comm, current->pid, msg);
> > +}
> > +
> >  /*
> >   * valid_vma: Verify if the specified vma is an executable vma
> >   * Relax restrictions while unregistering: vm_flags might have
> > @@ -1087,7 +1093,14 @@ int uprobe_mmap(struct vm_area_struct *vma)
> >  		if (!fatal_signal_pending(current) &&
> >  		    filter_chain(uprobe, UPROBE_FILTER_MMAP, vma->vm_mm)) {
> >  			unsigned long vaddr = offset_to_vaddr(vma, uprobe->offset);
> > -			install_breakpoint(uprobe, vma->vm_mm, vma, vaddr);
> > +			int ret = install_breakpoint(uprobe, vma->vm_mm, vma, vaddr);
> > +			if (ret) {
> > +				char msg[64];
> > +				snprintf(msg, sizeof(msg),
> > +						"setup probe at 0x%llx (%d)",
> > +						uprobe->offset, ret);
> > +				uprobe_warn(current, (const char *)msg);
> 
> Agreed, but... this is cosmetic, but I don't really like this snprintf().
> 
> I won't insist too much, but wouldn't it better to turn uprobe_warn() into
> uprobe_warn(struct task_struct *t, char *fmt, ...) ?

Good point. In fact, I think we can just use pr_fmt().

Thanks,
Naveen

Powered by blists - more mailing lists