Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-08 Thread Ferruh Yigit
On 10/4/2021 5:18 PM, Elad Nachman wrote: On Mon, Oct 4, 2021 at 7:05 PM Ferruh Yigit wrote: On 10/4/2021 3:58 PM, Elad Nachman wrote: בתאריך יום ב׳, 4 באוק׳ 2021, 17:51, מאת Ferruh Yigit ‏< ferruh.yi...@intel.com>: On 10/4/2021 3:25 PM, Elad Nachman wrote: Can you please try to not top po

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-08 Thread Ferruh Yigit
On 10/4/2021 7:27 PM, Elad Nachman wrote: בתאריך יום ב׳, 4 באוק׳ 2021, 20:00, מאת Eric Christian ‏ : I am not sure that only we can recreate the KNI request overwrite. We may be the only ones with a current use case that exposes the vulnerability. It is possible for any KNI operation to enc

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-04 Thread Elad Nachman
בתאריך יום ב׳, 4 באוק׳ 2021, 20:00, מאת Eric Christian ‏: > I am not sure that only we can recreate the KNI request overwrite. We may > be the only ones with a current use case that exposes the vulnerability. > It is possible for any KNI operation to encounter this issue with the new > async mec

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-04 Thread Eric Christian
I am not sure that only we can recreate the KNI request overwrite. We may be the only ones with a current use case that exposes the vulnerability. It is possible for any KNI operation to encounter this issue with the new async mechanism. As long as the call to kni_net_process_request() is a sepa

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-04 Thread Elad Nachman
On Mon, Oct 4, 2021 at 7:05 PM Ferruh Yigit wrote: > On 10/4/2021 3:58 PM, Elad Nachman wrote: > > בתאריך יום ב׳, 4 באוק׳ 2021, 17:51, מאת Ferruh Yigit ‏< > > ferruh.yi...@intel.com>: > > > >> On 10/4/2021 3:25 PM, Elad Nachman wrote: > >> > >> Can you please try to not top post, it will make imp

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-04 Thread Ferruh Yigit
On 10/4/2021 3:58 PM, Elad Nachman wrote: > בתאריך יום ב׳, 4 באוק׳ 2021, 17:51, מאת Ferruh Yigit ‏< > ferruh.yi...@intel.com>: > >> On 10/4/2021 3:25 PM, Elad Nachman wrote: >> >> Can you please try to not top post, it will make impossible to follow this >> discussion later from the mail archives.

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-04 Thread Ferruh Yigit
On 10/4/2021 3:14 PM, Eric Christian wrote: > Adding Sahithi. > > I believe adding the -EAGAIN method puts the responsibility on the > application/caller. If we take the change MAC address as an example. Most > application code just does this kind of check: > > ret = ioctl(sockfd, SIOCS

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-04 Thread Elad Nachman
בתאריך יום ב׳, 4 באוק׳ 2021, 17:51, מאת Ferruh Yigit ‏< ferruh.yi...@intel.com>: > On 10/4/2021 3:25 PM, Elad Nachman wrote: > > Can you please try to not top post, it will make impossible to follow this > discussion later from the mail archives. > > > 1. Userspace will get an error > > So there i

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-04 Thread Ferruh Yigit
On 10/4/2021 3:25 PM, Elad Nachman wrote: Can you please try to not top post, it will make impossible to follow this discussion later from the mail archives. > 1. Userspace will get an error So there is nothing special with returning '-EAGAIN', user will only observe an error. Wasn't initial int

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-04 Thread Elad Nachman
1. Userspace will get an error 2. Waiting with rtnl locked causes a deadlock; waiting with rtnl unlocked for interface down command causes a crash because of a race condition in the device delete/unregister list in the kernel. FYI, Elad. בתאריך יום ב׳, 4 באוק׳ 2021, 17:13, מאת Ferruh Yigit ‏< fe

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-04 Thread Eric Christian
Adding Sahithi. I believe adding the -EAGAIN method puts the responsibility on the application/caller. If we take the change MAC address as an example. Most application code just does this kind of check: ret = ioctl(sockfd, SIOCSIFHWADDR, &ifr); if (ret < 0) { P

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-04 Thread Ferruh Yigit
On 10/4/2021 2:09 PM, Elad Nachman wrote: > Hi, > > EAGAIN is propogated back to the kernel and to the caller. > So will the user get an error, or it will be handled by the kernel and retried? > We cannot retry from the kni kernel module since we hold the rtnl lock. > Why not? We are already

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-04 Thread Elad Nachman
Hi, EAGAIN is propogated back to the kernel and to the caller. We cannot retry from the kni kernel module since we hold the rtnl lock. FYI, Elad בתאריך יום ב׳, 4 באוק׳ 2021, 16:05, מאת Ferruh Yigit ‏< ferruh.yi...@intel.com>: > On 9/24/2021 11:54 AM, Elad Nachman wrote: > > Fix lack of multip

Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-10-04 Thread Ferruh Yigit
On 9/24/2021 11:54 AM, Elad Nachman wrote: > Fix lack of multiple KNI requests handling support by introducing a > request in progress flag which will fail additional requests with > EAGAIN return code if the original request has not been processed > by user-space. > > Bugzilla ID: 809 Hi Eric,

[dpdk-dev] [PATCH v2] kni: Fix request overwritten

2021-09-24 Thread Elad Nachman
Fix lack of multiple KNI requests handling support by introducing a request in progress flag which will fail additional requests with EAGAIN return code if the original request has not been processed by user-space. Bugzilla ID: 809 Signed-off-by: Elad Nachman --- kernel/linux/kni/kni_net.c | 9