Re:Re: Re: Re: [PATCH v2] RDMA/srpt: fix NULL deref when sending BUSY before target_init_cmd()
kensanya <[email protected]> Wed, 29 Jul 2026 12:04:00 +0800 (CST)
| Newsgroups | org.kernel.vger.linux-rdma |
|---|---|
| Message-ID | <[email protected]> |
>> There is a contradiction between the two suggestions: >> - Bart suggests calling target_init_cmd() before calling >> srpt_get_desc_tbl() (using a placeholder) to ensure that >> target_send_busy() can be safely executed if the >> descriptor parsing fails. >> - Leon points out that target_init_cmd() must receive the >> actual data direction calculated by srpt_get_desc_tbl(), >> rather than a placeholder like DMA_NONE that will >> be overwritten later. >> >> If we continue to modify the current patch, the only way I >> can think of is to extract the direction parsing logic from >> srpt_get_desc_tbl and place it before target_init_cmd, so >> that target_init_cmd can receive the correct direction. >> How about this? > >Say it to your AI tool that it is not contradiction, but wrongly >implemented Bart's suggestion. > >Thanks > According to my understanding, if we swap the order of srpt_get_desc_tbl and target_init_cmd and ensure that target_init_cmd can obtain the correct directory, then my idea is to extract that directory from srpt_get_desc_tbl. If my understanding or implementation differs from the suggestions you provided, I have done my best. Thanks