All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] infiniband: remove WARN that is not kernel bug
@ 2016-11-18 11:24 Dmitry Vyukov
  2016-11-19  2:22 ` Valdis.Kletnieks
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Vyukov @ 2016-11-18 11:24 UTC (permalink / raw)
  To: dledford, sean.hefty, hal.rosenstock, leon
  Cc: Dmitry Vyukov, linux-rdma, linux-kernel, syzkaller

WARNINGs mean kernel bugs.
The one in ucma_write() points to user programming error
or a malicious attempt. This is not a kernel bug, remove it.

BUG/WARNs that are not kernel bugs hinder automated testing effots.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: linux-rdma@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: syzkaller@googlegroups.com
---
 drivers/infiniband/core/ucma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 9520154..ff60373 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -1584,7 +1584,7 @@ static ssize_t ucma_write(struct file *filp, const char __user *buf,
 	struct rdma_ucm_cmd_hdr hdr;
 	ssize_t ret;
 
-	if (WARN_ON_ONCE(!ib_safe_file_access(filp)))
+	if (!ib_safe_file_access(filp))
 		return -EACCES;
 
 	if (len < sizeof(hdr))
-- 
2.8.0.rc3.226.g39d4020

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] infiniband: remove WARN that is not kernel bug
  2016-11-18 11:24 [PATCH] infiniband: remove WARN that is not kernel bug Dmitry Vyukov
@ 2016-11-19  2:22 ` Valdis.Kletnieks
  2016-11-19 18:57   ` Jason Gunthorpe
  0 siblings, 1 reply; 5+ messages in thread
From: Valdis.Kletnieks @ 2016-11-19  2:22 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: dledford, sean.hefty, hal.rosenstock, leon, linux-rdma,
	linux-kernel, syzkaller

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]

On Fri, 18 Nov 2016 12:24:37 +0100, Dmitry Vyukov said:
> WARNINGs mean kernel bugs.
> The one in ucma_write() points to user programming error
> or a malicious attempt. This is not a kernel bug, remove it.

> -	if (WARN_ON_ONCE(!ib_safe_file_access(filp)))
> +	if (!ib_safe_file_access(filp))
>  		return -EACCES;

In that case, wouldn't this be better?

	if (!ib_safe_file_access(filp)) {
		printk_once("Process %d (%s) tried to do something hinky", pid, comm);
		return _EACCESS;
	}

so the sysadmin becomes aware of the malicious attempt?

[-- Attachment #2: Type: application/pgp-signature, Size: 484 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] infiniband: remove WARN that is not kernel bug
  2016-11-19  2:22 ` Valdis.Kletnieks
@ 2016-11-19 18:57   ` Jason Gunthorpe
       [not found]     ` <20161119185732.GF22775-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Gunthorpe @ 2016-11-19 18:57 UTC (permalink / raw)
  To: Valdis.Kletnieks
  Cc: Dmitry Vyukov, dledford, sean.hefty, hal.rosenstock, leon,
	linux-rdma, linux-kernel, syzkaller

On Fri, Nov 18, 2016 at 09:22:42PM -0500, Valdis.Kletnieks@vt.edu wrote:
> On Fri, 18 Nov 2016 12:24:37 +0100, Dmitry Vyukov said:
> > WARNINGs mean kernel bugs.
> > The one in ucma_write() points to user programming error
> > or a malicious attempt. This is not a kernel bug, remove it.
> 
> > -	if (WARN_ON_ONCE(!ib_safe_file_access(filp)))
> > +	if (!ib_safe_file_access(filp))
> >  		return -EACCES;
> 
> In that case, wouldn't this be better?
> 
> 	if (!ib_safe_file_access(filp)) {
> 		printk_once("Process %d (%s) tried to do something hinky", pid, comm);
> 		return _EACCESS;
> 	}
> 
> so the sysadmin becomes aware of the malicious attempt?

Yes please

Jason

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] infiniband: remove WARN that is not kernel bug
  2016-11-19 18:57   ` Jason Gunthorpe
@ 2016-11-21 10:19         ` Dmitry Vyukov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Vyukov @ 2016-11-21 10:19 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Valdis.Kletnieks-PjAqaU27lzQ, dledford-H+wXaHxf7aLQT0dZR+AlfA,
	sean.hefty-ral2JQCrhuEAvxtiuMwx3w, Hal Rosenstock,
	leon-DgEjT+Ai2ygdnm+yROfE0A, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	LKML, syzkaller

On Sat, Nov 19, 2016 at 7:57 PM, Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote:
> On Fri, Nov 18, 2016 at 09:22:42PM -0500, Valdis.Kletnieks-PjAqaU27lzQ@public.gmane.org wrote:
>> On Fri, 18 Nov 2016 12:24:37 +0100, Dmitry Vyukov said:
>> > WARNINGs mean kernel bugs.
>> > The one in ucma_write() points to user programming error
>> > or a malicious attempt. This is not a kernel bug, remove it.
>>
>> > -   if (WARN_ON_ONCE(!ib_safe_file_access(filp)))
>> > +   if (!ib_safe_file_access(filp))
>> >             return -EACCES;
>>
>> In that case, wouldn't this be better?
>>
>>       if (!ib_safe_file_access(filp)) {
>>               printk_once("Process %d (%s) tried to do something hinky", pid, comm);
>>               return _EACCESS;
>>       }
>>
>> so the sysadmin becomes aware of the malicious attempt?
>
> Yes please

Mailed v2
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] infiniband: remove WARN that is not kernel bug
@ 2016-11-21 10:19         ` Dmitry Vyukov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Vyukov @ 2016-11-21 10:19 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Valdis.Kletnieks, dledford, sean.hefty, Hal Rosenstock, leon,
	linux-rdma, LKML, syzkaller

On Sat, Nov 19, 2016 at 7:57 PM, Jason Gunthorpe
<jgunthorpe@obsidianresearch.com> wrote:
> On Fri, Nov 18, 2016 at 09:22:42PM -0500, Valdis.Kletnieks@vt.edu wrote:
>> On Fri, 18 Nov 2016 12:24:37 +0100, Dmitry Vyukov said:
>> > WARNINGs mean kernel bugs.
>> > The one in ucma_write() points to user programming error
>> > or a malicious attempt. This is not a kernel bug, remove it.
>>
>> > -   if (WARN_ON_ONCE(!ib_safe_file_access(filp)))
>> > +   if (!ib_safe_file_access(filp))
>> >             return -EACCES;
>>
>> In that case, wouldn't this be better?
>>
>>       if (!ib_safe_file_access(filp)) {
>>               printk_once("Process %d (%s) tried to do something hinky", pid, comm);
>>               return _EACCESS;
>>       }
>>
>> so the sysadmin becomes aware of the malicious attempt?
>
> Yes please

Mailed v2

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-21 10:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-18 11:24 [PATCH] infiniband: remove WARN that is not kernel bug Dmitry Vyukov
2016-11-19  2:22 ` Valdis.Kletnieks
2016-11-19 18:57   ` Jason Gunthorpe
     [not found]     ` <20161119185732.GF22775-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-21 10:19       ` Dmitry Vyukov
2016-11-21 10:19         ` Dmitry Vyukov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.